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

修改类型&加个日志

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