Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/mode-min-unit' into mode-min-unit

fangpy 1 mese fa
parent
commit
873ce6d6be

+ 12 - 12
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductionOrderServiceImpl.java

@@ -261,13 +261,13 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
 //            return R.error("该订单已被提交,请刷新页面后重新操作");
 //        }
 //        productOrderLock.put(id, currentUser.getId());
+        // 使用 putIfAbsent 实现原子性的检查+放入操作
+        String existingUser = productOrderLock.putIfAbsent(id, currentUser.getId());
+        if (existingUser != null) {
+            log.error("校验-该订单已被:{}提交", existingUser);
+            return R.error("该订单已被提交,请刷新页面后重新操作");
+        }
         try {
-            // 使用 putIfAbsent 实现原子性的检查+放入操作
-            String existingUser = productOrderLock.putIfAbsent(id, currentUser.getId());
-            if (existingUser != null) {
-                log.error("校验-该订单已被:{}提交", existingUser);
-                return R.error("该订单已被提交,请刷新页面后重新操作");
-            }
             //数据库中的订单数据
             ApsProductionOrderDo nowApsProductionOrderDo = this.getById(id);
             //页面上的订单数据
@@ -1149,13 +1149,13 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
 //            return R.error("该订单已被提交");
 //        }
 //        productOrderLock.put(id, currentUser.getId());
+        // 使用 putIfAbsent 实现原子性的检查+放入操作
+        String existingUser = productOrderLock.putIfAbsent(id, currentUser.getId());
+        if (existingUser != null) {
+            log.error("修改-该订单已被:{}提交", existingUser);
+            return R.error("该订单已被提交");
+        }
         try {
-            // 使用 putIfAbsent 实现原子性的检查+放入操作
-            String existingUser = productOrderLock.putIfAbsent(id, currentUser.getId());
-            if (existingUser != null) {
-                log.error("修改-该订单已被:{}提交", existingUser);
-                return R.error("该订单已被提交");
-            }
             //数据库中的订单数据
             ApsProductionOrderDo nowApsProductionOrderDo = this.getById(id);
             //页面上的订单数据

+ 18 - 20
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportRecordsServiceImpl.java

@@ -355,14 +355,13 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
 //            return R.error("该作业已被开工");
 //        }
 //        startWorkLock.put(req.getUseDeviceId(), currentUser.getId());
+        // 使用 putIfAbsent 实现原子性的检查+放入操作
+        String existingUser = startWorkLock.putIfAbsent(req.getUseDeviceId(), currentUser.getId());
+        if (existingUser != null) {
+            log.error("该作业已被:{}开工", existingUser);
+            return R.error("该作业已被开工");
+        }
         try {
-            // 使用 putIfAbsent 实现原子性的检查+放入操作
-            String existingUser = startWorkLock.putIfAbsent(req.getUseDeviceId(), currentUser.getId());
-            if (existingUser != null) {
-                log.error("该作业已被:{}开工", existingUser);
-                return R.error("该作业已被开工");
-            }
-
             //根据作业明细ID查询作业明细详情
             ApsProcessOperationProcessEquDo apsProcessOperationProcessEquDo = apsProcessOperationProcessEquService.getById(req.getUseDeviceId());
             //根据加工设备ID查询设备
@@ -955,14 +954,13 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
 //            return R.error("该作业已被报工");
 //        }
 //        reportWorkLock.put(apsReportRecordsDo.getId(), currentUser.getId());
+        // 使用 putIfAbsent 实现原子性的检查+放入操作
+        String existingUser = reportWorkLock.putIfAbsent(apsReportRecordsDo.getId(), currentUser.getId());
+        if (existingUser != null) {
+            log.error("该作业已被:{}报工", existingUser);
+            return R.error("该作业已被报工");
+        }
         try {
-            // 使用 putIfAbsent 实现原子性的检查+放入操作
-            String existingUser = reportWorkLock.putIfAbsent(apsReportRecordsDo.getId(), currentUser.getId());
-            if (existingUser != null) {
-                log.error("该作业已被:{}报工", existingUser);
-                return R.error("该作业已被报工");
-            }
-
             //防止同时报工
             ApsReportRecordsDo recordsDo = this.getById(apsReportRecordsDo.getId());
             if (ObjectUtil.isEmpty(recordsDo) || !recordsDo.getReportworkstatus().equals("已开工")) {
@@ -1635,13 +1633,13 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
 //            return R.error("该作业已被开工");
 //        }
 //        startWorkLock.put(req.getUseDeviceId(), currentUser.getId());
+        // 使用 putIfAbsent 实现原子性的检查+放入操作
+        String existingUser = startWorkLock.putIfAbsent(req.getUseDeviceId(), currentUser.getId());
+        if (existingUser != null) {
+            log.error("该小卷作业已被:{}开工", existingUser);
+            return R.error("该作业已被开工");
+        }
         try {
-            // 使用 putIfAbsent 实现原子性的检查+放入操作
-            String existingUser = startWorkLock.putIfAbsent(req.getUseDeviceId(), currentUser.getId());
-            if (existingUser != null) {
-                log.error("该小卷作业已被:{}开工", existingUser);
-                return R.error("该作业已被开工");
-            }
             //根据作业明细ID查询作业明细详情
             ApsProcessOperationProcessEquDo apsProcessOperationProcessEquDo = apsProcessOperationProcessEquService.getById(req.getUseDeviceId());
             //根据加工设备ID查询设备