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

风控层-授信结果校验

parent 99b60a40
...@@ -9,7 +9,7 @@ import java.util.List; ...@@ -9,7 +9,7 @@ import java.util.List;
public interface IChannelRuleRepository extends JpaRepository<ChannelRuleEntity, Long>, QueryDslPredicateExecutor<ChannelRuleEntity> { public interface IChannelRuleRepository extends JpaRepository<ChannelRuleEntity, Long>, QueryDslPredicateExecutor<ChannelRuleEntity> {
ChannelRuleEntity getByFundProductIdEquals(long fundProductId); ChannelRuleEntity getByFundProductIdEquals(long fundProductId);
List<ChannelRuleEntity> getByChannelIdOrderByPriority(long channelId); List<ChannelRuleEntity> getByChannelIdAndCreditResultOrderByPriority(long channelId, Integer creditResult);
List<ChannelRuleEntity> getAllByEnableEquals(Boolean enable); List<ChannelRuleEntity> getAllByEnableEquals(Boolean enable);
...@@ -19,5 +19,5 @@ public interface IChannelRuleRepository extends JpaRepository<ChannelRuleEntity, ...@@ -19,5 +19,5 @@ public interface IChannelRuleRepository extends JpaRepository<ChannelRuleEntity,
void deleteAllByChannelIdEqualsAndEnableEquals(Long channelId,Boolean enable); void deleteAllByChannelIdEqualsAndEnableEquals(Long channelId,Boolean enable);
List<ChannelRuleEntity> getByChannelIdAndFundProductIdOrderByPriority(long channelId, long fundProductId); List<ChannelRuleEntity> getByChannelIdAndFundProductIdAndCreditResultOrderByPriority(long channelId, long fundProductId, Integer creditResult);
} }
...@@ -92,13 +92,16 @@ public class CoreFilter { ...@@ -92,13 +92,16 @@ public class CoreFilter {
List<FinanceProduct> financeProducts = new ArrayList<>(); List<FinanceProduct> financeProducts = new ArrayList<>();
List<RoutingRecordVO> routingRecordList = new ArrayList<>(); List<RoutingRecordVO> routingRecordList = new ArrayList<>();
UserAssociationBean associationBean = userCenterService.getUserAssociationBean(auditResponce.getUuid()); UserAssociationBean associationBean = userCenterService.getUserAssociationBean(auditResponce.getUuid());
if (auditResponce.getAuditResult()) {
//白名单 //白名单
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"))) {
channelRuleEntityList = channelRuleRepository.getByChannelIdAndFundProductIdOrderByPriority(Long.parseLong(auditResponce.getBizChannel()), whiteListEntity.getFundProductId()); channelRuleEntityList = channelRuleRepository
.getByChannelIdAndFundProductIdAndCreditResultOrderByPriority(Long.parseLong(auditResponce.getBizChannel()),
whiteListEntity.getFundProductId(), auditResponce.getAuditResult() ? 1 : 0);
} else { } else {
channelRuleEntityList = channelRuleRepository.getByChannelIdOrderByPriority(Long.parseLong(auditResponce.getBizChannel())); channelRuleEntityList = channelRuleRepository
.getByChannelIdAndCreditResultOrderByPriority(Long.parseLong(auditResponce.getBizChannel()),
auditResponce.getAuditResult() ? 1 : 0);
} }
if (CollectionUtils.isEmpty(channelRuleEntityList)) { if (CollectionUtils.isEmpty(channelRuleEntityList)) {
log.error("渠道配置产品集不存在,运营人员配置有问题, bizNo:{}", auditResponce.getBizNo()); log.error("渠道配置产品集不存在,运营人员配置有问题, bizNo:{}", auditResponce.getBizNo());
...@@ -125,7 +128,7 @@ public class CoreFilter { ...@@ -125,7 +128,7 @@ public class CoreFilter {
auditResponce.setAuditResult(false); auditResponce.setAuditResult(false);
} else { } else {
result.setFinanceProducts(JSON.toJSONString(financeProducts)); result.setFinanceProducts(JSON.toJSONString(financeProducts));
} auditResponce.setAuditResult(true);
} }
log.info("coreHandle | 通知业务系统审核结果"); log.info("coreHandle | 通知业务系统审核结果");
Map<String, String> response = httpService.postHasResponse(auditResponce.getCallbackUrl(), result.get(auditResponce)); Map<String, String> response = httpService.postHasResponse(auditResponce.getCallbackUrl(), result.get(auditResponce));
...@@ -217,14 +220,15 @@ public class CoreFilter { ...@@ -217,14 +220,15 @@ public class CoreFilter {
log.error("channelId不符"); log.error("channelId不符");
return Boolean.FALSE; return Boolean.FALSE;
} }
//如果配置不为空,则匹配参数是否符合 //如果配置不为空,则匹配参数是否符合
if (StringUtils.isNotBlank(channelRuleEntity.getUserLevel()) if (StringUtils.isNotBlank(channelRuleEntity.getUserLevel())
&& !channelRuleEntity.getUserLevel().contains(auditResponce.getCreditLevel())) { && (StringUtils.isEmpty(auditResponce.getCreditLevel()) || !channelRuleEntity.getUserLevel().contains(auditResponce.getCreditLevel()))) {
log.error("CreditLevel不符 userLevel:{}", auditResponce.getCreditLevel()); log.error("CreditLevel不符 userLevel:{}", auditResponce.getCreditLevel());
return Boolean.FALSE; return Boolean.FALSE;
} }
if (StringUtils.isNotBlank(channelRuleEntity.getUserTag()) if (StringUtils.isNotBlank(channelRuleEntity.getUserTag())
&& !channelRuleEntity.getUserTag().contains(auditResponce.getUserTag())) { && (StringUtils.isEmpty(auditResponce.getUserTag()) || !channelRuleEntity.getUserTag().contains(auditResponce.getUserTag()))) {
log.error("UserTag不符, userTag:{}", auditResponce.getUserTag()); log.error("UserTag不符, userTag:{}", auditResponce.getUserTag());
return Boolean.FALSE; return Boolean.FALSE;
} }
......
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