GitBucket
4.23.0
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
yn-bftl-byx
/
common
Browse code
增加最小及最大单笔金额
master
1 parent
9b3e66a
commit
544394c54c220d52d25719e78dde0e63588b3005
steven
authored
on 5 Sep
Patch
Showing
1 changed file
src/main/java/com/yn/bftl/common/modules/relation/entity/BusinessRelations.java
Ignore Space
Show notes
View
src/main/java/com/yn/bftl/common/modules/relation/entity/BusinessRelations.java
package com.yn.bftl.common.modules.relation.entity; import com.google.common.base.MoreObjects; import com.yn.bftl.common.common.entity.AuditableModel; import com.yn.bftl.common.modules.company.entity.Company; import com.yn.bftl.common.modules.company.enums.RelationType; import javax.persistence.*; import java.io.Serializable; import java.math.BigDecimal; import java.util.Objects; @Entity @Cacheable(false) @Table(name = "RELATION_BUSINESS_RELATIONS", indexes = { @Index(columnList = "source_company"), @Index(columnList = "target_company") }) @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class BusinessRelations extends AuditableModel implements Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RELATION_BUSINESS_RELATIONS_SEQ") @SequenceGenerator(name = "RELATION_BUSINESS_RELATIONS_SEQ", sequenceName = "RELATION_BUSINESS_RELATIONS_SEQ", allocationSize = 1) private Long id; /** * 来源企业 */ @ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @JoinColumn(name = "source_company") private Company sourceCompany; /** * 目标企业 */ @ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @JoinColumn(name = "target_company") private Company targetCompany; /** * 关系类型 */ @Enumerated(EnumType.STRING) private RelationType relationType; /** * 服务费比例 */ private BigDecimal serviceFee = new BigDecimal("0"); private String attrs; /** * 单笔金额最小值 */ private BigDecimal rateMinSettAmt; /** * 单笔金额最大值 */ private BigDecimal rateMaxSettAmt; public BusinessRelations() { } @Override public Long getId() { return id; } @Override public void setId(Long id) { this.id = id; } public Company getSourceCompany() { return sourceCompany; } public void setSourceCompany(Company sourceCompany) { this.sourceCompany = sourceCompany; } public Company getTargetCompany() { return targetCompany; } public void setTargetCompany(Company targetCompany) { this.targetCompany = targetCompany; } public RelationType getRelationType() { return relationType; } public void setRelationType(RelationType relationType) { this.relationType = relationType; } public BigDecimal getServiceFee() { return serviceFee == null ? BigDecimal.ZERO : serviceFee; } public void setServiceFee(BigDecimal serviceFee) { this.serviceFee = serviceFee; } public String getAttrs() { return attrs; } public void setAttrs(String attrs) { this.attrs = attrs; } public BigDecimal getRateMinSettAmt() { return rateMinSettAmt; } public void setRateMinSettAmt(BigDecimal rateMinSettAmt) { this.rateMinSettAmt = rateMinSettAmt; } public BigDecimal getRateMaxSettAmt() { return rateMaxSettAmt; } public void setRateMaxSettAmt(BigDecimal rateMaxSettAmt) { this.rateMaxSettAmt = rateMaxSettAmt; } @Override public boolean equals(Object obj) { if (obj == null) return false; if (this == obj) return true; if (!(obj instanceof BusinessRelations)) return false; final BusinessRelations other = (BusinessRelations) obj; if (this.getId() != null || other.getId() != null) { return Objects.equals(this.getId(), other.getId()); } return false; } @Override public int hashCode() { return 31; } @Override public String toString() { return MoreObjects.toStringHelper(this) .add("id", getId()) .add("relationType", getRelationType()) .add("serviceFee", getServiceFee()) .omitNullValues() .toString(); } }
package com.yn.bftl.common.modules.relation.entity; import com.google.common.base.MoreObjects; import com.yn.bftl.common.common.entity.AuditableModel; import com.yn.bftl.common.modules.company.entity.Company; import com.yn.bftl.common.modules.company.enums.RelationType; import javax.persistence.*; import java.io.Serializable; import java.math.BigDecimal; import java.util.Objects; @Entity @Cacheable(false) @Table(name = "RELATION_BUSINESS_RELATIONS", indexes = { @Index(columnList = "source_company"), @Index(columnList = "target_company") }) @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class BusinessRelations extends AuditableModel implements Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RELATION_BUSINESS_RELATIONS_SEQ") @SequenceGenerator(name = "RELATION_BUSINESS_RELATIONS_SEQ", sequenceName = "RELATION_BUSINESS_RELATIONS_SEQ", allocationSize = 1) private Long id; /** * 来源企业 */ @ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @JoinColumn(name = "source_company") private Company sourceCompany; /** * 目标企业 */ @ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @JoinColumn(name = "target_company") private Company targetCompany; /** * 关系类型 */ @Enumerated(EnumType.STRING) private RelationType relationType; /** * 服务费比例 */ private BigDecimal serviceFee = new BigDecimal("0"); private String attrs; public BusinessRelations() { } @Override public Long getId() { return id; } @Override public void setId(Long id) { this.id = id; } public Company getSourceCompany() { return sourceCompany; } public void setSourceCompany(Company sourceCompany) { this.sourceCompany = sourceCompany; } public Company getTargetCompany() { return targetCompany; } public void setTargetCompany(Company targetCompany) { this.targetCompany = targetCompany; } public RelationType getRelationType() { return relationType; } public void setRelationType(RelationType relationType) { this.relationType = relationType; } public BigDecimal getServiceFee() { return serviceFee == null ? BigDecimal.ZERO : serviceFee; } public void setServiceFee(BigDecimal serviceFee) { this.serviceFee = serviceFee; } public String getAttrs() { return attrs; } public void setAttrs(String attrs) { this.attrs = attrs; } @Override public boolean equals(Object obj) { if (obj == null) return false; if (this == obj) return true; if (!(obj instanceof BusinessRelations)) return false; final BusinessRelations other = (BusinessRelations) obj; if (this.getId() != null || other.getId() != null) { return Objects.equals(this.getId(), other.getId()); } return false; } @Override public int hashCode() { return 31; } @Override public String toString() { return MoreObjects.toStringHelper(this) .add("id", getId()) .add("relationType", getRelationType()) .add("serviceFee", getServiceFee()) .omitNullValues() .toString(); } }
Show line notes below