From 14129e42408efdd6c1678f44304c0585273d7e85 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期四, 28 八月 2025 15:59:58 +0800
Subject: [PATCH] #手动出库agv库位锁定

---
 src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
index bddeb9e..c41d17a 100644
--- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -311,6 +311,15 @@
                 dtos.add(new OutLocDto(locNo, locDetlDto));
             }
         }
+        Config config = configService.selectConfigByCode("AutoMPArea");
+
+        List<LocMast> list = locMastMapper.selectList(
+                new EntityWrapper<LocMast>()
+                        .eq("whs_type", 5)
+                        .eq("loc_sts", "O")
+        );
+        LocMast locMastRgv = list.isEmpty() ? null : list.get(0);
+
         Integer ioType = null;
         // 鐢熸垚宸ヤ綔妗�
         for (OutLocDto dto : dtos) {
@@ -351,6 +360,10 @@
             wrkMast.setEmptyMk("N"); // 绌烘澘
             wrkMast.setLinkMis("N");
             wrkMast.setBarcode(locMast.getBarcode());
+            if (Boolean.parseBoolean(config.getValue()) && locMastRgv.getLocNo() != null) {  //鑻ユ湁绌哄簱浣嶄笖閰嶇疆鍏佽鍒欑粦瀹氬叾澶囨枡搴撲綅鍙�
+                wrkMast.setLocNo(locMastRgv.getLocNo());
+                wrkMast.setTakeNone("0");  //0rgv鏈彇锛�1rgv宸插彇璐�
+            }
             wrkMast.setAppeUser(userId); // 鎿嶄綔浜哄憳鏁版嵁
             wrkMast.setAppeTime(now);
             wrkMast.setModiUser(userId);
@@ -375,6 +388,18 @@
                 if (!wrkDetlService.insert(wrkDetl)) {
                     throw new CoolException("淇濆瓨宸ヤ綔妗f槑缁嗗け璐�");
                 }
+            }
+            //淇敼agv澶囨枡鍖虹姸鎬�
+            if(locMastRgv.getLocSts().equals("O")){
+                locMastRgv.setLocSts("S");
+                locMastRgv.setModiUser(userId);
+                locMastRgv.setModiTime(now);
+                if (!locMastService.updateById(locMastRgv)) {
+                    throw new CoolException("棰勭害agv澶囨枡鍖哄簱浣嶇姸鎬佸け璐ワ紝搴撲綅鍙凤細"+locMastRgv.getLocNo());
+                }
+            }else{
+                throw new CoolException(locMastRgv.getLocNo() + "澶囨枡鍖轰笉鏄┖搴撲綅鐘舵��");
+
             }
             // 淇敼搴撲綅鐘舵��:   F.鍦ㄥ簱 ====>>> R.鍑哄簱棰勭害/P.鎷f枡/鐩樼偣/骞舵澘鍑哄簱涓�
             locMast = locMastService.selectById(dto.getLocNo());
@@ -493,10 +518,10 @@
             locMastRgv.setModiUser(userId);
             locMastRgv.setModiTime(now);
             if (!locMastService.updateById(locMastRgv)) {
-                throw new CoolException("棰勭害agv澶囨枡鍖哄簱浣嶇姸鎬佸け璐ワ紝搴撲綅鍙凤細"+taskDto.getLocNo());
+                throw new CoolException("棰勭害agv澶囨枡鍖哄簱浣嶇姸鎬佸け璐ワ紝搴撲綅鍙凤細"+locMastRgv.getLocNo());
             }
         }else{
-            throw new CoolException(taskDto.getLocNo() + "澶囨枡鍖轰笉鏄┖搴撲綅鐘舵��");
+            throw new CoolException(locMastRgv.getLocNo() + "澶囨枡鍖轰笉鏄┖搴撲綅鐘舵��");
 
         }
         // 淇敼搴撲綅鐘舵��:   F.鍦ㄥ簱 ====>>> R.鍑哄簱棰勭害/P.鎷f枡/鐩樼偣/骞舵澘鍑哄簱涓�

--
Gitblit v1.9.1