Commit f4c3171c authored by 技术部-韩成龙's avatar 技术部-韩成龙

修改类型&加个日志

parent 2f5b2992
...@@ -17,12 +17,12 @@ import java.util.Objects; ...@@ -17,12 +17,12 @@ import java.util.Objects;
@DynamicInsert @DynamicInsert
@DynamicUpdate @DynamicUpdate
public class ChannelRuleEntity { public class ChannelRuleEntity {
private long id; private Long id;
private long fundProductId; private Long fundProductId;
private long channelId; private Long channelId;
private Byte publishStatus; private Integer publishStatus;
private long fundId; private Long fundId;
private long fundProId; private Long fundProId;
private String fundName; private String fundName;
private String fundType; private String fundType;
private String orgType; private String orgType;
...@@ -31,69 +31,69 @@ public class ChannelRuleEntity { ...@@ -31,69 +31,69 @@ public class ChannelRuleEntity {
private String userTag; private String userTag;
private String userLevel; private String userLevel;
private Integer priority; private Integer priority;
private Byte routeWait; private Boolean routeWait;
private Byte enable; private Boolean enable;
private Timestamp createdAt; private Timestamp createdAt;
private Timestamp updatedAt; private Timestamp updatedAt;
@Id @Id
@GeneratedValue @GeneratedValue
@Column(name = "id", nullable = false) @Column(name = "id", nullable = false)
public long getId() { public Long getId() {
return id; return id;
} }
public void setId(long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
@Basic @Basic
@Column(name = "fund_product_id", nullable = false) @Column(name = "fund_product_id", nullable = false)
public long getFundProductId() { public Long getFundProductId() {
return fundProductId; return fundProductId;
} }
public void setFundProductId(long fundProductId) { public void setFundProductId(Long fundProductId) {
this.fundProductId = fundProductId; this.fundProductId = fundProductId;
} }
@Basic @Basic
@Column(name = "channel_id", nullable = false) @Column(name = "channel_id", nullable = false)
public long getChannelId() { public Long getChannelId() {
return channelId; return channelId;
} }
public void setChannelId(long channelId) { public void setChannelId(Long channelId) {
this.channelId = channelId; this.channelId = channelId;
} }
@Basic @Basic
@Column(name = "publish_status", nullable = true) @Column(name = "publish_status", nullable = true)
public Byte getPublishStatus() { public Integer getPublishStatus() {
return publishStatus; return publishStatus;
} }
public void setPublishStatus(Byte publishStatus) { public void setPublishStatus(Integer publishStatus) {
this.publishStatus = publishStatus; this.publishStatus = publishStatus;
} }
@Basic @Basic
@Column(name = "fund_id", nullable = false) @Column(name = "fund_id", nullable = false)
public long getFundId() { public Long getFundId() {
return fundId; return fundId;
} }
public void setFundId(long fundId) { public void setFundId(Long fundId) {
this.fundId = fundId; this.fundId = fundId;
} }
@Basic @Basic
@Column(name = "fund_pro_id", nullable = false) @Column(name = "fund_pro_id", nullable = false)
public long getFundProId() { public Long getFundProId() {
return fundProId; return fundProId;
} }
public void setFundProId(long fundProId) { public void setFundProId(Long fundProId) {
this.fundProId = fundProId; this.fundProId = fundProId;
} }
...@@ -179,21 +179,21 @@ public class ChannelRuleEntity { ...@@ -179,21 +179,21 @@ public class ChannelRuleEntity {
@Basic @Basic
@Column(name = "route_wait", nullable = true) @Column(name = "route_wait", nullable = true)
public Byte getRouteWait() { public Boolean getRouteWait() {
return routeWait; return routeWait;
} }
public void setRouteWait(Byte routeWait) { public void setRouteWait(Boolean routeWait) {
this.routeWait = routeWait; this.routeWait = routeWait;
} }
@Basic @Basic
@Column(name = "enable", nullable = true) @Column(name = "enable", nullable = true)
public Byte getEnable() { public Boolean getEnable() {
return enable; return enable;
} }
public void setEnable(Byte enable) { public void setEnable(Boolean enable) {
this.enable = enable; this.enable = enable;
} }
...@@ -219,10 +219,16 @@ public class ChannelRuleEntity { ...@@ -219,10 +219,16 @@ public class ChannelRuleEntity {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ChannelRuleEntity that = (ChannelRuleEntity) o; ChannelRuleEntity that = (ChannelRuleEntity) o;
return id == that.id && fundProductId == that.fundProductId && channelId == that.channelId && fundId == that.fundId && fundProId == that.fundProId && creditResult == that.creditResult && priority == that.priority && Objects.equals(publishStatus, that.publishStatus) && Objects.equals(fundName, that.fundName) && Objects.equals(fundType, that.fundType) && Objects.equals(orgType, that.orgType) && Objects.equals(businessType, that.businessType) && Objects.equals(userTag, that.userTag) && Objects.equals(userLevel, that.userLevel) && Objects.equals(routeWait, that.routeWait) && Objects.equals(enable, that.enable) && Objects.equals(createdAt, that.createdAt) && Objects.equals(updatedAt, that.updatedAt); return id.equals(that.id) && fundProductId.equals(that.fundProductId) && channelId.equals(that.channelId) && fundId
.equals(that.fundId) && fundProId.equals(that.fundProId) && creditResult.equals(that.creditResult)
&& priority.equals(that.priority) && Objects.equals(publishStatus, that.publishStatus) && Objects.equals(fundName, that.fundName) && Objects.equals(fundType, that.fundType) && Objects.equals(orgType, that.orgType) && Objects.equals(businessType, that.businessType) && Objects.equals(userTag, that.userTag) && Objects.equals(userLevel, that.userLevel) && Objects.equals(routeWait, that.routeWait) && Objects.equals(enable, that.enable) && Objects.equals(createdAt, that.createdAt) && Objects.equals(updatedAt, that.updatedAt);
} }
@Override @Override
......
...@@ -132,6 +132,7 @@ public class CoreFilter { ...@@ -132,6 +132,7 @@ public class CoreFilter {
fundInfo.setFundId(fundProduct.getFundId()); fundInfo.setFundId(fundProduct.getFundId());
fundInfo.setFundProductId(fundProduct.getFundProId() + ""); fundInfo.setFundProductId(fundProduct.getFundProId() + "");
fundInfo.setCooperation(CooperationEnum.parse(fundProduct.getOrgType()).ordinal()); fundInfo.setCooperation(CooperationEnum.parse(fundProduct.getOrgType()).ordinal());
fundInfo.setWaitFlg(channelRuleEntity.getRouteWait());
Terms term = new Terms(); Terms term = new Terms();
term.setTerm(Integer.parseInt(auditResponce.getTerm())); term.setTerm(Integer.parseInt(auditResponce.getTerm()));
term.setFundInfos(Lists.newArrayList(fundInfo)); term.setFundInfos(Lists.newArrayList(fundInfo));
...@@ -139,7 +140,8 @@ public class CoreFilter { ...@@ -139,7 +140,8 @@ public class CoreFilter {
financeProduct.setTerms(Lists.newArrayList(term)); financeProduct.setTerms(Lists.newArrayList(term));
financeProduct.setMax(new BigDecimal(auditResponce.getAmount())); financeProduct.setMax(new BigDecimal(auditResponce.getAmount()));
financeProduct.setMin(new BigDecimal(auditResponce.getAmount())); financeProduct.setMin(new BigDecimal(auditResponce.getAmount()));
financeProduct.setWaitFlg(channelRuleEntity.getRouteWait().equals(new Byte("1"))); financeProduct.setWaitFlg(channelRuleEntity.getRouteWait());
log.info("构造资金产品集 financeProduct:{}", JSONObject.toJSONString(financeProduct));
return financeProduct; return financeProduct;
} }
......
package com.quantgroup.asset.distribution.service.newrule.pojo.funds; package com.quantgroup.asset.distribution.service.newrule.pojo.funds;
import com.quantgroup.asset.distribution.service.newrule.pojo.enums.CooperationEnum;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
......
...@@ -185,11 +185,11 @@ public class ChannelRouteServiceImpl implements IChannelRouteService { ...@@ -185,11 +185,11 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
FundProductEntity fundProductEntity = fundProductRepository.getByFundIdEqualsAndFundProIdEqualsAndEnableEquals(channelRuleEntity.getFundId(), channelRuleEntity.getFundProId(), Byte.valueOf("1")); FundProductEntity fundProductEntity = fundProductRepository.getByFundIdEqualsAndFundProIdEqualsAndEnableEquals(channelRuleEntity.getFundId(), channelRuleEntity.getFundProId(), Byte.valueOf("1"));
if (Objects.nonNull(fundProductEntity)){ if (Objects.nonNull(fundProductEntity)){
channelRuleEntity.setFundProductId(fundProductEntity.getId()); channelRuleEntity.setFundProductId(fundProductEntity.getId());
channelRuleEntity.setPublishStatus(Byte.valueOf("0")); channelRuleEntity.setPublishStatus(0);
if (0 == type){ if (0 == type){
channelRuleEntity.setEnable(Byte.valueOf("1")); channelRuleEntity.setEnable(true);
}else { }else {
channelRuleEntity.setEnable(Byte.valueOf("0")); channelRuleEntity.setEnable(false);
} }
channelRuleEntity.setUserTag("["+channelRuleEntity.getUserTag()+"]"); channelRuleEntity.setUserTag("["+channelRuleEntity.getUserTag()+"]");
channelRuleEntity.setUserLevel("["+channelRuleEntity.getUserLevel()+"]"); channelRuleEntity.setUserLevel("["+channelRuleEntity.getUserLevel()+"]");
...@@ -213,7 +213,7 @@ public class ChannelRouteServiceImpl implements IChannelRouteService { ...@@ -213,7 +213,7 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
List<ChannelRuleEntity> all = channelRuleRepository.getAllByChannelIdEqualsAndEnableEquals(channelId, Byte.valueOf("1")); List<ChannelRuleEntity> all = channelRuleRepository.getAllByChannelIdEqualsAndEnableEquals(channelId, Byte.valueOf("1"));
all.stream().forEach(channelRuleEntity -> { all.stream().forEach(channelRuleEntity -> {
channelRuleEntity.setPublishStatus(Byte.valueOf("1")); channelRuleEntity.setPublishStatus(1);
channelRuleRepository.save(channelRuleEntity); channelRuleRepository.save(channelRuleEntity);
}); });
} }
...@@ -224,7 +224,7 @@ public class ChannelRouteServiceImpl implements IChannelRouteService { ...@@ -224,7 +224,7 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
channelRuleRepository.deleteAllByChannelIdEqualsAndEnableEquals(channelId, Byte.valueOf("1")); channelRuleRepository.deleteAllByChannelIdEqualsAndEnableEquals(channelId, Byte.valueOf("1"));
List<ChannelRuleEntity> allByChannelIdEqualsAndEnableEquals = channelRuleRepository.getAllByChannelIdEqualsAndEnableEquals(channelId, Byte.valueOf("0")); List<ChannelRuleEntity> allByChannelIdEqualsAndEnableEquals = channelRuleRepository.getAllByChannelIdEqualsAndEnableEquals(channelId, Byte.valueOf("0"));
allByChannelIdEqualsAndEnableEquals.stream().forEach(channelRuleEntity -> { allByChannelIdEqualsAndEnableEquals.stream().forEach(channelRuleEntity -> {
channelRuleEntity.setEnable(Byte.valueOf("1")); channelRuleEntity.setEnable(true);
channelRuleRepository.save(channelRuleEntity); channelRuleRepository.save(channelRuleEntity);
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment