Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev_jzg_lipf_v20260901'

jiakai před 1 týdnem
rodič
revize
2ca64f9c37

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

@@ -1,7 +1,9 @@
 package com.jzg.organization.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.ReUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -449,7 +451,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
                 .filter(attr -> StrUtil.isNotEmpty(attr.getAttrName()))
                 .sorted(Comparator.comparing(PtlAgreementUndwrtRulesAttr::getSort, Comparator.nullsLast(Integer::compareTo)))
                 .collect(Collectors.toList());
-        if (sortedAttrs.isEmpty()) {
+        if (CollUtil.isEmpty(sortedAttrs)) {
             return;
         }
         // cost_rules 各段以 ";\t\t" 分隔
@@ -463,7 +465,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
             List<String> segList = Arrays.stream(costRules.split(separator))
                     .filter(s -> !s.isEmpty())
                     .collect(Collectors.toList());
-            if (segList.isEmpty()) {
+            if (CollUtil.isEmpty(segList)) {
                 continue;
             }
             // 为每段确定排序值:用 contains 判断包含哪个属性名,取对应 sort
@@ -471,7 +473,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
             for (String seg : segList) {
                 Integer sortVal = null;
                 for (PtlAgreementUndwrtRulesAttr attr : sortedAttrs) {
-                    if (seg.contains(attr.getAttrName())) {
+                    if (seg.startsWith(StrUtil.trim(ReUtil.replaceAll(attr.getAttrName(), "[((].*?[))]", "")))) {
                         sortVal = attr.getSort();
                         break;
                     }