From 2c2f9b0d2c42db9aac486af26e15fd6957012d18 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期五, 16 六月 2023 11:15:53 +0800
Subject: [PATCH] 增加111库位移存(原)定时任务

---
 src/main/java/com/zy/asrs/utils/Utils.java |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index 5ddaadc..03cb782 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -88,7 +88,14 @@
     public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) {
         int row = getRow(deepLoc);
         int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
-        int shallowRow = remainder == 1 ? (row + 1) : (row - 1);
+        int shallowRow ;
+        if (row == 15 || row == 9) {
+            shallowRow = row + 1;
+        } else if (row == 12 || row==18) {
+            shallowRow = row - 1;
+        } else {
+            throw new RuntimeException(row + "涓嶆槸娴呭簱浣嶏紝绯荤粺绻佸繖");
+        }
         return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2);
     }
 
@@ -107,12 +114,12 @@
         int row = getRow(shallowLoc);
         int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
         int targetRow;
-        if (remainder == 2) {
+        if (row == 10 || row == 16) {
             targetRow = row - 1;
-        } else if (remainder == 3) {
+        } else if (row == 11 || row == 17) {
             targetRow = row + 1;
         } else {
-            throw new RuntimeException(shallowLoc + "涓嶆槸娴呭簱浣嶏紝绯荤粺绻佸繖");
+            throw new RuntimeException(row + "涓嶆槸娴呭簱浣嶆帓锛岀郴缁熺箒蹇�");
         }
         return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2);
     }
@@ -123,11 +130,7 @@
     public static Integer getDeepRow(SlaveProperties slaveProperties, Integer shallowRow) {
         int remainder = (int) Arith.remainder(shallowRow, slaveProperties.getGroupCount());
         int targetRow;
-        if (remainder == 2) {
-            targetRow = shallowRow - 1;
-        } else if (remainder == 3) {
-            targetRow = shallowRow + 1;
-        } else if (shallowRow == 10 || shallowRow == 16) {
+        if (shallowRow == 10 || shallowRow == 16) {
             targetRow = shallowRow - 1;
         } else if (shallowRow == 11 || shallowRow == 17) {
             targetRow = shallowRow + 1;

--
Gitblit v1.9.1