From d14cfd26c49bae091b84e90142b04ec0067c82bb Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期四, 25 五月 2023 16:29:10 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/controller/MapController.java |   35 +++++++++++++++--------------------
 1 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/MapController.java b/src/main/java/com/zy/asrs/controller/MapController.java
index ff28fab..e52e038 100644
--- a/src/main/java/com/zy/asrs/controller/MapController.java
+++ b/src/main/java/com/zy/asrs/controller/MapController.java
@@ -11,12 +11,12 @@
 import com.zy.asrs.utils.Utils;
 import com.zy.common.web.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
 import org.springframework.web.bind.annotation.*;
 
 import java.io.*;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Objects;
 
 @RestController
 
@@ -28,26 +28,17 @@
     private LocDetlService locDetlService;
 
     private static final List<String> DISABLE_LOC_NO = new ArrayList<String>() {{
-        add("0200101");
-        add("0300101");
-        add("0400101");
-        add("0500101");
-        add("0600101");
-        add("0700101");
-        add("0800101");
-        add("0900101");
-        add("1000101");
-        add("1100101");
-        add("1200101");
+
     }};
 
     @GetMapping("/map/getData/{lev}/auth")
     @ManagerAuth
     public String getMapData(@PathVariable("lev") Integer lev) {
         try {
-            String mapFilename = "map.json";
-            String fileName = Objects.requireNonNull(this.getClass().getClassLoader().getResource(mapFilename)).getPath();//鑾峰彇鏂囦欢璺緞
-            File file = new File(fileName);
+//            String mapFilename = "map.json";
+//            String fileName ="file:" + new ClassPathResource(mapFilename).getPath();
+//            String fileName = this.getClass().getClassLoader().getResource(mapFilename).getPath();//鑾峰彇鏂囦欢璺緞
+            File file = new File("D:\\workspace\\zy-asrs\\src\\main\\resources\\map.json");
             StringBuffer stringBuffer = new StringBuffer();
             if (file.isFile() && file.exists()) {
                 InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "GBK");
@@ -82,10 +73,14 @@
                 for (LocMast locMast : locMasts) {
                     Integer row = locMast.getRow1();
                     Integer bay = locMast.getBay1();
-                    if (row >= 2 && row <= 12) {
-                        row++;
-                    }else if (row == 13) {
-                        row += 2;
+                    if (row<17){
+                        if (row % 4 == 0 || (row+1) % 4 == 0) {
+                            row=row+locMast.getCrnNo();
+                        }else{
+                            row=row+locMast.getCrnNo()-1;
+                        }
+                    }else {
+                        row=row-100+21;
                     }
                     ArrayList rowData = arrayLists.get(row);
                     Object o = rowData.get(bay);
@@ -116,7 +111,7 @@
                        @RequestParam("specs") String specs,
                        @RequestParam("matnr") String matnr,
                        @RequestParam("maktx") String maktx
-                       ) {
+    ) {
         List<LocDetl> locDetls = locDetlService.searchByLike(orderNo, matnr, maktx, specs, locNo);
         ArrayList<LocDetl> lists = new ArrayList<>();
         for (LocDetl locDetl : locDetls) {//杩囨护鎺変笉鏄綋鍓嶆ゼ灞傜殑鏁版嵁

--
Gitblit v1.9.1