فهرست منبع

协议复制的bug修复

dongxin 1 سال پیش
والد
کامیت
5cd76b8007

+ 29 - 25
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementServiceImpl.java

@@ -325,35 +325,39 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
 
             // 复制承保规则因子
             List<PtlAgreementUndwrtRulesAttrLink> links = linkMap.get(agreementUndwrtRules.getId());
-            links.forEach(link -> {
-                link.setId(null);
-                link.setRulesId(newAgreementUndwrtRules.getId());
-            });
-            agreementUndwrtRulesAttrLinkService.saveBatch(links);
+            if(CollUtil.isNotEmpty(links)) {
+                links.forEach(link -> {
+                    link.setId(null);
+                    link.setRulesId(newAgreementUndwrtRules.getId());
+                });
+                agreementUndwrtRulesAttrLinkService.saveBatch(links);
+            }
 
             /** 2-费用复制 **/
             List<PtlAgreementCost> agreementCostList = costGroup.get(key);
-            agreementCostList.forEach(agreementCost -> {
-                PtlAgreementCost newAgreementCost = new PtlAgreementCost();
-                BeanUtils.copyProperties(agreementCost,newAgreementCost);
-                newAgreementCost.setId(null);
-                newAgreementCost.setApproved(0);
-                newAgreementCost.setIsEnabled(0);
-                agreementCostService.save(newAgreementCost);
-                List<PtlAgreementCostRule> costRules = costRulesMap.get(agreementCost.getId());
-                costRules.forEach(costRule -> {
-                    costRule.setId(null);
-                    costRule.setPtlAgreementCostId(newAgreementCost.getId());
-                });
-                agreementCostRuleService.saveBatch(costRules);
-                List<PtlAgreementCostType> costTypes = costTypeMap.get(agreementCost.getId());
-                costTypes.forEach(costType -> {
-                    costType.setId(null);
-                    costType.setPtlAgreementCostId(newAgreementCost.getId());
-                });
-                agreementCostTypeService.saveBatch(costTypes);
+            if(CollUtil.isNotEmpty(agreementCostList)) {
+                agreementCostList.forEach(agreementCost -> {
+                    PtlAgreementCost newAgreementCost = new PtlAgreementCost();
+                    BeanUtils.copyProperties(agreementCost,newAgreementCost);
+                    newAgreementCost.setId(null);
+                    newAgreementCost.setApproved(0);
+                    newAgreementCost.setIsEnabled(0);
+                    agreementCostService.save(newAgreementCost);
+                    List<PtlAgreementCostRule> costRules = costRulesMap.get(agreementCost.getId());
+                    costRules.forEach(costRule -> {
+                        costRule.setId(null);
+                        costRule.setPtlAgreementCostId(newAgreementCost.getId());
+                    });
+                    agreementCostRuleService.saveBatch(costRules);
+                    List<PtlAgreementCostType> costTypes = costTypeMap.get(agreementCost.getId());
+                    costTypes.forEach(costType -> {
+                        costType.setId(null);
+                        costType.setPtlAgreementCostId(newAgreementCost.getId());
+                    });
+                    agreementCostTypeService.saveBatch(costTypes);
 
-            });
+                });
+            }
         });
     }
 

+ 1 - 1
tenant/organization/src/main/resources/mapper/SysUserMapper.xml

@@ -74,7 +74,7 @@
                 AND suji.dept_id = #{deptId}
             </if>
             <if test="searchValue != null and searchValue != ''">
-                AND (suji.name = #{searchValue} or suji.mobile = #{searchValue} or suji.work_number = #{searchValue})
+                AND (suji.name = #{searchValue} or su.mobile = #{searchValue} or suji.work_number = #{searchValue})
             </if>
         </where>
         group by suji.id