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

白名单匹配

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