|
|
@@ -433,45 +433,52 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
//获取所有费用属性关联
|
|
|
List<RuleAttrMappingVo> ruleAttrMappingVoList = RuleAttrMappingVo.getRuleAttrMappingVoList(insAreaCompany, insOrders);
|
|
|
|
|
|
- List<AgreementProductCosts> filterAgreementProductCosts = new ArrayList<>();
|
|
|
-
|
|
|
- boolean isNoCar = false;
|
|
|
- //查找是否有强制非车因子
|
|
|
- for(int i=0;i<agreementProductCosts.size();i++) {
|
|
|
- PtlAgreementProductCostsAttrLink ptlAgreementProductCostsAttrLink =
|
|
|
- agreementProductCosts.get(i).getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("IsNonMotorInsurance")).findFirst().orElse(null);
|
|
|
-
|
|
|
- if(!Objects.isNull(ptlAgreementProductCostsAttrLink)){
|
|
|
- if(ptlAgreementProductCostsAttrLink.getMin().equals("1")){
|
|
|
- //只走强制非车的费用因子
|
|
|
- AgreementProductCosts productCosts = agreementProductCosts.get(i);
|
|
|
- filterAgreementProductCosts.add(productCosts);
|
|
|
- isNoCar = true;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- if(filterAgreementProductCosts.isEmpty()){
|
|
|
- filterAgreementProductCosts = agreementProductCosts;
|
|
|
- }
|
|
|
+// List<AgreementProductCosts> filterAgreementProductCosts = new ArrayList<>();
|
|
|
+
|
|
|
+// boolean isNoCar = false;
|
|
|
+// //查找是否有强制非车因子
|
|
|
+// for(int i=0;i<agreementProductCosts.size();i++) {
|
|
|
+// PtlAgreementProductCostsAttrLink ptlAgreementProductCostsAttrLink =
|
|
|
+// agreementProductCosts.get(i).getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("IsNonMotorInsurance")).findFirst().orElse(null);
|
|
|
+//
|
|
|
+// if(!Objects.isNull(ptlAgreementProductCostsAttrLink)){
|
|
|
+// if(ptlAgreementProductCostsAttrLink.getMin().equals("1")){
|
|
|
+// //只走强制非车的费用因子
|
|
|
+// AgreementProductCosts productCosts = agreementProductCosts.get(i);
|
|
|
+// filterAgreementProductCosts.add(productCosts);
|
|
|
+// isNoCar = true;
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if(filterAgreementProductCosts.isEmpty()){
|
|
|
+// filterAgreementProductCosts = agreementProductCosts;
|
|
|
+// }
|
|
|
//是否强制走非车
|
|
|
- if(isNoCar) {
|
|
|
- for(int i=0;i<filterAgreementProductCosts.size();i++) {
|
|
|
- if (judgementsIsNoCar(filterAgreementProductCosts.get(i).getCostsAttrLinks(), undwrtRulesAttrList, ruleAttrMappingVoList)) {
|
|
|
- return filterAgreementProductCosts.get(i).getId();
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
- for (int i = 0; i < filterAgreementProductCosts.size(); i++) {
|
|
|
- //判断是否匹配
|
|
|
- if (judgements(filterAgreementProductCosts.get(i).getCostsAttrLinks(), undwrtRulesAttrList, ruleAttrMappingVoList)) {
|
|
|
- //返回 费用id 如果需要匹配非车的情况 将返回值返回list 后赛选
|
|
|
- return filterAgreementProductCosts.get(i).getId();
|
|
|
- }
|
|
|
+// if(isNoCar) {
|
|
|
+// for(int i=0;i<filterAgreementProductCosts.size();i++) {
|
|
|
+// if (judgementsIsNoCar(filterAgreementProductCosts.get(i).getCostsAttrLinks(), undwrtRulesAttrList, ruleAttrMappingVoList)) {
|
|
|
+// return filterAgreementProductCosts.get(i).getId();
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// for (int i = 0; i < filterAgreementProductCosts.size(); i++) {
|
|
|
+// //判断是否匹配
|
|
|
+// if (judgements(filterAgreementProductCosts.get(i).getCostsAttrLinks(), undwrtRulesAttrList, ruleAttrMappingVoList)) {
|
|
|
+// //返回 费用id 如果需要匹配非车的情况 将返回值返回list 后赛选
|
|
|
+// return filterAgreementProductCosts.get(i).getId();
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+ for (int i = 0; i < agreementProductCosts.size(); i++) {
|
|
|
+ //判断是否匹配
|
|
|
+ if (judgements(agreementProductCosts.get(i).getCostsAttrLinks(), undwrtRulesAttrList, ruleAttrMappingVoList)) {
|
|
|
+ //返回 费用id 如果需要匹配非车的情况 将返回值返回list 后赛选
|
|
|
+ return agreementProductCosts.get(i).getId();
|
|
|
}
|
|
|
}
|
|
|
-// return null;
|
|
|
- throw new SystemException("费用因子匹配失败");
|
|
|
+ return null;
|
|
|
+// throw new SystemException("费用因子匹配失败");
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -509,30 +516,33 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
|
|
|
//查找规则中的 传值属性
|
|
|
RuleAttrMappingVo ruleAttrMappingVo = ruleAttrMappingVoList.stream().filter(x -> x.getAttrCode().equals(ptlAgreementProductCostsAttrLinks.get(finalI).getAttrCode())).findFirst().orElse(null);
|
|
|
+
|
|
|
+ //先跳过强制非车的检测
|
|
|
+ if(ptlAgreementProductCostsAttrLinks.get(i).getAttrCode().equals("IsNonMotorInsurance"))
|
|
|
+ continue;
|
|
|
+
|
|
|
//如果查找不到 传值属性 直接费用对比失败
|
|
|
- if(ruleAttrMappingVo == null)
|
|
|
+ if(ruleAttrMappingVo == null){
|
|
|
+ System.out.printf("规则匹配失败:" + ptlAgreementProductCostsAttrLinks.get(i).getAttrCode());
|
|
|
+ System.out.printf("传入的值找不到该属性:" + ptlAgreementProductCostsAttrLinks.get(finalI).getAttrCode());
|
|
|
+ System.out.printf("\n\n");
|
|
|
return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//查找 费用因子规则
|
|
|
PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = rulesAttrs.stream().filter(x -> x.getAttrCode().equals(ptlAgreementProductCostsAttrLinks.get(finalI).getAttrCode())).findFirst().get();
|
|
|
- //如果是多选 对value进行转换
|
|
|
- if(ptlAgreementUndwrtRulesAttr.getAttrType().equals("checkbox")) {
|
|
|
- PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementUndwrtRulesAttr.getDictLabal().stream().filter(x ->
|
|
|
- x.getCode().equals(ruleAttrMappingVo.getValue())).findFirst().orElse(null);
|
|
|
- ruleAttrMappingVo.setValue(ptlAgreementUndwrtRulesDictLabal.getName());
|
|
|
- }
|
|
|
- //如果是单选 并且是 性别的话 转换为code
|
|
|
- if(ptlAgreementUndwrtRulesAttr.getAttrType().equals("radio"))
|
|
|
- {
|
|
|
- if("CarOwnersSex".equals(ptlAgreementUndwrtRulesAttr.getAttrCode()) || "ApplicantSex".equals(ptlAgreementUndwrtRulesAttr.getAttrCode()) ||
|
|
|
- "InsuredSex".equals(ptlAgreementUndwrtRulesAttr.getAttrCode())){
|
|
|
- PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementUndwrtRulesAttr.getDictLabal().stream().filter(x ->
|
|
|
- x.getName().equals(ruleAttrMappingVo.getValue())).findFirst().orElse(null);
|
|
|
- ruleAttrMappingVo.setValue(ptlAgreementUndwrtRulesDictLabal.getCode());
|
|
|
- }
|
|
|
- }
|
|
|
- useFlag = attrEqual(ptlAgreementProductCostsAttrLinks.get(i), ptlAgreementUndwrtRulesAttr, ruleAttrMappingVo.getAttrCode());
|
|
|
- if(!useFlag)
|
|
|
+
|
|
|
+ useFlag = attrEqual(ptlAgreementProductCostsAttrLinks.get(i), ptlAgreementUndwrtRulesAttr, ruleAttrMappingVo.getValue());
|
|
|
+ if(!useFlag){
|
|
|
+ System.out.printf("规则匹配失败:" + ptlAgreementProductCostsAttrLinks.get(i).getAttrCode());
|
|
|
+ System.out.printf("检验的值:" + ptlAgreementProductCostsAttrLinks.get(i).getMin());
|
|
|
+ System.out.printf("传入的值:" + ruleAttrMappingVo.getValue());
|
|
|
+ System.out.printf("\n\n");
|
|
|
return false;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
return useFlag;
|
|
|
}
|