From e62569856fdfb0c7c31ee88cf96628af08eabf85 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期一, 03 十一月 2025 12:34:15 +0800
Subject: [PATCH] 标准wms2.0

---
 src/main/java/com/zy/asrs/utils/Utils.java |   42 +++++++++++++++++++++++++++++-------------
 1 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index 0b98d6b..3cc7605 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -8,17 +8,10 @@
 import com.zy.asrs.entity.LocMast;
 import com.zy.asrs.entity.RowLastno;
 import com.zy.asrs.service.RowLastnoService;
-import com.zy.common.CodeBuilder;
-import com.zy.common.model.LocDetlDto;
 import com.zy.common.properties.SlaveProperties;
-import com.zy.common.service.CommonService;
-import com.zy.system.service.UserService;
-
 
 import java.text.DecimalFormat;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 
 /**
@@ -287,6 +280,8 @@
                 return LocNecessaryParametersDoubleExtension5(rowLastno, curRow, crnNumber); //宸插畬鍠�
             case 6://鍥涘悜搴�(鐗涚溂杞�)eg:鍏夋嘲鍥涘悜
                 return LocNecessaryParametersDoubleExtension6(rowLastno, curRow, crnNumber); //宸插畬鍠�
+            case 7://骞冲簱  CTU搴�
+                return LocNecessaryParametersDoubleExtension7(rowLastno, curRow, crnNumber); //宸插畬鍠�
             default:
                 return LocNecessaryParametersMove(rowLastno, curRow, crnNumber);//moveCrnNo
         }
@@ -474,7 +469,7 @@
             }
             if ((curRow - sRow) % 4 == 0) {
                 necessaryParameters[1] = curRow;    //curRow   鏈�娣卞簱浣嶆帓
-                necessaryParameters[2] = (curRow - sRow + 2) / 4 + sCrnNo - 1;     //crnNo     鍫嗗灈鏈哄彿
+                necessaryParameters[2] = (curRow - sRow + 2) / 4 + sCrnNo;     //crnNo     鍫嗗灈鏈哄彿
                 necessaryParameters[3] = curRow + 1;    //nearRow  鏈�娴呭簱浣嶆帓
             } else if ((curRow - sRow + 1) % 4 == 0) {
                 necessaryParameters[1] = curRow;    //curRow   鏈�娣卞簱浣嶆帓
@@ -487,6 +482,7 @@
 
         return necessaryParameters;
     }
+
     //鍥涘悜搴擄紙鐗涚溂\鍏夋嘲锛�
     public static int[] LocNecessaryParametersDoubleExtension6(RowLastno rowLastno, Integer curRow, Integer crnNumber) {
         int[] necessaryParameters = new int[]{0, 0, 0, 0};
@@ -496,7 +492,7 @@
         necessaryParameters[0] = crnNumber; // 杞娆℃暟
         curRow = curRow - offset;
         //婊℃澘姝e父鍏ュ簱
-        switch (curRow){
+        switch (curRow) {
             case 1:
                 necessaryParameters[1] = 4;    //curRow   鏈�娣卞簱浣嶆帓
                 necessaryParameters[2] = sCrnNo;     //crnNo     鍫嗗灈鏈哄彿
@@ -532,6 +528,26 @@
         }
         necessaryParameters[1] = necessaryParameters[1] + offset;
         necessaryParameters[3] = necessaryParameters[3] + offset;
+        return necessaryParameters;
+    }
+
+    //骞冲簱锛堝厜娉癨CTU锛�
+    public static int[] LocNecessaryParametersDoubleExtension7(RowLastno rowLastno, Integer curRow, Integer crnNumber) {
+        int[] necessaryParameters = new int[]{0, 0, 0, 0};
+        Integer sRow = rowLastno.getsRow();//璧峰鎺掑彿
+        Integer sCrnNo = rowLastno.getsCrnNo();//璧峰鍫嗗灈鏈哄彿
+        necessaryParameters[0] = crnNumber; // 杞娆℃暟
+        //婊℃澘姝e父鍏ュ簱
+        if (curRow.equals(rowLastno.geteRow())) {
+            necessaryParameters[1] = sRow;    //curRow   鏈�娣卞簱浣嶆帓
+            necessaryParameters[2] = sCrnNo;     //crnNo     鍫嗗灈鏈哄彿
+            necessaryParameters[3] = sRow;    //nearRow  鏈�娴呭簱浣嶆帓
+        } else {
+            necessaryParameters[1] = curRow + 1;    //curRow   鏈�娣卞簱浣嶆帓
+            necessaryParameters[2] = sCrnNo;     //crnNo     鍫嗗灈鏈哄彿
+            necessaryParameters[3] = curRow + 1;    //nearRow  鏈�娴呭簱浣嶆帓
+        }
+
         return necessaryParameters;
     }
 
@@ -597,12 +613,12 @@
     // 澶栦晶鏂瑰悜鐨勮揣浣�  浼樺厛鍏ュ簱鏂瑰悜 ===>> 鍙嶄箣
     public static List<String> getGroupOutLocCrn(Integer curRow, Integer nearRow, String locNo, boolean pakin) {
         List<String> result = new ArrayList<>();
-        if (pakin){
-            for (int row = curRow;row>=nearRow;row--){
+        if (pakin) {
+            for (int row = curRow; row >= nearRow; row--) {
                 result.add(zerofill(String.valueOf(row), 2) + locNo.substring(2));
             }
-        }else {
-            for (int row = curRow;row<=nearRow;row++){
+        } else {
+            for (int row = curRow; row <= nearRow; row++) {
                 result.add(zerofill(String.valueOf(row), 2) + locNo.substring(2));
             }
         }

--
Gitblit v1.9.1