自动化立体仓库 - WMS系统
#
TQS
2022-11-22 cd3957e56a14ceb9d6c7f04729cf13ef1355a90d
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -48,6 +48,60 @@
    @Autowired
    private PackService packService;
    // 拣料检索托盘信息
    @RequestMapping("/piking/auth")
    @ManagerAuth
    public R pikingAuth(String barcode) {
        WrkMast wrkMast = wrkMastService.selectByBarcode(barcode);
        if (wrkMast.getIoType() != 103){
            throw new CoolException("此托盘码不为拣料出库");
        }
        List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
        return R.ok().add(wrkDetls);
    }
    // 拣料转全板
    @RequestMapping("/piking/to/full")
    @ManagerAuth
    @Transactional
    public R pikingToFull(String barcode) {
        WrkMast wrkMast = wrkMastService.selectByBarcode(barcode);
        if (wrkMast.getIoType() != 103){
            throw new CoolException(barcode + "不为拣料出库");
        }
        if(Cools.isEmpty(wrkMast)){
            throw new CoolException("工作档不能为空");
        }
        Date now = new Date();
        List<LocDetl> locDetls = locDetlService.selectByLocNo(wrkMast.getSourceLocNo());
        wrkMast.setIoType(101);
        wrkMast.setSourceStaNo(wrkMast.getStaNo());
        wrkMast.setStaNo(200);
        wrkMastService.updateById(wrkMast);
        wrkDetlService.deleteByWrkNo(wrkMast.getWrkNo());
        for(LocDetl locDetl : locDetls){
            WrkDetl wrkDetl = new WrkDetl();
            wrkDetl.setWrkNo(wrkMast.getWrkNo());
            wrkDetl.setModiTime(now);
            wrkDetl.sync(locDetl);
            wrkDetlService.insert(wrkDetl);
        }
        LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo());
        if (locMast.getLocSts().equals("P")) {
            locMast.setLocSts("R");
            locMast.setModiTime(now);
            if (!locMastService.updateById(locMast)) {
                throw new CoolException("改变库位状态失败");
            }
        }
        locMastService.updateById(locMast);
        return R.ok("转换成功");
    }
    // 组托 ----------------------------------------------------------------------------------------------------
    /**
@@ -287,6 +341,20 @@
        return R.ok();
    }
    @RequestMapping("/checkDetl/auth2")
    @ManagerAuth
    public R getCheckDetl2(String barcode) {
        WrkMast wrkMast = wrkMastService.selectByBarcode(barcode);
        if(Cools.isEmpty()){
            throw new CoolException("此托盘码没有盘点任务");
        }
        if (wrkMast.getIoType() != 107){
            throw new CoolException("此托盘码不为盘点出库");
        }
        List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
        return R.ok().add(wrkDetls);
    }
    @RequestMapping("/adjust/auth")
    @ManagerAuth(memo = "盘点")
    public R adjust(@RequestBody MobileAdjustParam combParam){
@@ -294,5 +362,12 @@
        return R.ok("盘点成功");
    }
    @RequestMapping("/adjustNew/auth")
    @ManagerAuth(memo = "盘点")
    public R adjustNew(@RequestBody MobileAdjustParam combParam){
        mobileService.adjustNew(combParam, getUserId());
        return R.ok("盘点成功");
    }
}