From ca5639ffb9ada48efb1592ce60117a16a9e4d1cb Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期三, 31 八月 2022 14:52:12 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/service/CommonService.java |   46 ++++++++++++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 73ec6ea..d5562b0 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -10,7 +10,6 @@
 import com.zy.asrs.utils.Utils;
 import com.zy.asrs.utils.VersionUtils;
 import com.zy.common.model.LocTypeDto;
-import com.zy.common.model.Shelves;
 import com.zy.common.model.StartupDto;
 import com.zy.common.properties.SlaveProperties;
 import lombok.extern.slf4j.Slf4j;
@@ -123,8 +122,7 @@
                 whsType = 3;
                 break;
             default:
-                whsType = 1;
-                break;
+                throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
         }
         // 鐢熸垚宸ヤ綔鍙�
         int workNo = getWorkNo(0);
@@ -184,23 +182,39 @@
 
         // 濡傛灉娌℃湁鐩歌繎鐗╂枡锛屽垯鎸夎鍒欒疆璇㈣揣鏋�
         if (null == locMast) {
-            Shelves shelves = new Shelves(rowCount, crn_qty);
-            for (int i = 0; i < shelves.group; i ++) {
-                curRow = shelves.start(curRow);
-                if (curRow < 0) {
-                    throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
-                }
-                Integer crnNo1 = shelves.get(curRow) + 1;
-                if (whsType != 1) {
-                    crnNo1 = whsType;
-                }
-                if (basCrnpService.checkSiteError(crnNo1, true)) {
-                    crnNo = crnNo1;
+            switch (whsType) {
+                case 1:
+                    if (curRow == 1) {
+                        curRow = 7;
+                    } else if (curRow == 7) {
+                        curRow = 1;
+                    }
+                    crnNo = 1;
                     break;
-                }
+                case 2:
+                    if (curRow == 8) {
+                        curRow = 14;
+                    } else if (curRow == 14) {
+                        curRow = 8;
+                    }
+                    crnNo = 2;
+                    break;
+                case 3:
+                    if (curRow == 15) {
+                        curRow = 21;
+                    } else if (curRow == 21) {
+                        curRow = 15;
+                    }
+                    crnNo = 3;
+                    break;
+                default:
+                    throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
             }
         }
 
+        if (!basCrnpService.checkSiteError(crnNo, true)) {
+            throw new CoolException("娌℃湁鍙敤鐨勫爢鍨涙満");
+        }
         if (crnNo == 0) {
             throw new CoolException("娌℃湁鍙敤鐨勫爢鍨涙満");
         }

--
Gitblit v1.9.1