소스 검색

Merge remote-tracking branch 'origin/master'

Qchen 6 일 전
부모
커밋
7714e1a0b3

+ 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;
 

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/dto/SysUserJzgInfoBankCardDto.java

@@ -90,6 +90,8 @@ public class SysUserJzgInfoBankCardDto implements Serializable {
     @Schema(description = "管理员名称")
     private String leaderName;
 
+    @Schema(description = "创建时间")
+    private LocalDateTime createTime;
     @Schema(description = "审核记录列表")
     private List<ChangeLogDetail> sysUserJzgInfoBankCardRecordList;
 }

+ 108 - 129
tenant/organization/src/main/java/com/jzg/organization/component/BuildDescUtils.java

@@ -14,185 +14,179 @@ public class BuildDescUtils {
     /**
      * 遍历费用属性描述文字
      *
-     * @param linkList
-     * @param undwrtRulesAttrList
+     * @param linkList            属性记录列表
+     * @param undwrtRulesAttrList 属性定义列表
      * @return
      */
     public static String buildDesc(String companyId, List<PtlAgreementUndwrtRulesAttr> linkList, List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList) {
         StringBuilder desc = new StringBuilder();
+        // 仅保留当前主体可用(all 或匹配 companyId)的属性定义
         Map<String, PtlAgreementUndwrtRulesAttr> attrMap = undwrtRulesAttrList.stream()
-                .filter(attr -> "all".equals(attr.getCompanyIds()) || (attr.getCompanyIds() != null && attr.getCompanyIds().equals(companyId)))
+                .filter(attr -> "all".equals(attr.getCompanyIds()) || Objects.equals(attr.getCompanyIds(), companyId))
                 .collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, Function.identity()));
         // 这里进行排序,保证生成的承保规则描述是有序的
-        linkList = linkList.stream().sorted(Comparator.comparing(PtlAgreementUndwrtRulesAttr::getAttrCode)).toList();
-        List<PtlAgreementUndwrtRulesAttr> sortedLinks = new ArrayList<>(linkList);
+        List<PtlAgreementUndwrtRulesAttr> sortedLinks = linkList.stream()
+                .sorted(Comparator.comparing(PtlAgreementUndwrtRulesAttr::getAttrCode))
+                .toList();
 
         for (PtlAgreementUndwrtRulesAttr link : sortedLinks) {
-            PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = attrMap.get(link.getAttrCode());
-            if (ptlAgreementUndwrtRulesAttr == null) {
+            PtlAgreementUndwrtRulesAttr attr = attrMap.get(link.getAttrCode());
+            if (attr == null) {
                 continue;
             }
-
-            String attrType = ptlAgreementUndwrtRulesAttr.getAttrType();
-
+            String attrType = attr.getAttrType();
             if ("inputNumber".equals(attrType)) {
-                desc.append(inputNumberIdentifying(ptlAgreementUndwrtRulesAttr, link)).append(";\t\t");
+                desc.append(inputNumberDesc(attr.getAttrName(), link.getOperator(), link.getMin(), link.getMax())).append(";\t\t");
             } else if ("radio".equals(attrType)) {
-                desc.append(radioIdentifying(ptlAgreementUndwrtRulesAttr, link)).append(";\t\t");
+                desc.append(radioDesc(attr, link.getMin())).append(";\t\t");
             } else if ("checkbox".equals(attrType) || "select".equals(attrType)) {
                 if (link.getMinArray() != null && link.getMinArray().length > 0) {
                     // minArray 转 Set,避免循环内反复创建 List 做 contains 查找
                     Set<String> minCodes = Arrays.stream(link.getMinArray()).collect(Collectors.toSet());
-                    String names = Optional.ofNullable(link.getDictLabal()).orElse(Collections.emptyList()).stream()
-                            .filter(labal -> minCodes.contains(labal.getCode()))
-                            .map(PtlAgreementUndwrtRulesDictLabal::getName)
-                            .collect(Collectors.joining(","));
-                    desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("包含").append(names).append(";\t\t");
+                    String names = joinDictNames(link.getDictLabal(), minCodes, ",");
+                    desc.append(containDesc(attr.getAttrName(), link.getOperator(), names)).append(";\t\t");
                 } else {
-                    desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("包含").append(link.getMin()).append(";\t\t");
+                    desc.append(containDesc(attr.getAttrName(), link.getOperator(), link.getMin())).append(";\t\t");
                 }
             } else if ("inputTag".equals(attrType)) {
-                if (link.getOperator() != null && "1".equals(link.getOperator())) {
-                    desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("包含").append(link.getMin()).append(";\t\t");
-                } else {
-                    desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("不包含").append(link.getMin()).append(";\t\t");
-                }
+                desc.append(containDesc(attr.getAttrName(), link.getOperator(), link.getMin())).append(";\t\t");
             }
         }
-        return desc.toString();
-    }
-
-    private static String radioIdentifying(PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr, PtlAgreementUndwrtRulesAttr link) {
-        Optional<PtlAgreementUndwrtRulesDictLabal> dictLabel = Optional.ofNullable(
-                        ptlAgreementUndwrtRulesAttr.getDictLabal())
-                .flatMap(list -> list.stream().filter(x -> x.getCode().equals(link.getMin())).findFirst());
-
-        return dictLabel.map(dl -> ptlAgreementUndwrtRulesAttr.getAttrName() + "为" + dl.getName())
-                .orElse("");
-    }
-
-    private static String inputNumberIdentifying(PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr, PtlAgreementUndwrtRulesAttr link) {
-        String operator = link.getOperator();
-        switch (operator) {
-            case "1":
-                return ptlAgreementUndwrtRulesAttr.getAttrName() + "范围值" + link.getMin() + "到" + link.getMax();
-            case "2":
-                return ptlAgreementUndwrtRulesAttr.getAttrName() + "小于" + link.getMin();
-            case "3":
-                return ptlAgreementUndwrtRulesAttr.getAttrName() + "小于等于" + link.getMin();
-            case "4":
-                return ptlAgreementUndwrtRulesAttr.getAttrName() + "大于" + link.getMax();
-            case "5":
-                return ptlAgreementUndwrtRulesAttr.getAttrName() + "大于等于" + link.getMax();
-            default:
-                return ptlAgreementUndwrtRulesAttr.getAttrName() + "未知操作符";
-        }
+        // buildDesc返回的条件间以相邻双逗号分隔,此处合并为单个分号
+        return StringUtils.mergeAdjacentComma(desc.toString());
     }
 
-
     /**
      * 遍历承保规则属性描述文字
      *
-     * @param linkList
-     * @param undwrtRulesAttrList
+     * @param linkList            规则因子关联记录列表
+     * @param undwrtRulesAttrList 属性定义列表
      * @return
      */
     public static String buildDesc(List<PtlAgreementUndwrtRulesAttrLink> linkList, List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList) {
         StringBuilder desc = new StringBuilder();
+        // 属性定义按 attrCode 建索引,避免循环内逐条 stream 查找
+        Map<String, PtlAgreementUndwrtRulesAttr> attrMap = undwrtRulesAttrList.stream()
+                .collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, Function.identity(), (oldItem, newItem) -> newItem));
         // 这里进行排序,保证生成的承保规则描述是有序的
-        linkList = linkList.stream().sorted(Comparator.comparing(PtlAgreementUndwrtRulesAttrLink::getAttrCode)).toList();
-        List<PtlAgreementUndwrtRulesAttrLink> sortedLinks = new ArrayList<>(linkList);
-
-        for (int i = 0; i < sortedLinks.size(); i++) {
-            int finalI = i;
-            PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = undwrtRulesAttrList.stream()
-                    .filter(x -> x.getAttrCode().equals(sortedLinks.get(finalI).getAttrCode()))
-                    .findAny()
-                    .get();
+        List<PtlAgreementUndwrtRulesAttrLink> sortedLinks = linkList.stream()
+                .sorted(Comparator.comparing(PtlAgreementUndwrtRulesAttrLink::getAttrCode))
+                .toList();
 
-            //数值范围判断
-
-            if ("inputNumber".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
-                desc.append(inputNumberIdentifying(ptlAgreementUndwrtRulesAttr, sortedLinks.get(i))).append(",");
-            }
-            if ("radio".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
-                desc.append(radioIdentifying(ptlAgreementUndwrtRulesAttr, sortedLinks.get(i))).append(",");
-            }
-            if ("select".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
-                desc.append(selectIdentifying(ptlAgreementUndwrtRulesAttr, sortedLinks.get(i)));
-            }
-            if ("checkbox".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
-                desc.append(checkBoxIdentifying(ptlAgreementUndwrtRulesAttr, sortedLinks.get(i)));
+        for (PtlAgreementUndwrtRulesAttrLink link : sortedLinks) {
+            PtlAgreementUndwrtRulesAttr attr = attrMap.get(link.getAttrCode());
+            if (attr == null) {
+                continue;
             }
-            if ("inputTag".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
-                if (sortedLinks.get(i).getOperator() != null && sortedLinks.get(i).getOperator().equals("1")) {
-                    desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("包含").append(sortedLinks.get(i).getMin()).append(",");
-                } else {
-                    desc.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("不包含").append(sortedLinks.get(i).getMin()).append(",");
-                }
+            String attrType = attr.getAttrType();
+            if ("inputNumber".equals(attrType)) {
+                desc.append(inputNumberDesc(attr.getAttrName(), link.getOperator(), link.getMin(), link.getMax())).append(",");
+            } else if ("radio".equals(attrType)) {
+                desc.append(radioDesc(attr, link.getMin())).append(",");
+            } else if ("select".equals(attrType)) {
+                desc.append(selectIdentifying(attr, link));
+            } else if ("checkbox".equals(attrType)) {
+                desc.append(checkBoxIdentifying(attr, link));
+            } else if ("inputTag".equals(attrType)) {
+                desc.append(containDesc(attr.getAttrName(), link.getOperator(), link.getMin())).append(",");
             }
         }
         // 相邻的","或","转换为"或"字
         return StringUtils.convertAdjacentCommaToOr(desc.toString());
     }
 
-    public static String radioIdentifying(PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr, PtlAgreementUndwrtRulesAttrLink ptlAgreementProductCostsAttrLink) {
-        PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementUndwrtRulesAttr.getDictLabal().stream().filter(x -> x.getCode().equals(ptlAgreementProductCostsAttrLink.getMin())).findAny().get();
-        return ptlAgreementUndwrtRulesAttr.getAttrName() + "为" + ptlAgreementUndwrtRulesDictLabal.getName();
-    }
-
     public static String selectIdentifying(PtlAgreementUndwrtRulesAttr undwrtRulesAttr, PtlAgreementUndwrtRulesAttrLink link) {
         StringBuilder returnMsg = new StringBuilder();
-        // 兼容 min 逗号分隔存储,保证 minArray 有值
-        if (link.getMinArray() == null) {
-            String minStr = link.getMin();
-            if (minStr != null && !minStr.isEmpty()) {
-                link.setMinArray(minStr.split(","));
-            }
-        }
-
+        ensureMinArray(link);
         // 优先取 link 上的字典标签列表(JSONArray -> List),为空时回退到属性自带字典
         List<PtlAgreementUndwrtRulesDictLabal> dictLabalList = getDictLabalList(undwrtRulesAttr, link);
-
         // 用字典标签的 code 匹配 minArray 中的每一项
         if (link.getMinArray() != null && link.getMinArray().length > 0) {
             // minArray 转 Set,避免循环内反复创建 List 做 contains 查找
             Set<String> minCodes = Arrays.stream(link.getMinArray()).collect(Collectors.toSet());
-            String names = Optional.ofNullable(dictLabalList).orElse(Collections.emptyList()).stream()
-                    .filter(labal -> minCodes.contains(labal.getCode()))
-                    .map(PtlAgreementUndwrtRulesDictLabal::getName)
-                    .collect(Collectors.joining(","));
-            returnMsg.append(undwrtRulesAttr.getAttrName()).append("包含").append(names).append(",");
-
+            String names = joinDictNames(dictLabalList, minCodes, ",");
+            returnMsg.append(containDesc(undwrtRulesAttr.getAttrName(), link.getOperator(), names)).append(",");
         }
         return returnMsg.toString();
     }
 
     public static String checkBoxIdentifying(PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr, PtlAgreementUndwrtRulesAttrLink linkList) {
-        StringBuilder returnMsg = new StringBuilder();
-        returnMsg.append(ptlAgreementUndwrtRulesAttr.getAttrName()).append("为");
-        // 兼容 min 逗号分隔存储,保证 minArray 有值
-        if (linkList.getMinArray() == null) {
-            String minStr = linkList.getMin();
-            if (minStr != null && !minStr.isEmpty()) {
-                linkList.setMinArray(minStr.split(","));
-            }
-        }
+        StringBuilder returnMsg = new StringBuilder(ptlAgreementUndwrtRulesAttr.getAttrName()).append("为");
+        ensureMinArray(linkList);
         if (linkList.getMinArray() != null) {
             // 优先取 link 上的字典标签列表(JSONArray -> List),为空时回退到属性自带字典
             List<PtlAgreementUndwrtRulesDictLabal> dictLabalList = getDictLabalList(ptlAgreementUndwrtRulesAttr, linkList);
             // code -> 字典标签 映射,避免 O(n²) 循环匹配
             Map<String, PtlAgreementUndwrtRulesDictLabal> dictLabalMap = dictLabalList.stream()
-                    .filter(x -> x.getCode() != null)
+                    .filter(dictLabal -> dictLabal.getCode() != null)
                     .collect(Collectors.toMap(PtlAgreementUndwrtRulesDictLabal::getCode, Function.identity(), (oldItem, newItem) -> newItem));
             for (String code : linkList.getMinArray()) {
-                PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = dictLabalMap.get(code);
-                returnMsg.append(ptlAgreementUndwrtRulesDictLabal != null ? ptlAgreementUndwrtRulesDictLabal.getName() : "").append(",");
+                PtlAgreementUndwrtRulesDictLabal dictLabal = dictLabalMap.get(code);
+                returnMsg.append(dictLabal != null ? dictLabal.getName() : "").append(",");
             }
         }
         return returnMsg.toString();
     }
 
+    /**
+     * 拼接"属性名 + 包含/不包含 + 值"
+     */
+    private static String containDesc(String attrName, String operator, String value) {
+        return attrName + ("1".equals(operator) ? "包含" : "不包含") + value;
+    }
+
+    /**
+     * 数值操作符描述拼接(operator: 1区间 2小于 3小于等于 4大于 5大于等于)
+     */
+    private static String inputNumberDesc(String attrName, String operator, String min, String max) {
+        if ("1".equals(operator)) {
+            return attrName + "范围值" + min + "到" + max;
+        } else if ("2".equals(operator)) {
+            return attrName + "小于" + min;
+        } else if ("3".equals(operator)) {
+            return attrName + "小于等于" + min;
+        } else if ("4".equals(operator)) {
+            return attrName + "大于" + max;
+        } else if ("5".equals(operator)) {
+            return attrName + "大于等于" + max;
+        }
+        return "";
+    }
+
+    /**
+     * 单选字典描述拼接:属性名为 + 字典名称
+     */
+    private static String radioDesc(PtlAgreementUndwrtRulesAttr attr, String code) {
+        return Optional.ofNullable(attr.getDictLabal()).orElse(Collections.emptyList()).stream()
+                .filter(dictLabal -> Objects.equals(dictLabal.getCode(), code))
+                .map(PtlAgreementUndwrtRulesDictLabal::getName)
+                .findFirst()
+                .map(name -> attr.getAttrName() + "为" + name)
+                .orElse("");
+    }
+
+    /**
+     * 将字典 code 集合对应的名称按 separator 拼接为字符串
+     */
+    private static String joinDictNames(List<PtlAgreementUndwrtRulesDictLabal> dictLabalList, Set<String> codes, String separator) {
+        return Optional.ofNullable(dictLabalList).orElse(Collections.emptyList()).stream()
+                .filter(dictLabal -> codes.contains(dictLabal.getCode()))
+                .map(PtlAgreementUndwrtRulesDictLabal::getName)
+                .collect(Collectors.joining(separator));
+    }
+
+    /**
+     * 兼容 min 逗号分隔存储:minArray 为空时将 min 按逗号拆分填充
+     */
+    private static void ensureMinArray(PtlAgreementUndwrtRulesAttrLink link) {
+        if (link.getMinArray() == null) {
+            String minStr = link.getMin();
+            if (minStr != null && !minStr.isEmpty()) {
+                link.setMinArray(minStr.split(","));
+            }
+        }
+    }
+
     /**
      * 获取字典标签列表:优先取 link 上的字典标签列表(JSONArray -> List),为空时回退到属性自带字典
      */
@@ -206,19 +200,4 @@ public class BuildDescUtils {
         return Collections.emptyList();
     }
 
-    private static String inputNumberIdentifying(PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr, PtlAgreementUndwrtRulesAttrLink ptlAgreementProductCostsAttrLink) {
-        if ("1".equals(ptlAgreementProductCostsAttrLink.getOperator())) {
-            return ptlAgreementUndwrtRulesAttr.getAttrName() + "范围值" + ptlAgreementProductCostsAttrLink.getMin() + "到" + ptlAgreementProductCostsAttrLink.getMax();
-        } else if ("2".equals(ptlAgreementProductCostsAttrLink.getOperator())) {
-            return ptlAgreementUndwrtRulesAttr.getAttrName() + "小于" + ptlAgreementProductCostsAttrLink.getMin();
-        } else if ("3".equals(ptlAgreementProductCostsAttrLink.getOperator())) {
-            return ptlAgreementUndwrtRulesAttr.getAttrName() + "小于等于" + ptlAgreementProductCostsAttrLink.getMin();
-        } else if ("4".equals(ptlAgreementProductCostsAttrLink.getOperator())) {
-            return ptlAgreementUndwrtRulesAttr.getAttrName() + "大于" + ptlAgreementProductCostsAttrLink.getMax();
-        } else if ("5".equals(ptlAgreementProductCostsAttrLink.getOperator())) {
-            return ptlAgreementUndwrtRulesAttr.getAttrName() + "大于等于" + ptlAgreementProductCostsAttrLink.getMax();
-        }
-        return "";
-    }
-
 }

+ 2 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/SysUserJzgInfoMapper.java

@@ -16,6 +16,8 @@ import java.util.List;
 @Mapper
 public interface SysUserJzgInfoMapper extends BaseMapper<SysUserJzgInfo> {
 
+    SysUserJzgInfo getYWYById(@Param("id") String id);
+
     /**
      * 查询有效的业务员信息
      *

+ 1 - 0
tenant/organization/src/main/java/com/jzg/organization/service/SysUserJzgInfoService.java

@@ -43,6 +43,7 @@ public interface SysUserJzgInfoService extends IService<SysUserJzgInfo> {
     SysUserJzgInfo getUserByUserId(String userId);
 
     SysUserJzgInfo getUserById(String userId);
+    SysUserJzgInfo getYWYById(String userId);
 
     /**
      * 通过手机号获取晋掌柜用户信息

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

@@ -121,11 +121,19 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
         }
         List<String> createdIds = new ArrayList<>();
         for (CostAdd costAdd : costAddList) {
-            for (PtlAgreementCostAdd ptlAgreementCostAdd : costAdd.getPtlAgreementCostAddList()){
-                if (ListUtils.hasDuplicates(ptlAgreementCostAdd.getRuleConditions())){
+            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("添加数据存在相同费用规则,请检查");
                 }
-                if(StrUtil.isEmpty(costAdd.getPtlAgreementId())){
+                if (StrUtil.isEmpty(costAdd.getPtlAgreementId())) {
                     log.info("新增费用的时候,需要指定关联的协议信息。ptlAgreemenCostAdd=[{}]", JSONUtil.toJsonStr(ptlAgreemenCostAdd));
                     return HttpResult.error("新增费用的时候,需要指定关联的协议信息");
                 }
@@ -174,7 +182,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
         // 校验ptlAgreementCostTypeList 数据  exportKeepPointRatio 不能大于 export
         if (!CollectionUtils.isEmpty(ptlAgreementCostEnd.getPtlAgreementCostTypeList())) {
             for (PtlAgreementCostEnd.PtlAgreementCostTypeDto ptlAgreementCostTypeDto : ptlAgreementCostEnd.getPtlAgreementCostTypeList()) {
-                if (null != ptlAgreementCostTypeDto.getExportKeepPointRatio() && null != ptlAgreementCostTypeDto.getExport()){
+                if (null != ptlAgreementCostTypeDto.getExportKeepPointRatio() && null != ptlAgreementCostTypeDto.getExport()) {
                     if (ptlAgreementCostTypeDto.getExportKeepPointRatio().compareTo(ptlAgreementCostTypeDto.getExport()) > 0) {
                         return HttpResult.error("出口留点比例不能大于出口比例");
                     }
@@ -194,16 +202,15 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
         }
         // 处理minArray
         if (!CollectionUtils.isEmpty(ptlAgreementCostEnd.getRuleConditions())) {
-            ptlAgreementCostEnd.getRuleConditions().forEach(item->{
+            ptlAgreementCostEnd.getRuleConditions().forEach(item -> {
                 StringBuilder min = new StringBuilder();
-                if(item.getMinArray() != null && item.getMinArray().size() > 0){
-                    item.getMinArray().forEach(kk->{
+                if (item.getMinArray() != null && item.getMinArray().size() > 0) {
+                    item.getMinArray().forEach(kk -> {
                         min.append(kk).append(",");
                     });
-                    min.substring(0,min.length()-1);
+                    min.substring(0, min.length() - 1);
                     item.setMin(min.toString());
                 }
-
             });
             costRuleService.saveOrUpdateCostRule(BeanUtil.copyToList(ptlAgreementCostEnd.getRuleConditions(), PtlAgreementCostRule.class), ptlAgreementCost.getId());
         }
@@ -211,36 +218,35 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
     }
 
 
-    public String buildDescString(String companyId, List<?> list){
-        if (CollectionUtils.isEmpty(list)){
+    public String buildDescString(String companyId, List<?> list) {
+        if (CollectionUtils.isEmpty(list)) {
             return null;
         }
         String desc = BuildDescUtils.buildDesc(companyId, BeanUtil.copyToList(list, PtlAgreementUndwrtRulesAttr.class), agreementUndwrtRulesAttrService.getUndwrtRulesAttrList());
-        // buildDesc返回的条件间以相邻双逗号分隔,此处合并为单个分号
-        return StringUtils.mergeAdjacentComma(desc);
+        return desc;
     }
 
-    public boolean verify(PtlAgreementCostAdd ptlAgreementCostAdd){
+    public boolean verify(PtlAgreementCostAdd ptlAgreementCostAdd) {
         CostAgreementParam costAgreementParam = new CostAgreementParam();
         costAgreementParam.setPtlAgreementId(ptlAgreementCostAdd.getPtlAgreementId());
         costAgreementParam.setCoverRuleId(ptlAgreementCostAdd.getCoverRuleId());
         List<PtlAgreementCostVo> voList = queryByAgreementId(costAgreementParam);
-        if (CollectionUtils.isEmpty(voList)){
+        if (CollectionUtils.isEmpty(voList)) {
             return false;
         }
         // 比较规则是否相同
         Map<String, List<PtlAgreementCostVo>> listMap = voList.stream().filter(v -> Constants.ENABLE == v.getIsEnabled() && Constants.EFFECTIVE == v.getIsValid()).collect(Collectors.groupingBy(PtlAgreementCostVo::getProductId));
         List<PtlAgreementCostVo> ptlAgreementCostVos = listMap.get(ptlAgreementCostAdd.getProductId());
-        if (CollectionUtils.isEmpty(ptlAgreementCostVos)){
+        if (CollectionUtils.isEmpty(ptlAgreementCostVos)) {
             return false;
         }
         List<RuleConditionsVerify> ruleConditionsVerifies = BeanUtil.copyToList(ptlAgreementCostAdd.getRuleConditions(), RuleConditionsVerify.class);
-        if (CollectionUtils.isEmpty(ruleConditionsVerifies)){
+        if (CollectionUtils.isEmpty(ruleConditionsVerifies)) {
             return false;
         }
         for (PtlAgreementCostVo ptlAgreementCostVo : ptlAgreementCostVos) {
             List<RuleConditionsVerify> verifies = BeanUtil.copyToList(ptlAgreementCostVo.getRuleConditions(), RuleConditionsVerify.class);
-            if (ObjectUtil.equals(verifies,ruleConditionsVerifies)){
+            if (ObjectUtil.equals(verifies, ruleConditionsVerifies)) {
                 return true;
             }
         }
@@ -258,7 +264,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
     public HttpResult<PtlAgreementCostVo> queryById(Long id) {
         log.info("查询协议的费用信息:协议费用id=[{}]", id);
         PtlAgreementCostVo ptlAgreementCostVo = ptlAgreementCostMapper.queryById(id);
-        if (ObjectUtil.isEmpty(ptlAgreementCostVo)){
+        if (ObjectUtil.isEmpty(ptlAgreementCostVo)) {
             return HttpResult.ok(ptlAgreementCostVo);
         }
         RList<SysDict> rules = redissonClient.getList(DICT_REDIS_KEY + "rule_operator");
@@ -272,10 +278,10 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
                 ruleCondition.setMin(value);
             }
             String attrType = ruleCondition.getAttrType();
-            if (StringUtils.isNotEmpty(attrType) && java.util.Arrays.stream(COST_TYPE_DICT_KEY).anyMatch(attrType::equals)){
-                if (StringUtils.isNotEmpty(ruleCondition.getMin()) && ruleCondition.getMin().contains(",")){
+            if (StringUtils.isNotEmpty(attrType) && java.util.Arrays.stream(COST_TYPE_DICT_KEY).anyMatch(attrType::equals)) {
+                if (StringUtils.isNotEmpty(ruleCondition.getMin()) && ruleCondition.getMin().contains(",")) {
                     ruleCondition.setMinArray(Arrays.asList(ruleCondition.getMin().split(",")));
-                }else {
+                } else {
                     ruleCondition.setMinArray(Collections.singletonList(ruleCondition.getMin()));
                     //ruleCondition.setMinArray(Collections.singletonList(ruleCondition.getMin()));
                 }
@@ -297,21 +303,21 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
     }
 
 
-    private List<PtlAgreementCostVo> queryByAgreementId(CostAgreementParam costAgreementParam){
+    private List<PtlAgreementCostVo> queryByAgreementId(CostAgreementParam costAgreementParam) {
         return ptlAgreementCostMapper.queryByAgreementId(costAgreementParam);
     }
 
 
     @Override
-    public HttpResult enableDisableByIds(List<String> ids,Boolean isEnabled) {
-        if (CollectionUtils.isEmpty(ids)){
+    public HttpResult enableDisableByIds(List<String> ids, Boolean isEnabled) {
+        if (CollectionUtils.isEmpty(ids)) {
             return HttpResult.error("参数不能为空");
         }
         PtlAgreementCost ptlAgreementCost = new PtlAgreementCost();
         ptlAgreementCost.setIsEnabled(isEnabled ? 0 : 1);
         ptlAgreementCost.setIsValid(isEnabled ? 0 : 1);
-        return baseMapper.update(ptlAgreementCost,new LambdaQueryWrapper<>(PtlAgreementCost.class)
-                .in(PtlAgreementCost::getId,ids)) > 0 ?
+        return baseMapper.update(ptlAgreementCost, new LambdaQueryWrapper<>(PtlAgreementCost.class)
+                .in(PtlAgreementCost::getId, ids)) > 0 ?
                 HttpResult.ok(isEnabled ? "启用成功" : "禁用成功") : HttpResult.error(isEnabled ? "启用失败" : "禁用失败");
     }
 
@@ -319,7 +325,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
     public void updateAuditMethod(List<Long> ids) {
         PtlAgreementCost ptlAgreementCost = new PtlAgreementCost();
         ptlAgreementCost.setAuditMethod(0);
-        baseMapper.update(ptlAgreementCost,new LambdaQueryWrapper<>(PtlAgreementCost.class).in(PtlAgreementCost::getId,ids));
+        baseMapper.update(ptlAgreementCost, new LambdaQueryWrapper<>(PtlAgreementCost.class).in(PtlAgreementCost::getId, ids));
     }
 
     @Override
@@ -360,9 +366,9 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
                     }
                 }
             }
-            if(isSuccessful) {
+            if (isSuccessful) {
                 return HttpResult.ok("审核成功", costReviewParam.isAutomatic() ? nextDataID() : null);
-            }else{
+            } else {
                 return HttpResult.ok("驳回成功", costReviewParam.isAutomatic() ? nextDataID() : null);
             }
         } catch (SystemException e) {
@@ -406,7 +412,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
 //            LocalDateTime localDateTime = end.plusDays(1).atStartOfDay();
 //            costParam.setAuditTimeEnd(localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
 //        }
-        if(StrUtil.isNotEmpty(costParam.getCompanyId())){
+        if (StrUtil.isNotEmpty(costParam.getCompanyId())) {
             HttpResult<List<String>> res = esmInsCompanyClient.queryOwnAndSubCompandyIds(costParam.getCompanyId());
             costParam.setCompanyIdList(res.getData());
         }
@@ -415,19 +421,31 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
         costParam.setPhones(phones);
 
         Map<String, String> userName2Name = sysUserJzgInfoService.queryUserInfoUserName2Name(baseController.getSystemCode());
+        Map<String, String> name2UserName = new HashMap<>(userName2Name);
+        for (String s : userName2Name.keySet()) {
+            String name = userName2Name.get(s);
+            if(!s.equals(name)){
+                name2UserName.put(name, s);
+            }
+        }
+        if(StrUtil.isNotEmpty(costParam.getAuditPerson())){
+            String auditPersonPhone = name2UserName.getOrDefault(costParam.getAuditPerson(), costParam.getAuditPerson());
+            log.info("姓名换汇为手机号。 name=[{}],phone=[{}]",costParam.getAuditPerson(), auditPersonPhone);
+            costParam.setAuditPerson(auditPersonPhone);
+        }
         Page<CostManagementVo> costManagementVoPage = baseMapper.pageList(costParam.getPage(), costParam);
         // 按承保规则属性 sort 正序,重新排列 cost_rules 各段描述
         reorderCostRules(costManagementVoPage.getRecords());
-        costManagementVoPage.getRecords().forEach(item->{
-            if(item.getCostRules() != null && !item.getCostRules().isEmpty()){
-                item.setCostRules(item.getCostRules().substring(0,item.getCostRules().length()-1));
+        costManagementVoPage.getRecords().forEach(item -> {
+            if (item.getCostRules() != null && !item.getCostRules().isEmpty()) {
+                item.setCostRules(item.getCostRules().substring(0, item.getCostRules().length() - 1));
             }
-            if(item.getRuleDescription() != null && !item.getRuleDescription().isEmpty()){
-                item.setRuleDescription(item.getRuleDescription().substring(0,item.getRuleDescription().length()-1));
+            if (item.getRuleDescription() != null && !item.getRuleDescription().isEmpty()) {
+                item.setRuleDescription(item.getRuleDescription().substring(0, item.getRuleDescription().length() - 1));
             }
             // ruleDescription中出现两个相邻的","或","时,转换为"或"字
             item.setRuleDescription(StringUtils.convertAdjacentCommaToOr(item.getRuleDescription()));
-            item.setAuditPersonName(userName2Name.getOrDefault(item.getAuditPerson(),item.getAuditPerson()));
+            item.setAuditPersonName(userName2Name.getOrDefault(item.getAuditPerson(), item.getAuditPerson()));
         });
         return HttpResult.ok(costManagementVoPage);
     }
@@ -499,9 +517,9 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
         List<String> newCostId = new ArrayList<>();
         List<String> costIds = costCopyParam.getCostIds();
         StringBuilder errMsg = new StringBuilder();
-        costIds.forEach(oldCostId-> {
+        costIds.forEach(oldCostId -> {
             PtlAgreementCost ptlAgreementCost = ptlAgreementCostMapper.selectById(oldCostId);
-            if(ptlAgreementCost != null){
+            if (ptlAgreementCost != null) {
                 List<PtlAgreementCostType> ptlAgreementCostTypes = ptlAgreementCostTypeMapper.selectList(new LambdaQueryWrapper<PtlAgreementCostType>()
                         .eq(PtlAgreementCostType::getPtlAgreementCostId, ptlAgreementCost.getId()));
                 List<PtlAgreementCostRule> ptlAgreementCostRules = ptlAgreementCostRuleMapper.selectList(new LambdaQueryWrapper<PtlAgreementCostRule>()
@@ -515,10 +533,10 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
                 ptlAgreementCost.setCostDescribe(ptlAgreementCost.getCostDescribe());
                 ptlAgreementCost.setCreateTime(LocalDateTime.now());
                 ptlAgreementCost.setUpdateTime(LocalDateTime.now());
-                if(costCopyParam.getProductId() != null && !costCopyParam.getProductId().isEmpty()){
+                if (costCopyParam.getProductId() != null && !costCopyParam.getProductId().isEmpty()) {
                     ptlAgreementCost.setProductId(costCopyParam.getProductId());
                 }
-                if(costCopyParam.getProductName() != null && !costCopyParam.getProductName().isEmpty()){
+                if (costCopyParam.getProductName() != null && !costCopyParam.getProductName().isEmpty()) {
                     ptlAgreementCost.setProductName(costCopyParam.getProductName());
                 }
 
@@ -548,7 +566,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
                         })
                         .collect(Collectors.toList());
 
-                ptlAgreementCostRules.forEach(item->{
+                ptlAgreementCostRules.forEach(item -> {
                     item.setId(IdGenerate.nextId());
                     item.setPtlAgreementCostId(costId);
                 });
@@ -558,13 +576,13 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
                 ptlAgreementCostRuleMapper.insert(ptlAgreementCostRules);
                 newCostId.add(ptlAgreementCost.getId());
 
-            }else{
-                errMsg.append("costId为"+oldCostId+"的费用信息已被删除");
+            } else {
+                errMsg.append("costId为" + oldCostId + "的费用信息已被删除");
             }
 
 
         });
-        return HttpResult.ok(errMsg.toString(),newCostId);
+        return HttpResult.ok(errMsg.toString(), newCostId);
     }
 
     @Override
@@ -628,6 +646,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
                 ? HttpResult.ok("批量修改成功,共修改 " + finalCostIds.size() + " 条记录")
                 : HttpResult.error("批量修改失败");
     }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public HttpResult<String> batchAdjustCostRatio(PtlAgreementCostBatchAdjustParam param) {

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

@@ -1050,7 +1050,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
         SalespersonInfoVo salespersonInfo = schemeRuleFilterVo.getSalespersonInfo();
         if (CollUtil.isNotEmpty(companyList) && ObjectUtil.isNotEmpty(salespersonInfo) && StrUtil.isNotBlank(salespersonInfo.getId())) {
             // 根据业务员ID获取业务员信息(含部门ID)
-            SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfoService.getUserById(salespersonInfo.getId());
+            SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfoService.getYWYById(salespersonInfo.getId());
             String userDeptId = sysUserJzgInfo.getDeptId(); // 业务员所属部门ID
 
             // ========== 核心逻辑开始 ==========

+ 4 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserJzgInfoBankCardServiceImpl.java

@@ -130,6 +130,10 @@ public class SysUserJzgInfoBankCardServiceImpl extends ServiceImpl<SysUserJzgInf
 
                 changeLogDetailList.add(new ChangeLogDetail(action.getDescription(), action.getCreateTime(), show, action.getRemark(), action.getBankCardId(), action.getId()));
             }
+            // 按照财务要求, 待审核的时候,也应该有一个提交申请的列表
+            if("0".equals(sysUserJzgInfoBankCardDto.getAuditStatus())){
+                changeLogDetailList.add(new ChangeLogDetail("添加新卡", sysUserJzgInfoBankCardDto.getCreateTime(), null, "添加新卡,待审核", sysUserJzgInfoBankCardDto.getBankCardNumber(), sysUserJzgInfoBankCardDto.getId()));
+            }
             sysUserJzgInfoBankCardDto.setSysUserJzgInfoBankCardRecordList(changeLogDetailList);
             // 填充最新的驳回日期和驳回原因
             if(CollUtil.isNotEmpty(sysUserJzgInfoBankCardRecordList)){

+ 4 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserJzgInfoServiceImpl.java

@@ -102,6 +102,10 @@ public class SysUserJzgInfoServiceImpl extends ServiceImpl<SysUserJzgInfoMapper,
         return baseMapper.selectOne(new LambdaQueryWrapper<SysUserJzgInfo>()
                 .eq(SysUserJzgInfo::getId, id));
     }
+    @Override
+    public SysUserJzgInfo getYWYById(String id) {
+        return sysUserJzgInfoMapper.getYWYById(id);
+    }
 
 
     @Override

+ 1 - 0
tenant/organization/src/main/resources/application.yml

@@ -118,6 +118,7 @@ data-scope:
     - getOrganizationUser
     - deleteOrganizationUser
     - queryBJYwy
+    - getYWYById
 
 
 

+ 3 - 7
tenant/organization/src/main/resources/mapper/PtlAgreementCostMapper.xml

@@ -407,12 +407,6 @@
         LEFT JOIN esm_ins_company eic on eic.id = pa.company_id  AND eic.is_delete = 0
         <where>
             pc.is_delete = 0
-            <if test="costParam.phones != null and costParam.phones.size() > 0 ">
-                and pc.audit_person in
-                <foreach collection="costParam.phones" separator="," open="(" close=")" item="phone">
-                    #{phone}
-                </foreach>
-            </if>
             <if test="costParam.costDescribes != null and costParam.costDescribes.length >0 ">
                 and (
                     <foreach  collection="costParam.costDescribes" close=")" open="(" separator="and " item="costDescribe">
@@ -524,7 +518,9 @@
             <if test="costParam.updateTimeArr != null and costParam.updateTimeArr.size() > 0">
                 AND pc.update_time BETWEEN #{costParam.updateTimeArr[0]} AND #{costParam.updateTimeArr[1]}
             </if>
-
+            <if test="costParam.auditPerson != null and costParam.auditPerson != '' ">
+                and pc.audit_person = #{costParam.auditPerson}
+            </if>
             <if test="costParam.newCostIds != null and costParam.newCostIds.size() &gt; 0">
                 AND pc.id IN
                 <foreach collection="costParam.newCostIds" item="v" open="(" separator="," close=")">#{v}</foreach>

+ 13 - 0
tenant/organization/src/main/resources/mapper/SysUserJzgInfoMapper.xml

@@ -56,6 +56,19 @@
             </if>
         </where>
     </select>
+    <select id="getYWYById" resultType="com.jzg.commons.entity.po.SysUserJzgInfo">
+        SELECT id, user_id, name, work_number, status, is_enable, system_code, dept_id,
+        open_id, alipay, approval_opinion, logout_time, head_sculpture, leader_id,
+        referrer_id, manager_id, position_id, operator_code, partner_level, type_attr,
+        factor_verify, address, nations, koseki, birthday, marital_status, politics_status,
+        health, postal_code, email, blood_type, education, school, graduation_time,
+        former_employer, entry_time, agent_qualification_code, emergency_contact_tel,
+        emergency_contact_name, remark, sex, is_computer, speciality, salary, salary_level,
+        live_address, province, city, district, is_delete, is_distribution, distribution_time,
+        bank_card_number, bank_name, last_login_time, create_by, create_time, update_by, update_time
+        FROM sys_user_jzg_info
+        where id = #{id}
+    </select>
     <!-- 查询业务员 lipf 2026年4月24日11:22:18  -->
     <select id="queryYwy" resultMap="BaseResultMap">
         select