Bladeren bron

fix 承保规则查询时如果存在两个相同条件返回值会变成最后一条的值 问题

liub 2 maanden geleden
bovenliggende
commit
9ba99e9593

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

@@ -658,7 +658,9 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
         List<PtlAgreementUndwrtRulesAttr> newAttrList = new ArrayList<>();
         List<PtlAgreementUndwrtRulesAttr> newAttrList = new ArrayList<>();
         linkList.forEach(link -> {
         linkList.forEach(link -> {
             if (attrMap.containsKey(link.getAttrCode())) {
             if (attrMap.containsKey(link.getAttrCode())) {
-                PtlAgreementUndwrtRulesAttr attr = attrMap.get(link.getAttrCode());
+                // clone 保证相同 attrCode 的多条记录不会互相覆盖
+                PtlAgreementUndwrtRulesAttr attr = new PtlAgreementUndwrtRulesAttr();
+                BeanUtils.copyProperties(attrMap.get(link.getAttrCode()), attr);
                 if ("checkbox".equals(attr.getAttrType()) || "select".equals(attr.getAttrType()) || "inputTag".equals(attr.getAttrType())) {
                 if ("checkbox".equals(attr.getAttrType()) || "select".equals(attr.getAttrType()) || "inputTag".equals(attr.getAttrType())) {
                     if (null != link.getMin()) {
                     if (null != link.getMin()) {
                         attr.setId(link.getId());
                         attr.setId(link.getId());