自动化立体仓库 - WMS系统
dubin
2025-12-19 b00eeab31bd13ba34a03301aa441b0751d6a93e4
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -51,6 +51,8 @@
    private WaitMatchkService waitMatchkService;
    @Autowired
    private MatCodeService matCodeService;
    @Autowired
    private WrkMastService wrkMastService;
    /**
     * 组托
@@ -58,6 +60,7 @@
    @RequestMapping("/comb/auth")
    @ManagerAuth(memo = "组托")
    public R comb(@RequestBody CombParam combParam){
        System.out.println("combParam = " + combParam);
        mobileService.comb(combParam, getUserId());
        return R.ok();
    }
@@ -129,6 +132,20 @@
        return R.parse(BaseRes.PARAM);
    }
    // 拣料检索托盘信息
    @RequestMapping("/piking/auth")
    @ManagerAuth
    public R pikingAuth(String barcode) {
        WrkMast wrkMast = wrkMastService.selectByBarcode(barcode);
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException(barcode + "暂无工作档");
        }
        if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 107){
            throw new CoolException(barcode + "不为拣料/盘点出库");
        }
        List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
        return R.ok().add(wrkDetls);
    }
    /**
     *  根据库位号查找库存明细
     */
@@ -213,6 +230,7 @@
     */
    @RequestMapping("/stock/check")
    @Transactional
    @ManagerAuth
    public R erpStockCheck(@RequestBody String param) {
        Boolean flag = false;
        JSONObject jsonObject = JSONObject.parseObject(param);
@@ -271,4 +289,56 @@
        }
        return R.ok().add(flag);
    }
    // 拣料转全板
    // sBarcode 原托盘码  tBarcode 转换托盘码
    @RequestMapping("/piking/to/full")
    @ManagerAuth
    @Transactional
    public R pikingToFull(String sBarcode,String tBarcode) {
        //  检查转换托盘码是否在库
        List<LocDetl> locDetls = locDetlService.selectByZpallet(tBarcode);
        if (!Cools.isEmpty(locDetls)) {
            throw new CoolException("需要转换的托盘已被使用,请更换托盘!");
        }
        WrkMast twrkMast = wrkMastService.selectByBarcode(tBarcode);
        if (!Cools.isEmpty(twrkMast)) {
            throw new CoolException("需要转换的托盘已被使用,请更换托盘!");
        }
        LocMast tlocMast = locMastService.selectByBarcode(tBarcode);
        if (!Cools.isEmpty(tlocMast)) {
            throw new CoolException("需要转换的托盘已被使用,请更换托盘!");
        }
        WrkDetl twrkDetl = wrkDetlService.selectByZpallet0(tBarcode);
        if (!Cools.isEmpty(twrkDetl)) {
            throw new CoolException("需要转换的托盘已被使用,请更换托盘!");
        }
//        修改工作档托盘码
        WrkMast wrkMast = wrkMastService.selectByBarcode(sBarcode);
        if (wrkMast.getWrkSts() != 14) {
            throw new CoolException("出库未完成!");
        }
        List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
        for (WrkDetl wrkDetl : wrkDetls) {
            //++++
            wrkDetlService.updateBarcode(sBarcode,tBarcode,wrkDetl.getSupplier());
        }
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException("请确认托盘码!");
        }
//                修改库存明细档托盘码
        List<LocDetl> locDetls1 = locDetlService.selectByZpallet(sBarcode);
        for (LocDetl locDetl : locDetls1) {
            //++++
            locDetlService.updateZpallet(sBarcode,tBarcode,locDetl.getSupplier());
        }
//        修改工作主档条码
        wrkMast.setBarcode(tBarcode);
        wrkMastService.updateById(wrkMast);
        LocMast locMast = locMastService.selectByBarcode(sBarcode);
        locMast.setBarcode(tBarcode);
        locMastService.updateById(locMast);
        return R.ok("转换成功");
    }
}