自动化立体仓库 - WMS系统
#
LSH
2023-05-29 2a0dc2ba812aff257fc6460823f2bdcdd35d3a05
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) {//过滤掉不是当前楼层的数据