From 8779a30260d9a4613ac50a5b88bf0e9427066de1 Mon Sep 17 00:00:00 2001
From: pjb <pjb123456>
Date: 星期日, 20 七月 2025 23:29:01 +0800
Subject: [PATCH] 移库功能修复

---
 src/main/java/com/zy/service/impl/MainServiceImpl.java |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/zy/service/impl/MainServiceImpl.java b/src/main/java/com/zy/service/impl/MainServiceImpl.java
index 8325cee..3ee27ba 100644
--- a/src/main/java/com/zy/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/service/impl/MainServiceImpl.java
@@ -118,6 +118,9 @@
     private WaitPakinMapper waitPakinMapper;
     @Autowired
     private LocMastService locMastService;
+
+    @Resource
+    private LocMastMapper locMastMapper;
     @Autowired
     private StaDescService staDescService;
     @Autowired
@@ -731,7 +734,7 @@
                         continue;
                     }
 
-                } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) {
+                } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("M")|| shallowLoc.getLocSts().equals("Z")) {
                     News.warnNoLog(""+mark+" - 1"+" - 12"+" - // F銆丏  搴撲綅鐘舵��={}",shallowLoc.getLocSts());
                     // 姝ゆ爣璁伴伩鍏嶅娆℃墽琛岀Щ搴撲换鍔�
                     if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) {
@@ -898,7 +901,7 @@
 
                                 }
                             }
-                        } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) {
+                        } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("M")|| shallowLoc.getLocSts().equals("Z")) {
                             News.warnNoLog(""+mark+" - 2"+" - 9"+" - // F銆丏  搴撲綅鐘舵��={}",shallowLoc.getLocSts());
 //                            WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo);
                             //2022-08-16 modify,涓嶆牴鎹畊pdmk鏍囪绉诲簱浠诲姟(瀹规槗琚彇娑堝鑷村牭濉�)锛屾煡璇㈠伐浣滄。鏄惁瀛樺湪浠诲姟
@@ -1526,13 +1529,25 @@
      */
     private synchronized void moveLocForDeepLoc(CrnSlave crn, LocMast shallowLoc,Integer mark) {
 
+        // 鍙湁208L鑳芥斁11灞�
+        String model = null;
+        if(shallowLoc.getLocSts().equals("F")) {
+            LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", shallowLoc.getLocNo()));
+            if(locDetl != null && locDetl.getModel() != null) {
+                String matModel = locMastMapper.selectMatMatnrByMaktx(locDetl.getModel());
+                if(matModel != null && matModel.equals("208L")) {
+                    model = "208L";
+                }
+            }
+        }
         try {
             News.warnNoLog(""+mark+"moveLocForDeepLoc"+" - 0"+" - 寮�濮嬫墽琛�:鍥犲弻娣卞簱浣嶉樆濉烇紝瀵规祬搴撲綅杩涜绉昏浆锛堢珛鍗虫墽琛岀増)");
             List<Integer> rows = locMastService.queryDistinctRow(crn.getId());
             LocMast loc = null;
             for (Integer row : rows) {
                 if (Utils.isDeepLoc(slaveProperties, row)) {
-                    loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2());
+//                    loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2());
+                    loc = locMastMapper.queryFreeLocMastNew(row,model);
 
                     if (loc != null) {
                         if (Utils.isDeepLoc(slaveProperties, loc.getLocNo())) {
@@ -1551,12 +1566,12 @@
             if (null == loc) {
                 for (Integer row : rows) {
                     if (Utils.isShallowLoc(slaveProperties, row)) {
-                        loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2());
-
+//                        loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2());
+                        loc = locMastMapper.queryFreeLocMastNew(row,model);
                         if (null != loc) {//瀵瑰簲娣卞簱浣嶉潪鍦ㄥ簱鐘舵��,涓嶈兘绉诲簱
                             String deepLoc = Utils.getDeepLoc(slaveProperties, loc.getLocNo());
                             LocMast deepLoc1 = locMastService.selectById(deepLoc);
-                            if (!deepLoc1.getLocSts().equals("F") && !deepLoc1.getLocSts().equals("D")) {
+                            if (!deepLoc1.getLocSts().equals("F") && !deepLoc1.getLocSts().equals("M")&& !deepLoc1.getLocSts().equals("Z")) {
                                 loc = null;
                             }
                         }
@@ -1588,7 +1603,7 @@
                 wrkMast.setFullPlt(shallowLoc.getLocSts().equals("F") ? "Y" : "N"); // 婊℃澘
                 wrkMast.setPicking("N"); // 鎷f枡
                 wrkMast.setExitMk("N"); // 閫�鍑�
-                wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("D") ? "Y" : "N"); // 绌烘澘
+                wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("M") ? "M" : shallowLoc.getLocSts().equals("Z") ? "Z" : "N"); // 绌烘澘
                 wrkMast.setBarcode(shallowLoc.getBarcode()); // 鎵樼洏鐮�
                 wrkMast.setLinkMis("N");
                 wrkMast.setAppeTime(new Date());
@@ -1616,7 +1631,7 @@
                     }
                 }
                 // 淇敼婧愬簱浣嶇姸鎬�
-                if (shallowLoc.getLocSts().equals("D") || shallowLoc.getLocSts().equals("F")) {
+                if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("M") || shallowLoc.getLocSts().equals("Z")) {
                     shallowLoc.setLocSts("R"); // R.鍑哄簱棰勭害
                     shallowLoc.setModiTime(new Date());
                     if (!locMastService.updateById(shallowLoc)) {
@@ -1737,8 +1752,8 @@
                 staProtocol = staProtocol.clone();
             }
             if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.isInEnable() || staProtocol.isOutEnable() && site == 1090) && staProtocol.getWorkNo() != 0 && staProtocol.getWorkNo() < 9000) {
-                if (staProtocol.getWorkNo() == 1034 && !staProtocol.isHigh()) { // 1034绌烘瘝鎷栧洖娴佷换鍔¢渶瑕侀珮淇″彿
-                    return;
+                if (staProtocol.getSiteId() == 1034 && !staProtocol.isHigh()) { // 1034绌烘瘝鎷栧洖娴佷换鍔¢渶瑕侀珮淇″彿
+                    continue;
                 }
                 // 鏌ヨ宸ヤ綔妗�
                 WrkMast wrkMast = wrkMastMapper.selectByWrkNo(staProtocol.getWorkNo());

--
Gitblit v1.9.1