自动化立体仓库 - WMS系统
#
lsh
2024-06-17 4f76bfd16d95847d484580d3dfd3ff0d971fb2b9
src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -180,6 +180,7 @@
    @ManagerAuth(memo = "初始化库位")
//    @Transactional
    public R init(LocMastInitParam param) {
        try{
        List<LocMast> list = new ArrayList<>();
        BasWhs basWhs = basWhsService.selectByIdentifying(param.getIdentifying());
        if (Cools.isEmpty(basWhs)){
@@ -192,6 +193,8 @@
                    String locNo = String.format("%02d", r) + String.format("%03d", b) + String.format("%02d", l);
                    // 获取堆垛机号
                    int crnNo = 0;
                        if (basWhs.getIdentifying().equals("1") || basWhs.getIdentifying().equals("3")){
                            try{
                    Shelves shelves = new Shelves(param.getEndRow() - param.getStartRow() + 1, param.getCrnAmount(),param.getStartRow());
                    for (List<Integer> node : shelves.nodes){
@@ -205,6 +208,12 @@
                            break;
                        }
                    }
                            }catch (Exception e){
                                throw new Exception("解析堆垛机号失败,请填写正确的数据!!!");
                            }
                        }else {
                            crnNo = param.getStaCrn();
                        }
                    Date now =  new Date();
                    LocMast locMast = new LocMast();
                    locMast.setLocNo(locNo);
@@ -212,6 +221,7 @@
                    locMast.setRow1(r); // 排
                    locMast.setBay1(b); // 列
                    locMast.setLev1(l); // 层
                        locMast.setGro1(0); // 组
                    locMast.setCrnNo(crnNo); // 堆垛机
                    locMast.setLocType1(!Cools.isEmpty(param.getLocType1()) ? param.getLocType1() : 1);
                    locMast.setLocType2(param.getLocType2());
@@ -230,5 +240,8 @@
        }
        locMastService.insertBatch(list);
        return R.ok("初始化成功");
        }catch (Exception e){
            return R.error("初始化失败===>"+e.getMessage());
        }
    }
}