自动化立体仓库 - WMS系统
#
zjj
2024-10-30 a42a2478c870ca45e6b75093f8a190d647aa8b40
src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -71,6 +71,21 @@
        return R.ok(locMastService.selectPage(new Page<>(curr, limit), wrapper));
    }
    @RequestMapping(value = "/locMast/crn/list/auth")
    @ManagerAuth
    public R crnList(@RequestParam(defaultValue = "1")Integer curr,
                  @RequestParam(defaultValue = "10")Integer limit,
                  @RequestParam(required = false)String orderByField,
                  @RequestParam(required = false)String orderByType,
                  @RequestParam Map<String, Object> param){
        excludeTrash(param);
        EntityWrapper<LocMast> wrapper = new EntityWrapper<>();
        convert(param, wrapper);
        wrapper.in("crn_no", 1,2);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        return R.ok(locMastService.selectPage(new Page<>(curr, limit), wrapper));
    }
    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
        boolean sign = false;
        for (Map.Entry<String, Object> entry : map.entrySet()){
@@ -193,27 +208,24 @@
                        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){
                        try{
                            Shelves shelves = new Shelves(param.getEndRow() - param.getStartRow() + 1, param.getCrnAmount(),param.getStartRow());
                            for (List<Integer> node : shelves.nodes){
                                    if (node.contains(r)) {
                                        if (!Cools.isEmpty(param.getStaCrn()) && param.getStaCrn() > 0){
                                            crnNo = shelves.nodes.indexOf(node) + param.getStaCrn();
                                        }else {
                                            crnNo = shelves.nodes.indexOf(node) + 1;
                                        }
                                        break;
                                if (node.contains(r)) {
                                    if (!Cools.isEmpty(param.getStaCrn()) && param.getStaCrn() > 0){
                                        crnNo = shelves.nodes.indexOf(node) + param.getStaCrn();
                                    }else {
                                        crnNo = shelves.nodes.indexOf(node) + 1;
                                    }
                                    break;
                                }
                            }catch (Exception e){
                                throw new Exception("解析堆垛机号失败,请填写正确的数据!!!");
                            }
                        }else {
                            crnNo = param.getStaCrn();
                        }catch (Exception e){
                            throw new Exception("解析堆垛机号失败,请填写正确的数据!!!");
                        }
                        Date now =  new Date();
                        LocMast locMast = new LocMast();
                        locMast.setLocNo(locNo);
@@ -221,7 +233,7 @@
                        locMast.setRow1(r); // 排
                        locMast.setBay1(b); // 列
                        locMast.setLev1(l); // 层
                        locMast.setGro1(0); // 组
                        locMast.setGro1(r); // 组
                        locMast.setCrnNo(crnNo); // 堆垛机
                        locMast.setLocType1(!Cools.isEmpty(param.getLocType1()) ? param.getLocType1() : 1);
                        locMast.setLocType2(param.getLocType2());