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

fix

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