From b047f19a6b34a73e018d7e24fb7ec55db2edf472 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 28 五月 2025 12:33:04 +0800
Subject: [PATCH] 库位导出功能优化

---
 rsf-server/src/main/java/com/vincent/rsf/server/api/utils/LocUtils.java |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/utils/LocUtils.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/utils/LocUtils.java
index cec64a0..b9668dc 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/utils/LocUtils.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/utils/LocUtils.java
@@ -12,15 +12,35 @@
 import com.vincent.rsf.server.manager.enums.LocStsType;
 import com.vincent.rsf.server.manager.enums.TaskType;
 import com.vincent.rsf.server.manager.service.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 
+import javax.annotation.PostConstruct;
 import javax.annotation.RegEx;
 import javax.annotation.Resource;
 import java.util.List;
 
+@Component
 public class LocUtils {
+
+    public static final Logger logger = LoggerFactory.getLogger(LocUtils.class);
+
+    private static List<Integer>  doubleLocs;
+
+    private static Boolean isDoubleDeep;
+
+    @Autowired
+    private SlaveProperties slavePropertie;
+
+    @PostConstruct
+    public void init() {
+        doubleLocs = slavePropertie.getDoubleLocs();
+        isDoubleDeep = slavePropertie.isDoubleDeep();
+    }
+
 
     /**
      * 鑾峰彇 娴呭簱浣嶅搴旂殑娣卞簱浣嶅彿
@@ -55,7 +75,12 @@
     public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) {
         LocService locService = SpringUtils.getBean(LocService.class);
         Loc depLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, deepLoc));
-        int row = depLoc.getRow()-1;
+        int row;
+        if (depLoc.getRow() != 1) {
+            row = depLoc.getRow()-1;
+        } else {
+            row = depLoc.getRow();
+        }
         boolean contains = slaveProperties.getDoubleLocs().contains(row);
         Loc shallowLoc = null;
         if (!contains) {
@@ -108,7 +133,7 @@
       return LocNecessaryParametersDoubleExtension(curRow, crnNumber); //宸插畬鍠�
     }
 
-    //缁忓吀鍙屼几搴撲綅
+    //缁忓吀鍙屼几搴撲綅,  鑾峰彇鍙屾繁鎺�
     public static int[] LocNecessaryParametersDoubleExtension( Integer curRow, Integer crnNumber) {
         int[] necessaryParameters = new int[]{0, 0, 0, 0};
 
@@ -187,6 +212,14 @@
         return dto.getLocType1().equals(Integer.parseInt(loc.getType()));
     }
 
+    public static String  getCrnLoc() {
+        SlaveProperties bean = SpringUtils.getBean(SlaveProperties.class);
+        System.out.println(bean.getDoubleLocs());
+
+        return null;
+    }
+
+
     public static String zerofill(String msg, Integer count) {
         if (msg.length() == count) {
             return msg;

--
Gitblit v1.9.1