From be8651536f81e44a3d071891594c6f38c29c0cf5 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 14 二月 2023 13:08:28 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/utils/Utils.java |   66 +++++++++++++++++++++-----------
 1 files changed, 43 insertions(+), 23 deletions(-)

diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index 68cb066..1de3954 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -189,24 +189,12 @@
 
     public static Integer getOutLayerRow(String locNo, Boolean pakin){
         int row = getRow(locNo);
-        // 鍏ュ簱
-        if (pakin) {
-            if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {
-                return 17;
-            } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
-                return 18;
-            } else {
-                throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
-            }
-        // 鍑哄簱
+        if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {
+            return 4;
+        } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
+            return 5;
         } else {
-            if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {
-                return 2;
-            } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
-                return 30;
-            } else {
-                throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
-            }
+            return -1;
         }
     }
 
@@ -245,13 +233,9 @@
                 }
             }
         } else {
-            throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+//            throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
         }
         return result;
-    }
-
-    public static void main(String[] args) {
-        System.out.println(JSON.toJSONString(getGroupInsideLoc("2300101")));
     }
 
     // 鍐呬晶鏂瑰悜鐨勮揣浣�  浼樺厛鍏ュ簱鏂瑰悜/浼樺厛鍑哄簱鏂瑰悜 ===>> 鍙嶄箣
@@ -278,7 +262,7 @@
                 }
             }
         } else {
-            throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+//            throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
         }
         if (!Cools.isEmpty(result)) {
             Collections.reverse(result);
@@ -286,4 +270,40 @@
         return result;
     }
 
+    // 澶栦晶鏂瑰悜鐨勮揣浣�  浼樺厛鍏ュ簱鏂瑰悜/浼樺厛鍑哄簱鏂瑰悜 ===>> 鍙嶄箣
+    public static List<String> getGroupOutsideLoc(String locNo){
+        int row = getRow(locNo);
+        List<String> result = new ArrayList<>();
+        if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {
+            for (Integer integer : CommonService.FIRST_GROUP_ROW_LIST) {
+                if (integer < row) {
+                    result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2));
+                } else {
+                    break;
+                }
+            }
+        } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
+            List<Integer> clone = Arrays.asList(new Integer[CommonService.SECOND_GROUP_ROW_LIST.size()]);
+            Collections.copy(clone, CommonService.SECOND_GROUP_ROW_LIST);
+            Collections.reverse(clone);
+            for (Integer integer : clone) {
+                if (integer > row) {
+                    result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2));
+                } else {
+                    break;
+                }
+            }
+        } else {
+//            throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+        }
+        if (!Cools.isEmpty(result)) {
+            Collections.reverse(result);
+        }
+        return result;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(JSON.toJSONString(getGroupOuterLoc("0500201")));
+    }
+
 }

--
Gitblit v1.9.1