自动化立体仓库 - WMS系统
zyx
2023-08-04 d55581ed00fd0a8ecce78a6ebe6f9e2ee86274b3
src/main/java/com/zy/asrs/controller/MapController.java
@@ -50,22 +50,9 @@
    @GetMapping("/map/getData/{lev}/auth")
    @ManagerAuth
    public String getMapData(@PathVariable("lev") Integer lev) {
        try {
            String mapFilename = "map.json";
            String fileName = this.getClass().getClassLoader().getResource(mapFilename).getPath();//获取文件路径
            File file = new File(fileName);
            StringBuffer stringBuffer = new StringBuffer();
            if (file.isFile() && file.exists()) {
                InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "GBK");
                BufferedReader br = new BufferedReader(isr);
                String lineTxt = null;
                while ((lineTxt = br.readLine()) != null) {
                    stringBuffer.append(lineTxt);
                }
                br.close();
        BasMap basMap = basMapService.selectLatestMap(lev);
                //解析json地图数据
                List<ArrayList> arrayLists = JSON.parseArray(stringBuffer.toString(), ArrayList.class);
        List<ArrayList> arrayLists = JSON.parseArray(basMap.getData(), ArrayList.class);
//                ArrayList<HashMap<String, Integer>> lineRows = new ArrayList<>();
//                int dataRow = 0;
//                int dataRowCount = 0;
@@ -122,13 +109,6 @@
                }
                return JSONObject.toJSONString(arrayLists);
            } else {
                System.out.println("文件不存在!");
            }
        } catch (IOException ioException) {
            ioException.printStackTrace();
        }
        return null;
    }
    @RequestMapping("/map/searchData/auth")