Explorar o código

处理承保费用规则不显示车牌的问题

lixiaolong hai 3 meses
pai
achega
fde393464a

+ 17 - 0
commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostEnd.java

@@ -93,6 +93,9 @@ public class PtlAgreementCostEnd {
         @Schema(description = "属性编码")
         private String attrCode;
 
+        @Schema(description = "属性类型")
+        private String attrType;
+
         @Schema(description = "左操作数")
         private String min;
 
@@ -105,6 +108,20 @@ public class PtlAgreementCostEnd {
         @Schema(description = "操作符")
         private String operator;
 
+        @Schema(description = "费用规则字典")
+        private List<PtlAgreementCostRulesDictLabalDto> dictLabal;
+
+    }
+
+    @Data
+    @Schema(description = "费用规则字典")
+    public static class PtlAgreementCostRulesDictLabalDto {
+
+        @Schema(description = "编码")
+        private String code;
+
+        @Schema(description = "编码")
+        private String name;
     }
 
     @Data

+ 9 - 2
commons/src/main/java/com/jzg/commons/util/BuildDescUtils.java

@@ -21,7 +21,7 @@ public class BuildDescUtils {
 
         for (PtlAgreementUndwrtRulesAttr link : linkList) {
             PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = attrMap.get(link.getAttrCode());
-
+            ptlAgreementUndwrtRulesAttr.setDictLabal(link.getDictLabal());
             if (ptlAgreementUndwrtRulesAttr == null) {
                 continue;
             }
@@ -36,7 +36,14 @@ public class BuildDescUtils {
                 if(link.getMinArray() != null && link.getMinArray().length > 0){
                     desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("包含");
                     for (int k=0 ; k<link.getMinArray().length; k++){
-                        PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementUndwrtRulesAttr.getDictLabal().stream().filter(x -> Arrays.asList(link.getMinArray()).contains(x.getCode())).findFirst().orElse(null);
+                        PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = null;
+                        for (PtlAgreementUndwrtRulesDictLabal x : ptlAgreementUndwrtRulesAttr.getDictLabal()) {
+                            if (Arrays.asList(link.getMinArray()).contains("select".equals(attrType) ? x.getName() : x.getCode())) {
+                                ptlAgreementUndwrtRulesDictLabal = x;
+                                link.getMinArray()[k] = null;
+                                break;
+                            }
+                        }
                         desc.append(null != ptlAgreementUndwrtRulesDictLabal ? ptlAgreementUndwrtRulesDictLabal.getName() : "").append(",");
                     }