From eb9e30160e01dbf905d5514c3b6a07f5d12023ff Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 25 五月 2023 16:06:31 +0800
Subject: [PATCH] 入库找库位逻辑

---
 src/main/java/com/zy/asrs/utils/Utils.java |   64 +++++++++++++------------------
 1 files changed, 27 insertions(+), 37 deletions(-)

diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index 12cdfb4..e75e2a8 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -39,6 +39,13 @@
     }
 
     /**
+     * 閫氳繃鎺掑垪灞傛嫾鎺ュ嚭搴撲綅鍙�
+     */
+    public static String append(int row, int bay, int lev) {
+        return zerofill(String.valueOf(row), 2) + zerofill(String.valueOf(bay), 3) + zerofill(String.valueOf(lev), 2);
+    }
+
+    /**
      * 鍒ゆ柇鏄惁涓烘繁搴撲綅
      */
     public static boolean isDeepLoc(SlaveProperties slaveProperties, String locNo){
@@ -146,6 +153,26 @@
     }
 
     /**
+     * 閫氳繃搴撲綅鍙疯幏鍙� 鍒�
+     */
+    public static int getBay(String locNo) {
+        if (!Cools.isEmpty(locNo)) {
+            return Integer.parseInt(locNo.substring(2, 5));
+        }
+        throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+    }
+
+    /**
+     * 閫氳繃搴撲綅鍙疯幏鍙� 灞�
+     */
+    public static int getLev(String locNo) {
+        if (!Cools.isEmpty(locNo)) {
+            return Integer.parseInt(locNo.substring(5, 7));
+        }
+        throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+    }
+
+    /**
      * 褰撴绱㈠埌鍙屾繁搴撲綅鐨勬祬搴撲綅鏃讹紝濡傛灉娣卞簱浣嶆棤璐э紝鍒欐斁鍏ュ搴旂殑娣卞簱浣�
      */
     public static void toDeepIfEmptyByShallow(String shallowLoc) {
@@ -197,42 +224,6 @@
                 throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
         }
     }
-
-    public static Integer getInnermostRow(String locNo){
-        int row = getRow(locNo);
-        switch (row) {
-            case 1:
-            case 2:
-            case 3:
-                return 1;
-            case 4:
-            case 5:
-            case 6:
-            case 7:
-                return 7;
-            case 8:
-            case 9:
-            case 10:
-            case 11:
-                return 8;
-            case 12:
-            case 13:
-            case 14:
-                return 14;
-            case 15:
-            case 16:
-            case 17:
-            case 18:
-                return 15;
-            case 19:
-            case 20:
-            case 21:
-                return 21;
-            default:
-                throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
-        }
-    }
-
 
     public static List<String> getGroupLoc(String locNo){
         int row = getRow(locNo);
@@ -532,7 +523,6 @@
                 throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
         }
     }
-
 
     public Map<Integer, List<Integer>> getRowSeqHasSortOfPakin(int start, int end) {
         Map<Integer, List<Integer>> result = new HashMap<>();

--
Gitblit v1.9.1