From 65d4a072e6a382b9583cae85d5c6e59685c2c1c5 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 13 十二月 2022 16:39:01 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/utils/Utils.java |   50 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 42 insertions(+), 8 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..ecbc7e8 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -196,7 +196,8 @@
             } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
                 return 18;
             } else {
-                throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+                return -1;
+//                throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
             }
         // 鍑哄簱
         } else {
@@ -205,7 +206,8 @@
             } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
                 return 30;
             } else {
-                throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+                return -1;
+//                throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
             }
         }
     }
@@ -245,13 +247,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 +276,7 @@
                 }
             }
         } else {
-            throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+//            throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
         }
         if (!Cools.isEmpty(result)) {
             Collections.reverse(result);
@@ -286,4 +284,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