Commit 58f69cb1 authored by 鹿朋's avatar 鹿朋

Merge branch 'fund_route' of http://git.quantgroup.cn/data-spider/asset-server into fund_route

parents eec5a9f5 d4b50d3a
......@@ -12,8 +12,9 @@ public enum UserTag {
INITIAL_APPLICATION("INITIAL_APPLICATION","首申"),
REAPPLICATION("REAPPLICATION","复申"),
RE_LOAN("RE_LOAN","复贷"),
NO_ABLES("NO_ABLES","无标签"),
OTHERS("OTHERS","其他");
// NO_ABLES("NO_ABLES","无标签"),
// OTHERS("OTHERS","其他"),
;
private String value;
......
......@@ -90,7 +90,7 @@ public class CoreFilter {
@Transactional(rollbackFor = Exception.class)
public void coreHandle(AuditResponce auditResponce) {
try {
List<ChannelRuleEntity> channelRuleEntityList;
List<ChannelRuleEntity> channelRuleEntityList = new ArrayList<>();
FilterResult result = new FilterResult();
List<FinanceProduct> financeProducts = new ArrayList<>();
List<RoutingRecordVO> routingRecordList = new ArrayList<>();
......@@ -98,9 +98,10 @@ public class CoreFilter {
//白名单
WhiteListEntity whiteListEntity = whiteListRepository.getByPhoneEquals(associationBean.getPhoneNo());
if (whiteListEntity != null && whiteListEntity.getStatus().equals(Byte.valueOf("1"))) {
channelRuleEntityList = channelRuleRepository
.getByChannelIdAndFundProductIdAndCreditResultOrderByPriority(Long.parseLong(auditResponce.getBizChannel()),
whiteListEntity.getFundProductId(), auditResponce.getAuditResult() ? 1 : 0);
if (auditResponce.getAuditResult()) {
ChannelRuleEntity channelRuleEntity = buildFakeChannelRule(whiteListEntity, auditResponce);
channelRuleEntityList.add(channelRuleEntity);
}
} else {
channelRuleEntityList = channelRuleRepository
.getByChannelIdAndCreditResultOrderByPriority(Long.parseLong(auditResponce.getBizChannel()),
......@@ -161,7 +162,7 @@ public class CoreFilter {
}
} catch (Exception e) {
log.error("资金路由分发出现异常, uuid : {}, bizChannel : {}, bizType : {}, bizNo : {} e:{}", auditResponce.getUuid(),
auditResponce.getBizChannel(), auditResponce.getBizType(), ExceptionUtils.getStackTrace(e));
auditResponce.getBizChannel(), auditResponce.getBizType(), auditResponce.getBizNo(), ExceptionUtils.getStackTrace(e));
distributeFailLogService.saveDistributeFailLogNew(auditResponce, ExceptionUtils.getMessage(e));
alarmService.dingtalkAlarm("Warn", "资金路由分发出现异常", "bizChannel : " + auditResponce.getBizChannel()
+ " , bizType : " + auditResponce.getBizType() + " , bizNo : " + auditResponce.getBizNo()
......@@ -170,6 +171,25 @@ public class CoreFilter {
}
}
private ChannelRuleEntity buildFakeChannelRule(WhiteListEntity white, AuditResponce auditResult) {
ChannelRuleEntity ruleEntity = new ChannelRuleEntity();
ruleEntity.setEnable(true);
ruleEntity.setPublishStatus(1);
ruleEntity.setFundProductId(white.getFundProductId());
ruleEntity.setBusinessType(white.getBusinessType());
ruleEntity.setChannelId(Long.valueOf(auditResult.getBizChannel()));
ruleEntity.setCreditResult(1);
ruleEntity.setFundId(white.getFundId());
ruleEntity.setFundName(white.getFundName());
ruleEntity.setFundProId(white.getFundProId());
ruleEntity.setId(-9999L);
ruleEntity.setOrgType(white.getOrgType());
ruleEntity.setPriority(1);
ruleEntity.setRouteWait(false);
ruleEntity.setFundType(white.getFundType());
return ruleEntity;
}
private RoutingRecordVO generateRouteRecord(ChannelRuleEntity channelRuleEntity) {
RoutingRecordVO routingRecordVO = new RoutingRecordVO();
BeanUtils.copyProperties(channelRuleEntity, routingRecordVO);
......@@ -247,7 +267,7 @@ public class CoreFilter {
}
String userTag = String.valueOf(data.get(AssetAttributeConstants.USER_LOAN_TYPE_V4));
if (!ruleUserTag.contains(userTag)) {
log.error("UserTag不符, 特征userTag:{},配置userTag", userTag, ruleUserTag);
log.error("UserTag不符, 特征userTag:{},配置userTag:{}", userTag, ruleUserTag);
return Boolean.FALSE;
}
}
......
package com.quantgroup.asset.distribution.service.newrule.third;
import com.quantgroup.asset.distribution.enums.route.UserTag;
import lombok.Data;
import org.apache.commons.lang3.math.NumberUtils;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
......@@ -124,21 +122,6 @@ public class AuditResponce {
*/
private String specialUserList;
private String userTag;
private String assetNo;
public String getUserTag() {
if (!NumberUtils.isCreatable(userTag)) {
return userTag;
}
UserTag[] tags = UserTag.values();
for (UserTag tag : tags) {
if (Integer.valueOf(userTag).equals(tag.ordinal())) {
return tag.getValue();
}
}
return UserTag.OTHERS.getValue();
}
}
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