From c98f5558bccd7744f61cc25367e98e56598f0ebd Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期六, 03 六月 2023 12:45:27 +0800 Subject: [PATCH] 地图编辑器增加隐藏显示按钮 --- src/main/java/com/zy/asrs/controller/MapController.java | 32 ++++++++++++++------------------ 1 files changed, 14 insertions(+), 18 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..8cf5c35 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,17 +28,7 @@ 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") @@ -46,7 +36,9 @@ public String getMapData(@PathVariable("lev") Integer lev) { try { String mapFilename = "map.json"; - String fileName = Objects.requireNonNull(this.getClass().getClassLoader().getResource(mapFilename)).getPath();//鑾峰彇鏂囦欢璺緞 +// 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"); File file = new File(fileName); StringBuffer stringBuffer = new StringBuffer(); if (file.isFile() && file.exists()) { @@ -82,10 +74,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 +112,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