Przeglądaj źródła

协议调度的bug处理

785834757 1 miesiąc temu
rodzic
commit
b08552a2f2

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/costs/vo/ValidateSchemeRuleVo.java

@@ -64,6 +64,8 @@ public class ValidateSchemeRuleVo {
         this.quoteVo.getCarInfoVo().setCarKindCode(
         this.quoteVo.getCarInfoVo().setCarKindCode(
                 vehicleUseCode.stream().filter(x->x.getValue().equals(this.quoteVo.getCarInfoVo().getCarKindCode())).findFirst().get().getValue()
                 vehicleUseCode.stream().filter(x->x.getValue().equals(this.quoteVo.getCarInfoVo().getCarKindCode())).findFirst().get().getValue()
         );
         );
+
+        this.quoteVo.setProductCode(schemeRuleFilterVo.getProductId());
         System.out.printf(JSONObject.toJSONString(this.quoteVo));
         System.out.printf(JSONObject.toJSONString(this.quoteVo));
     }
     }
 }
 }

+ 8 - 6
commons/src/main/java/com/jzg/commons/entity/po/PtlAgreementUndwrtRulesDictLabal.java

@@ -21,12 +21,14 @@ public class PtlAgreementUndwrtRulesDictLabal {
     @TableId(value = "id", type = IdType.AUTO)
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
     private Integer id;
 
 
-    public String getIdStr(){
-        if(id == null){
-            return StringUtils.EMPTY;
-        }
-        return Objects.toString(this.id);
-    }
+    @TableField(exist = false)
+    private String idStr;
+//    public String getIdStr(){
+//        if(id == null){
+//            return StringUtils.EMPTY;
+//        }
+//        return Objects.toString(this.id);
+//    }
 
 
     @TableField(value = "parent_id")
     @TableField(value = "parent_id")
     private Integer parentId;
     private Integer parentId;

+ 1 - 0
tenant/costsorrule/src/main/java/com/jzg/costsorrule/controller/RuleController.java

@@ -95,6 +95,7 @@ public class RuleController extends BaseController {
 
 
         //将传入的对象转换成Map对象用于校验因子
         //将传入的对象转换成Map对象用于校验因子
         ruleService.traverseJsonObject(JSON.parseObject(JSON.toJSONString(validateDispatchRuleVo.getQuoteVo())),attrMap);
         ruleService.traverseJsonObject(JSON.parseObject(JSON.toJSONString(validateDispatchRuleVo.getQuoteVo())),attrMap);
+        attrMap.put("insruanceproduct",validateDispatchRuleVo.getQuoteVo().getProductCode());
         List<PtlAgreementUndwrtRulesAttr> rulesAttrs = ptlAgreementUndwrtRulesAttrMapper.selectList(new LambdaQueryWrapper<>());
         List<PtlAgreementUndwrtRulesAttr> rulesAttrs = ptlAgreementUndwrtRulesAttrMapper.selectList(new LambdaQueryWrapper<>());
 
 
         //转换对象 将List<PtlSchemeRulesAttrLink>转换为List<RuleAttrLinkVo>
         //转换对象 将List<PtlSchemeRulesAttrLink>转换为List<RuleAttrLinkVo>

+ 3 - 3
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementCostServiceImpl.java

@@ -164,9 +164,9 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public HttpResult<String> update(PtlAgreementCostEnd ptlAgreementCostEnd) {
     public HttpResult<String> update(PtlAgreementCostEnd ptlAgreementCostEnd) {
         log.info("协议费用修改。ptlAgreementCostEnd=[{}]", JSONUtil.toJsonStr(ptlAgreementCostEnd));
         log.info("协议费用修改。ptlAgreementCostEnd=[{}]", JSONUtil.toJsonStr(ptlAgreementCostEnd));
-        if (ListUtils.hasDuplicates(ptlAgreementCostEnd.getRuleConditions())){
-            return HttpResult.error("已存在相同且有效的费用规则,请检查");
-        }
+//        if (ListUtils.hasDuplicates(ptlAgreementCostEnd.getRuleConditions())){
+//            return HttpResult.error("已存在相同且有效的费用规则,请检查");
+//        }
         // 校验ptlAgreementCostTypeList 数据  exportKeepPointRatio 不能大于 export
         // 校验ptlAgreementCostTypeList 数据  exportKeepPointRatio 不能大于 export
         if (!CollectionUtils.isEmpty(ptlAgreementCostEnd.getPtlAgreementCostTypeList())) {
         if (!CollectionUtils.isEmpty(ptlAgreementCostEnd.getPtlAgreementCostTypeList())) {
             for (PtlAgreementCostEnd.PtlAgreementCostTypeDto ptlAgreementCostTypeDto : ptlAgreementCostEnd.getPtlAgreementCostTypeList()) {
             for (PtlAgreementCostEnd.PtlAgreementCostTypeDto ptlAgreementCostTypeDto : ptlAgreementCostEnd.getPtlAgreementCostTypeList()) {

+ 16 - 2
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementDispatchServiceImpl.java

@@ -118,7 +118,8 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
     public PtlAgreementDispatchVo getAgreementDispatch(PtlAgreementDispatchQuery ptlAgreementDispatchQuery) {
     public PtlAgreementDispatchVo getAgreementDispatch(PtlAgreementDispatchQuery ptlAgreementDispatchQuery) {
         log.info("获取协议调度. ptlAgreementDispatchQuery=[{}]", JSONUtil.toJsonStr(ptlAgreementDispatchQuery));
         log.info("获取协议调度. ptlAgreementDispatchQuery=[{}]", JSONUtil.toJsonStr(ptlAgreementDispatchQuery));
         List<PtlAgreementDispatch> ptlAgreementDispatches = baseMapper.selectList(new LambdaQueryWrapper<PtlAgreementDispatch>()
         List<PtlAgreementDispatch> ptlAgreementDispatches = baseMapper.selectList(new LambdaQueryWrapper<PtlAgreementDispatch>()
-                .eq(PtlAgreementDispatch::getCompanyId, ptlAgreementDispatchQuery.getCompanyId()));
+                .eq(PtlAgreementDispatch::getCompanyId, ptlAgreementDispatchQuery.getCompanyId())
+                .orderByAsc(PtlAgreementDispatch::getCreateTime));
         PtlAgreementDispatchVo dispatchVos = new PtlAgreementDispatchVo();
         PtlAgreementDispatchVo dispatchVos = new PtlAgreementDispatchVo();
         List<String> dispatchIds = ptlAgreementDispatches.stream().map(PtlAgreementDispatch::getId).collect(Collectors.toList());
         List<String> dispatchIds = ptlAgreementDispatches.stream().map(PtlAgreementDispatch::getId).collect(Collectors.toList());
         if (!dispatchIds.isEmpty()) {
         if (!dispatchIds.isEmpty()) {
@@ -144,8 +145,19 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
             int index = 1;
             int index = 1;
             // add by lipf, 对协议配置中的字典序号进行转义 2026年5月20日16:43:34
             // add by lipf, 对协议配置中的字典序号进行转义 2026年5月20日16:43:34
             List<PtlAgreementUndwrtRulesDictLabal> ptlAgreementUndwrtRulesDictLabals = baseMapper.queryAllDictLabal();
             List<PtlAgreementUndwrtRulesDictLabal> ptlAgreementUndwrtRulesDictLabals = baseMapper.queryAllDictLabal();
+            ptlAgreementUndwrtRulesDictLabals.forEach(x -> {
+                if(x.getDictId() == 182 || x.getDictId() == 4 || x.getDictId() == 5){
+                    x.setIdStr(x.getCode());
+                }else{
+                    x.setIdStr(String.valueOf(x.getId()));
+                }
+            });
             Map<String, String> dictLabalId2Name = ptlAgreementUndwrtRulesDictLabals.stream()
             Map<String, String> dictLabalId2Name = ptlAgreementUndwrtRulesDictLabals.stream()
-                    .collect(Collectors.toMap(PtlAgreementUndwrtRulesDictLabal::getIdStr, PtlAgreementUndwrtRulesDictLabal::getName));
+                    .collect(Collectors.toMap(
+                            dict -> dict.getDictId() == 182 ? dict.getCode() : dict.getIdStr(),
+                            PtlAgreementUndwrtRulesDictLabal::getName,
+                            (existing, replacement) -> existing
+                    ));
             Map<String, PtlAreaLicense> areaLicenseMap = ptlAreaLicenseService.queryAllAreaLicenseMap();
             Map<String, PtlAreaLicense> areaLicenseMap = ptlAreaLicenseService.queryAllAreaLicenseMap();
 
 
             Map<String,String> operatorMap = new HashMap<>();
             Map<String,String> operatorMap = new HashMap<>();
@@ -192,12 +204,14 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
 
 
                         attrlink.setMaxName(maxName);
                         attrlink.setMaxName(maxName);
                     }
                     }
+                    System.out.printf(attrlink.getAttrCode()+"\n");
                     PtlAgreementUndwrtRulesAttr undwrtRuleAttrByAttrCode = ptlAgreementUndwrtRulesAttrService.getUndwrtRuleAttrByAttrCode(attrlink.getAttrCode());
                     PtlAgreementUndwrtRulesAttr undwrtRuleAttrByAttrCode = ptlAgreementUndwrtRulesAttrService.getUndwrtRuleAttrByAttrCode(attrlink.getAttrCode());
                     if(undwrtRuleAttrByAttrCode != null){
                     if(undwrtRuleAttrByAttrCode != null){
                         attrlink.setAttrCodeName(undwrtRuleAttrByAttrCode.getAttrName());
                         attrlink.setAttrCodeName(undwrtRuleAttrByAttrCode.getAttrName());
                         if(undwrtRuleAttrByAttrCode.getDictId() != null){
                         if(undwrtRuleAttrByAttrCode.getDictId() != null){
                             attrlink.setAttrCodeName(undwrtRuleAttrByAttrCode.getAttrName());
                             attrlink.setAttrCodeName(undwrtRuleAttrByAttrCode.getAttrName());
                             List<PtlAgreementUndwrtRulesDictLabal> dictLabelsByTypeCode = ptlAgreementUndwrtRulesDictLabalService.getDictLabelsByTypeCode(undwrtRuleAttrByAttrCode.getDictId());
                             List<PtlAgreementUndwrtRulesDictLabal> dictLabelsByTypeCode = ptlAgreementUndwrtRulesDictLabalService.getDictLabelsByTypeCode(undwrtRuleAttrByAttrCode.getDictId());
+
                             PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = dictLabelsByTypeCode.stream().filter(x -> x.getCode().equals(attrlink.getMin())).findFirst().orElse(null);
                             PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = dictLabelsByTypeCode.stream().filter(x -> x.getCode().equals(attrlink.getMin())).findFirst().orElse(null);
                             if(ptlAgreementUndwrtRulesDictLabal != null){
                             if(ptlAgreementUndwrtRulesDictLabal != null){
                                 if(attrlink.getAttrDesc() == null){
                                 if(attrlink.getAttrDesc() == null){

+ 12 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesAttrServiceImpl.java

@@ -119,6 +119,18 @@ public class PtlAgreementUndwrtRulesAttrServiceImpl extends ServiceImpl<PtlAgree
             Map<Integer, List<PtlAgreementUndwrtRulesDictLabal>> dictMap = undwrtRulesDictList.stream()
             Map<Integer, List<PtlAgreementUndwrtRulesDictLabal>> dictMap = undwrtRulesDictList.stream()
                     .collect(Collectors.groupingBy(PtlAgreementUndwrtRulesDictLabal::getDictId));
                     .collect(Collectors.groupingBy(PtlAgreementUndwrtRulesDictLabal::getDictId));
             initializeAttributes(list, dictMap);
             initializeAttributes(list, dictMap);
+            list.forEach(item -> {
+                if (item.getAttrType().equals("checkbox")) {
+                    item.getDictLabal().forEach(x->{
+                        x.setIdStr(x.getCode());
+                    });
+                } else {
+                    item.getDictLabal().forEach(x->{
+                        x.setIdStr(String.valueOf(x.getId()));
+                    });
+                }
+
+            });
             return list;
             return list;
         } catch (Exception e) {
         } catch (Exception e) {
             // 处理异常
             // 处理异常

+ 6 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java

@@ -480,7 +480,12 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
         }
         }
 
 
         //根据基本规则 能源、车辆类型、使用性质获取方案
         //根据基本规则 能源、车辆类型、使用性质获取方案
-        List<PtlScheme> ptlSchemes = ptlSchemeMapper.selectList(new LambdaQueryWrapper<PtlScheme>().eq(PtlScheme::getEnergyType, schemeRuleFilterVo.getCarInfo().getEnergyTypeCode().equals("0") ? "0" : "1").like(PtlScheme::getCarnature, schemeRuleFilterVo.getCarInfo().getCarNatureCode()).like(PtlScheme::getVehicleType, schemeRuleFilterVo.getCarInfo().getCarKindCode()).eq(PtlScheme::getProductId, schemeRuleFilterVo.getProductId()).eq(PtlScheme::getIsDelete, 0));
+        List<PtlScheme> ptlSchemes = ptlSchemeMapper.selectList(new LambdaQueryWrapper<PtlScheme>()
+                .eq(PtlScheme::getEnergyType, schemeRuleFilterVo.getCarInfo().getEnergyTypeCode().equals("0") ? "0" : "1")
+                .like(PtlScheme::getCarnature, schemeRuleFilterVo.getCarInfo().getCarNatureCode())
+                .like(PtlScheme::getVehicleType, schemeRuleFilterVo.getCarInfo().getCarKindCode())
+                .eq(PtlScheme::getProductId, schemeRuleFilterVo.getProductId())
+                .eq(PtlScheme::getIsDelete, 0));
         log.info("根据车辆信息匹配保险方案:匹配到[{}]个方案。 energyType(能源类型)=[{}],carNatureCode(使用性质)=[{}],carKindCode(车辆性质)=[{}], productId(产品id)=[{}]", CollUtil.size(ptlSchemes), schemeRuleFilterVo.getCarInfo().getEnergyTypeCode(), schemeRuleFilterVo.getCarInfo().getCarNatureCode(), schemeRuleFilterVo.getCarInfo().getCarKindCode(), schemeRuleFilterVo.getProductId());
         log.info("根据车辆信息匹配保险方案:匹配到[{}]个方案。 energyType(能源类型)=[{}],carNatureCode(使用性质)=[{}],carKindCode(车辆性质)=[{}], productId(产品id)=[{}]", CollUtil.size(ptlSchemes), schemeRuleFilterVo.getCarInfo().getEnergyTypeCode(), schemeRuleFilterVo.getCarInfo().getCarNatureCode(), schemeRuleFilterVo.getCarInfo().getCarKindCode(), schemeRuleFilterVo.getProductId());
 
 
         // 查找规则
         // 查找规则