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

白名单匹配

parent e9388ec7
......@@ -8,5 +8,7 @@ import org.springframework.data.querydsl.QueryDslPredicateExecutor;
public interface IWhiteListRepository extends JpaRepository<WhiteListEntity, Long>, QueryDslPredicateExecutor<WhiteListEntity> {
WhiteListEntity getByPhoneEquals(String phone);
WhiteListEntity getByPhoneEqualsAndStatusEqualsAndFundProIdEquals(String phone, Byte status, Long fundProId);
WhiteListEntity getByPhoneEqualsAndFundIdEqualsAndFundProIdEquals(String phone,Long fundId,Long fundProId);
}
......@@ -96,28 +96,28 @@ public class CoreFilter {
//白名单
WhiteListEntity whiteListEntity = whiteListRepository.getByPhoneEquals(associationBean.getPhoneNo());
if (whiteListEntity != null && whiteListEntity.getStatus().equals(Byte.valueOf("1"))) {
log.info("白名单用户,phoneNo:{}", associationBean.getPhoneNo());
channelRuleEntityList = channelRuleRepository.getByChannelIdAndFundProductIdOrderByPriority(Long.parseLong(auditResponce.getBizChannel()), whiteListEntity.getFundProductId());
} else {
channelRuleEntityList = channelRuleRepository.getByChannelIdOrderByPriority(Long.parseLong(auditResponce.getBizChannel()));
}
if (CollectionUtils.isEmpty(channelRuleEntityList)) {
throw new RuntimeException("渠道配置产品集不存在,运营人员配置有问题");
}
for (ChannelRuleEntity channelRuleEntity : channelRuleEntityList) {
if (channelRuleEntity.getPublishStatus().equals(0)) {
continue;
}
FundProductEntity fundProduct = fundProductRepository.getByIdEquals(channelRuleEntity.getFundProductId());
log.info("coreHandle | 开始路由channelRuleEntity={}", channelRuleEntity.toString());
if (fundProduct == null) {
log.error("这种情况不可能出现,需要看下原因 {}", JSON.toJSONString(channelRuleEntity));
continue;
}
if (currentVerify(fundProduct, auditResponce, associationBean, channelRuleEntity)) {
log.info("coreHandle | 所有规则校验通过");
financeProducts.add(build(auditResponce, fundProduct, channelRuleEntity));
routingRecordList.add(generateRouteRecord(channelRuleEntity));
log.error("渠道配置产品集不存在,运营人员配置有问题, bizNo:{}", auditResponce.getBizNo());
} else {
for (ChannelRuleEntity channelRuleEntity : channelRuleEntityList) {
if (channelRuleEntity.getPublishStatus().equals(0)) {
continue;
}
FundProductEntity fundProduct = fundProductRepository.getByIdEquals(channelRuleEntity.getFundProductId());
log.info("coreHandle | 开始路由channelRuleEntity={}", channelRuleEntity.toString());
if (fundProduct == null) {
log.error("这种情况不可能出现,需要看下原因 {}", JSON.toJSONString(channelRuleEntity));
continue;
}
if (currentVerify(fundProduct, auditResponce, associationBean, channelRuleEntity)) {
log.info("coreHandle | 所有规则校验通过");
financeProducts.add(build(auditResponce, fundProduct, channelRuleEntity));
routingRecordList.add(generateRouteRecord(channelRuleEntity));
}
}
}
if (CollectionUtils.isEmpty(financeProducts)) {
......@@ -154,8 +154,8 @@ public class CoreFilter {
routingRecordRepository.save(routingRecordEntity);
}
} catch (Exception e) {
log.error("资金路由分发出现异常, uuid : {}, bizChannel : {}, bizType : {}, bizNo : {} ", auditResponce.getUuid(),
auditResponce.getBizChannel(), auditResponce.getBizType());
log.error("资金路由分发出现异常, uuid : {}, bizChannel : {}, bizType : {}, bizNo : {} e:{}", auditResponce.getUuid(),
auditResponce.getBizChannel(), auditResponce.getBizType(), ExceptionUtils.getStackTrace(e));
distributeFailLogService.saveDistributeFailLogNew(auditResponce, ExceptionUtils.getMessage(e));
alarmService.dingtalkAlarm("Warn", "资金路由分发出现异常", "bizChannel : " + auditResponce.getBizChannel()
+ " , bizType : " + auditResponce.getBizType() + " , bizNo : " + auditResponce.getBizNo()
......@@ -193,7 +193,11 @@ public class CoreFilter {
if (fundProduct.getEnable().equals(new Byte("0"))) {
return Boolean.FALSE;
}
WhiteListEntity whiteListEntity = whiteListRepository.getByPhoneEquals(associationBean.getPhoneNo());
WhiteListEntity whiteListEntity = whiteListRepository.getByPhoneEqualsAndStatusEqualsAndFundProIdEquals(associationBean.getPhoneNo(),
new Byte("1"), fundProduct.getFundProId());
if (whiteListEntity != null) {
log.info("白名单用户,phoneNo:{}", associationBean.getPhoneNo());
}
Boolean basicInfoVerify = basicInfoVerify(fundProduct, associationBean, auditResponce, channelRuleEntity);
if (whiteListEntity != null && basicInfoVerify) {
log.info("currentVerify | 走白名单");
......
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