| | |
| | | private WaitMatchkService waitMatchkService; |
| | | @Autowired |
| | | private MatCodeService matCodeService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | 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); |
| | | } |
| | | /** |
| | | * 根据库位号查找库存明细 |
| | | */ |
| | |
| | | } |
| | | 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("转换成功"); |
| | | } |
| | | } |