Browse Source

三单优化

wangxuan 5 months ago
parent
commit
d8d08a0447

+ 7 - 5
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxPmqManagementRecoredServiceImpl.java

@@ -522,11 +522,13 @@ public class ZhcxPmqManagementRecoredServiceImpl extends ServiceImpl<ZhcxPmqMana
         String[] pidStr = pids.split(",");
 
         // 需要删除第二层和第2.5层的数据
-        if(pidStr.length > 0){
-            List<String> pidList = Arrays.asList(pidStr);
-            // 删除数据
-            baseMapper.deleteDistributionByPid(pidList);
-            baseMapper.deleteDistributionDetailByPid(pidList);
+        if(status.equals("已关闭") || status.equals("NA")) {
+            if (pidStr.length > 0) {
+                List<String> pidList = Arrays.asList(pidStr);
+                // 删除数据
+                baseMapper.deleteDistributionByPid(pidList);
+                baseMapper.deleteDistributionDetailByPid(pidList);
+            }
         }
         // 第2.5层集合
         List<ZhcxPmqManagementDistributionDo> resultList1 = new ArrayList<>();

+ 2 - 2
business-common/src/main/resources/mybatis/business/ZhcxPmqManagementRecoredDao.xml

@@ -107,7 +107,7 @@
             INCONTROL.ZHCX_PMQ_MANAGEMENT_DISTRIBUTION
         SET
             DELETED ='1',REMARK='批量派单删除'
-        WHERE PID in
+        WHERE DELETED ='0' and PID in
         <foreach collection="ids" item="id" separator="," open="(" close=")">
             #{id}
         </foreach>
@@ -118,7 +118,7 @@
             INCONTROL.ZHCX_PMQ_MANAGEMENT_DISTRIBUTION_DETAIL
         SET
             DELETED ='1',REMARK='批量派单删除'
-        WHERE PID in
+        WHERE DELETED ='0' and PID in
         <foreach collection="ids" item="id" separator="," open="(" close=")">
             #{id}
         </foreach>