From d2c1030a17f4bcf6846e52f7bc91068159cc8f99 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期五, 11 十月 2024 11:00:37 +0800
Subject: [PATCH] --

---
 src/main/java/com/zy/common/service/CommonService.java |   48 +++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 9090ac1..d301e2e 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -35,6 +35,18 @@
         add(21);add(22);add(23);add(24);add(25);add(26);add(27);add(28);add(29);add(30);
     }};
 
+    public static final List<String> HARD_LOC_NO = new ArrayList<String>() {{
+        add("0200104");add("0200704");add("0201404");add("0202004");
+        add("0600201");add("0600202");add("0600203");add("0600204");
+        add("0600301");add("0600302");add("0600303");add("0600304");
+        add("0600701");add("0600702");
+        add("0601401");add("0601402");
+        add("0602001");add("0602002");
+        add("2000704");add("2001404");add("2002004");
+        add("1600701");add("1601401");add("1602001");
+        add("1600702");add("1601402");add("1602002");
+    }};
+
     @Autowired
     private WrkMastService wrkMastService;
     @Autowired
@@ -274,7 +286,7 @@
                             // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
                             if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
                                 // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
-                                if (locMastService.checkEmptyCount(locMast0, 10)) {
+                                if (locMastService.checkEmptyCount(locMast0, 5)) {
                                     locMast = locMast0;
                                     break;
                                 }
@@ -313,7 +325,7 @@
                         // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
                         if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
                             // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
-                            if (locMastService.checkEmptyCount(locMast0, 10)) {
+                            if (locMastService.checkEmptyCount(locMast0, 5)) {
                                 locMast = locMast0;
                                 break;
                             }
@@ -342,7 +354,7 @@
                         // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
                         if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
                             // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
-                            if (locMastService.checkEmptyCount(locMast0, 10)) {
+                            if (locMastService.checkEmptyCount(locMast0, 5)) {
                                 locMast = locMast0;
                                 break;
                             }
@@ -372,10 +384,28 @@
                         // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
                         if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
                             // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
-                            if (locMastService.checkEmptyCount(locMast0, 10)) {
+                            if (locMastService.checkEmptyCount(locMast0, 5)) {
                                 locMast = locMast0;
                                 flag = true;
                                 break;
+                            }
+                        }
+                    }
+                }
+                if (!flag) {
+                    List<LocMast> locMastsNew = locMastService.findInEmptyLocMastNew(locTypeDto.getLocType1(), HARD_LOC_NO, crnNo);//鎵句竴鏉℃柊鐨勭┖宸烽亾
+                    for (LocMast locMast0 : locMastsNew) {
+                        //妫�娴嬪綋鍓嶅簱浣嶅唴渚у叾浠栧簱浣嶆槸鍚︿负D銆丗銆乆
+                        // 娴呭簱浣嶇鍚堝昂瀵告娴�
+                        if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) {
+                            // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
+                            if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
+                                // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+                                if (locMastService.checkEmptyCount(locMast0, 5)) {
+                                    locMast = locMast0;
+                                    flag = true;
+                                    break;
+                                }
                             }
                         }
                     }
@@ -415,7 +445,7 @@
                 // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
                 if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
                     // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
-                    if (locMastService.checkEmptyCount(locMast0, 10)) {
+                    if (locMastService.checkEmptyCount(locMast0, 5)) {
                         locMast = locMast0;
                     }
                 }
@@ -518,9 +548,13 @@
         if (Cools.isEmpty(staDesc)) {
             log.error("鍏ュ簱璺緞涓嶅瓨鍦�, staDescId={}, sourceStaNo={}, crnNo={}", staDescId, sourceStaNo, locMast.getCrnNo());
             if (sourceStaNo==103 &&  locMast.getCrnNo()==3){
-                throw new CoolException("璇锋斁鍒�203鍏ュ簱鍙�");
+                throw new CoolException("璇锋斁鍒�203鍏ュ簱鍙�--1000");
             }else if (sourceStaNo==203 &&  locMast.getCrnNo()==1){
-                throw new CoolException("璇锋斁鍒�103鍏ュ簱鍙�");
+                throw new CoolException("璇锋斁鍒�103鍏ュ簱鍙�--1000");
+            }else if (sourceStaNo==113 &&  locMast.getCrnNo()==3){
+                throw new CoolException("璇锋斁鍒�213鍏ュ簱鍙�--1000");
+            }else if (sourceStaNo==213 &&  locMast.getCrnNo()==1){
+                throw new CoolException("璇锋斁鍒�113鍏ュ簱鍙�--1000");
             }else {
                 throw new CoolException("鍏ュ簱璺緞涓嶅瓨鍦�");
             }

--
Gitblit v1.9.1