From dbeff5ad092f2e8b599950ebee1d3499e466d9a4 Mon Sep 17 00:00:00 2001
From: tqs <56479841@qq.com>
Date: 星期四, 22 十二月 2022 10:43:21 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   51 +++++++++++++++++++++++++++++----------------------
 1 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index c92f5ab..588859d 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -331,6 +331,7 @@
     /**
      * 鎷f枡銆佸苟鏉裤�佺洏鐐瑰啀鍏ュ簱銆愮2闃舵銆�
      */
+    @Transactional
     public synchronized void stnToCrnStnPick1(){
         for (DevpSlave devp : slaveProperties.getDevp()) {
             // 閬嶅巻鎷f枡鍏ュ簱鍙�
@@ -454,7 +455,8 @@
                                 throw new CoolException(wrkMast.getWrkNo() + "淇濆瓨宸ヤ綔涓绘。鍘嗗彶妗eけ璐�");
                             }
 
-                            String sourceLocNo = wrkMast.getSourceLocNo().trim();
+//                            String sourceLocNo = wrkMast.getSourceLocNo().trim();
+
                             // 鏇存柊宸ヤ綔妗f暟鎹姸鎬�
                             wrkMast.setIoType(wrkMast.getIoType() - 50); // 鍏ュ嚭搴撶被鍨�: 103->53,104->54,107->57
                             wrkMast.setWrkSts(2L); // 宸ヤ綔鐘舵��: 2.璁惧涓婅蛋
@@ -470,14 +472,8 @@
                             if (wrkMastMapper.setSteEmpty(wrkMast.getWrkNo()) == 0) {
                                 throw new CoolException(wrkMast.getWrkNo() + "鏇存柊宸ヤ綔妗f暟鎹姸鎬佸け璐�");
                             }
+
                             LocMast locMast = null;
-                            // 淇敼婧愬簱浣嶇姸鎬� O.绌哄簱浣�
-//                            locMast = locMastService.selectById(sourceLocNo);
-//                            locMast.setLocSts("O");
-//                            locMast.setModiTime(new Date());
-//                            if (!locMastService.updateById(locMast)) {
-//                                throw new CoolException(wrkMast.getWrkNo() + "淇敼婧愬簱浣嶇姸鎬� O.绌哄簱浣�");
-//                            }
                             // 淇敼鐩爣搴撲綅鐘舵�� Q.鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴�
                             locMast = locMastService.selectById(wrkMast.getLocNo());
                             locMast.setLocSts("Q");
@@ -485,10 +481,21 @@
                             if (!locMastService.updateById(locMast)) {
                                 throw new CoolException(wrkMast.getWrkNo() + "淇敼鐩爣搴撲綅鐘舵�� Q.鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴�");
                             }
-                            // 搴撳瓨鏄庣粏杞Щ
-//                            if (!locDetlService.updateLocNo(wrkMast.getLocNo(), sourceLocNo)) {
-//                                throw new CoolException(wrkMast.getWrkNo() + "浠诲姟搴撳瓨鏄庣粏杞Щ澶辫触锛侊紒锛�");
-//                            }
+                            // 婧愬簱浣嶅簱瀛樻槑缁嗚浆绉诲埌鐩爣搴撲綅
+                            if (!locDetlService.updateLocNo(wrkMast.getLocNo(), wrkMast.getSourceLocNo())) {
+                                throw new CoolException(wrkMast.getLocNo() + "浠诲姟搴撳瓨鏄庣粏杞Щ澶辫触锛侊紒锛�");
+                            }
+
+                            // 淇敼婧愬簱浣嶇姸鎬� O.绌哄簱浣�
+                            LocMast sourceLocMast = locMastService.selectById(wrkMast.getSourceLocNo());
+                            if (sourceLocMast.getLocSts().equals("P")) {
+                                sourceLocMast.setLocSts("O");
+                                sourceLocMast.setModiTime(new Date());
+                                if (!locMastService.updateById(sourceLocMast)) {
+                                    throw new CoolException(wrkMast.getWrkNo() + "淇敼婧愬簱浣嶇姸鎬� O.绌哄簱浣�");
+                                }
+                                locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getSourceLocNo()));
+                            }
 
                             // 鏉$爜璁惧澶勭悊
                             barcodeThread.setBarcode("");
@@ -544,16 +551,16 @@
     public synchronized void pickWrkCompleteStaNo() {
         List<WrkMast> wrkMasts = wrkMastMapper.selectPick17(null, null);
         for (WrkMast wrkMast : wrkMasts) {
-            // 淇敼婧愬簱浣嶇姸鎬� O.绌哄簱浣�
-            LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo());
-            if (locMast.getLocSts().equals("P")) {
-                locMast.setLocSts("O");
-                locMast.setModiTime(new Date());
-                if (!locMastService.updateById(locMast)) {
-                    throw new CoolException(wrkMast.getWrkNo() + "淇敼婧愬簱浣嶇姸鎬� O.绌哄簱浣�");
-                }
-                locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getSourceLocNo()));
-            }
+//            // 淇敼婧愬簱浣嶇姸鎬� O.绌哄簱浣�
+//            LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo());
+//            if (locMast.getLocSts().equals("P")) {
+//                locMast.setLocSts("O");
+//                locMast.setModiTime(new Date());
+//                if (!locMastService.updateById(locMast)) {
+//                    throw new CoolException(wrkMast.getWrkNo() + "淇敼婧愬簱浣嶇姸鎬� O.绌哄簱浣�");
+//                }
+//                locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getSourceLocNo()));
+//            }
             // 淇敼宸ヤ綔妗�
             wrkMast.setIoPri(13D);
             wrkMast.setModiTime(new Date());

--
Gitblit v1.9.1