Commit 2a6fd6e9 authored by 王业雄's avatar 王业雄

fix

parent ae662675
......@@ -39,10 +39,7 @@ import shaded.com.google.common.collect.Lists;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author shihuajun
......@@ -85,6 +82,7 @@ public class CoreFilter {
List<RoutingRecordVO> routingRecordList = new ArrayList<>();
for (ChannelRuleEntity channelRuleEntity : channelRuleEntityList) {
FundProductEntity fundProduct = fundProductRepository.getByIdEquals(channelRuleEntity.getFundProductId());
log.info("coreHandle | 开始路由channelRuleEntity={}",channelRuleEntity);
if (fundProduct == null){
log.error("这种情况不可能出现,需要看下原因 {}",JSON.toJSONString(channelRuleEntity));
continue;
......@@ -250,4 +248,5 @@ public class CoreFilter {
}
return Boolean.TRUE;
}
}
......@@ -269,7 +269,7 @@ public class FundProductServiceImpl implements IFundProductService {
allByEnableEquals.stream().forEach(productRuleEntity -> {
String value = ruleValueMap.get(productRuleEntity.getId());
if (!StringUtils.isEmpty(value)){
//10 <= age && age <= 50 && 10 <= amount && amount <= 20000 && term == 12 && ! include(not_permit_tels,tel)
//10 <= age && age <= 50 && 10 <= amount && amount <= 20000 && (term == 12 || term == 11) && ! include(not_permit_tels,tel)
switch (productRuleEntity.getRuleVal()){
case "age":
basicRule.append(value.replace(",", " <= age && age <= ")).append(" && ");
......@@ -278,7 +278,17 @@ public class FundProductServiceImpl implements IFundProductService {
basicRule.append(value.replace(","," <= amount && amount <= ")).append(" && ");
break;
case "term":
basicRule.append("term == ").append(value).append(" && ");
basicRule.append("(");
String[] split = value.split(",");
for (int i = 0;i<split.length;i++){
basicRule.append("term == ").append(split[i]);
if (i != split.length-1){
basicRule.append(" || ");
}
}
basicRule.append(")");
//basicRule.append("term == ").append(value).append(" && ");
break;
case "not_permit_tels":
basicRule.append("! include(not_permit_tels,tel)").append(" && ");
......
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