| | |
| | | inventoryCheckOrderDetl.setMaktx(detlDto.getLocDetl().getMaktx()); |
| | | inventoryCheckOrderDetl.setBatch(detlDto.getLocDetl().getBatch()); |
| | | inventoryCheckOrderDetl.setLocNo(detlDto.getLocDetl().getLocNo()); |
| | | inventoryCheckOrderDetl.setArea(wrkMast.getCrnNo$()); |
| | | inventoryCheckOrderDetl.setArea(detlDto.getLocDetl().getOrigin()); |
| | | inventoryCheckOrderDetl.setAnfme(detlDto.getLocDetl().getAnfme()); |
| | | inventoryCheckOrderDetl.setIoTime(now); |
| | | inventoryCheckOrderDetl.setStatus("1"); |
| | |
| | | locMastService.updateById(locMast); |
| | | } |
| | | // 出库取消(修改源库位) |
| | | } else if (wrkMast.getIoType() >=100) { |
| | | } else if (wrkMast.getIoType() >=100 && wrkMast.getIoType()<=200) { |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | // 出库 ===>> F.在库 |
| | | if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) { |
| | |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | } else if (wrkMast.getIoType() >=300) { |
| | | |
| | | } else { |
| | | throw new CoolException("当前工作状态无法取消"); |
| | | } |
| | |
| | | } |
| | | |
| | | //取消出库工作档时,查询单据管理表,回滚作业中数量 |
| | | if(wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103) { |
| | | if(wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103 || wrkMast.getIoType() == 300) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | if (!Cools.isEmpty(wrkDetl.getOrderNo())) { |
| | |
| | | boolean wrkDetlRes = wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("wrk_no", workNo)); |
| | | } |
| | | |
| | | // 修改库位状态 |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消工作档失败,库位不存在:"+ locNo); |
| | | if (wrkMast.getIoType() != 300){ |
| | | // 修改库位状态 |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消工作档失败,库位不存在:"+ locNo); |
| | | } |
| | | locMast.setLocSts(locSts); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | boolean locMastRes = locMastService.updateById(locMast); |
| | | if (!wrkMastRes || !locMastRes) { |
| | | throw new CoolException("保存数据失败"); |
| | | } |
| | | }else { |
| | | if (!wrkMastRes) { |
| | | throw new CoolException("保存数据失败"); |
| | | } |
| | | } |
| | | locMast.setLocSts(locSts); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | boolean locMastRes = locMastService.updateById(locMast); |
| | | if (!wrkMastRes || !locMastRes) { |
| | | throw new CoolException("保存数据失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |