自动化立体仓库 - WMS系统
zyx
2024-04-01 2d836c8b6a270b7007e1a2e1e9962cb9dcd8b6f6
src/main/java/com/zy/asrs/controller/AgvMapController.java
@@ -49,7 +49,11 @@
    @GetMapping("/map/getData/{floor}/{lev}/auth")
    @ManagerAuth
    public String getMapData(@PathVariable("floor") Integer floor, @PathVariable("lev") Integer lev) {
        BasMap basMap = agvBasMapService.selectLatestMap(lev,floor);
        //to do
        floor = 2;
        BasMap basMap = agvBasMapService.selectLatestMap(1,floor);
        //解析json地图数据
        List<ArrayList> arrayLists = JSON.parseArray(basMap.getData(), ArrayList.class);
@@ -63,26 +67,23 @@
            int x = bay;
            int y = row;
            //1楼
            if(floor == 1){
                x = generateMap1Row(row);
                y = generateMap1Bay(bay);
            //2楼
            if(floor == 2){
                y = generateMap2Row(row);
                //y = generateMap2Bay(bay);
            }
            //3楼
            if(floor == 3){
                y = generateMap3Row(row);
                x = generateMap3Bay(bay);
            }
            ////3楼
            //if(floor == 3){
            //    y = generateMap3Row(row);
            //    x = generateMap3Bay(bay);
            //}
            ArrayList rowData = arrayLists.get(x);
            Object o = rowData.get(y);
            JSONObject jsonObject = JSON.parseObject(o.toString());
            if (DISABLE_LOC_NO.contains(locMast.getLocNo())) {
                //禁止库位
                jsonObject.put("value", 10);//将禁用库位进行设置
            }
            jsonObject.put("value","0");
            jsonObject.put("locNo", locMast.getLocNo());//设置库位号
            jsonObject.put("locSts", locMast.getLocSts());//库位状态
            //更新list
@@ -93,34 +94,21 @@
        return JSONObject.toJSONString(arrayLists);
    }
    private Integer generateMap1Row(int row){
        int x = 21-row;
        if(row > 1){
            x --;
    private Integer generateMap2Row(int row){
        int x = row;
        Integer[] rowAdd = {2,4,6,7,8,10,12,13,15,17,19,20,22,24};
        for(int i=0; i<rowAdd.length; i++){
            if(row > rowAdd[i]){
                x ++;
            }
        }
        if(row > 3){
            x --;
        }
        if(row > 4){
            x --;
        }
        if(row > 6){
            x --;
        }
        if(row > 8){
            x --;
        }
        if(row > 10){
            x --;
        }
        if(row > 12){
            x --;
        }
        if(row >20) x += 9;
        return x;
    }
    private Integer generateMap1Bay(int bay){
    private Integer generateMap2Bay(int bay){
        int y = bay;
        if(y > 28){
            y ++;
@@ -133,7 +121,7 @@
    private Integer generateMap3Row(int row){
        int x = row;
        Integer[] rowAdd = {2,4,6,8,9,11,12,14,16,18,19,21,23,25,27,29,31,33};
        Integer[] rowAdd = {2,4,6,7,8,10,12,13,15,17,19,21,23,24,26,28,30,32};
        for(int i=0; i<rowAdd.length; i++){
            if(row >= rowAdd[i]){
                x ++;
@@ -143,9 +131,10 @@
    }
    private Integer generateMap3Bay(int bay){
        int y = 73-bay;
        if(bay >= 15) y --;
        if(bay >= 47) y --;
        int y = 76-bay;
        if(bay >= 18) y --;
        if(bay >= 26) y --;
        if(bay >= 50) y --;
        return y;
    }