Просмотр исходного кода

fix 费用管理首次添加费用时 车牌号显示代码的问题

liub 6 дней назад
Родитель
Сommit
29d25ebea7

+ 3 - 1
commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostAdd.java

@@ -10,7 +10,6 @@ import lombok.Data;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
-import java.util.Date;
 import java.util.List;
 
 @Data
@@ -88,6 +87,9 @@ public class PtlAgreementCostAdd {
         @Schema(description = "操作符")
         private String operator;
 
+        @Schema(description = "操作数组")
+        private List<String> minArray;
+
         @Schema(description = "协议承保规则字典")
         private List<PtlAgreementUndwrtRulesDictLabal> dictLabal;
 

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

@@ -122,6 +122,14 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
         List<String> createdIds = new ArrayList<>();
         for (CostAdd costAdd : costAddList) {
             for (PtlAgreementCostAdd ptlAgreementCostAdd : costAdd.getPtlAgreementCostAddList()){
+                // 规则条件 min 根据 minArray 重组:多选/下拉等多值场景前端以数组提交,落库需以逗号分隔
+                if (CollUtil.isNotEmpty(ptlAgreementCostAdd.getRuleConditions())) {
+                    ptlAgreementCostAdd.getRuleConditions().forEach(item -> {
+                        if (CollUtil.isNotEmpty(item.getMinArray())) {
+                            item.setMin(String.join(",", item.getMinArray()));
+                        }
+                    });
+                }
                 if (ListUtils.hasDuplicates(ptlAgreementCostAdd.getRuleConditions())){
                     throw new SystemException("添加数据存在相同费用规则,请检查");
                 }
@@ -203,7 +211,6 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
                     min.substring(0,min.length()-1);
                     item.setMin(min.toString());
                 }
-
             });
             costRuleService.saveOrUpdateCostRule(BeanUtil.copyToList(ptlAgreementCostEnd.getRuleConditions(), PtlAgreementCostRule.class), ptlAgreementCost.getId());
         }