自动化立体仓库 - WMS系统
#
LSH
2023-10-25 cee9ae96ca3e2831ea659e8ccdc979f22b820ace
src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -215,56 +215,4 @@
        locMastService.insertBatch(list);
        return R.ok("初始化成功");
    }
    @RequestMapping(value = "/locMast/convert/size/auth")
    @ManagerAuth(memo = "大小库位转换")
    @Transactional
    public R convertSize(@RequestParam String param) {
        List<LocMast> list = JSONArray.parseArray(param, LocMast.class);
        if (Cools.isEmpty(list)){
            return R.error();
        }
        for (LocMast entity : list){
            if (!entity.getCrnNo().equals(1) && !entity.getCrnNo().equals(4)){
                return R.error("请选择1号、4号堆垛机的货位!!!不符合条件库位:"+entity.getLocNo());
            }
            if (!entity.getLocSts().equals("O") && !entity.getLocSts().equals("Y")){
                return R.error("请选择空闲、被合并的货位!!!不符合条件库位:"+entity.getLocNo());
            }
        }
        List<String> innermostSideLoc = Utils.getInnermostSideLoc(list);
        StringBuilder msg=new StringBuilder();
        for (String locNo : innermostSideLoc){
            String innermostSideLocLBR = Utils.getInnermostSideLocLBR(locNo);
            LocMast locMast1 = locMastService.selectById(innermostSideLocLBR);//浅
            if (Cools.isEmpty(locMast1)){
                msg.append("请选择浅库位存在的货位!!!不符合条件库位:").append(innermostSideLocLBR).append("/n");
                continue;
            }
            if (!locMast1.getLocSts().equals("O")){
                msg.append("请选择浅库位空闲的货位!!!不符合条件库位:").append(locMast1.getLocNo()).append("/n");
                continue;
            }
            LocMast locMast = locMastService.selectById(locNo);//深
            if (Cools.isEmpty(locMast)){
                msg.append("请选择深库位存在的货位!!!不符合条件库位:").append(locNo).append("/n");
                continue;
            }
            if (!Cools.isEmpty(locMast) && locMast.getLocSts().equals("O")){
                locMast1.setLocType1((short)2);
                locMast.setLocType1((short)2);
                locMast.setLocSts("Y");
            }else if (!Cools.isEmpty(locMast) && locMast.getLocSts().equals("Y")){
                locMast1.setLocType1((short)1);
                locMast.setLocType1((short)1);
                locMast.setLocSts("O");
            }else {
                msg.append("请选择深库位库位空闲、被合并的货位!!!不符合条件库位:").append(locMast.getLocNo()).append("/n");
                continue;
            }
            locMastService.updateById(locMast1);
            locMastService.updateById(locMast);
        }
        return R.ok(msg);
    }
}