| | |
| | | // 生成工作档明细 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getList().forEach(elem -> { |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(), elem.getCsocode(), elem.getIsoseq(),elem.getContainerCode()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(), elem.getCsocode(), elem.getIsoseq(),elem.getContainerCode(),elem.getProddate(),elem.getDeadline()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto detlDto1 = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch(),detlDto.getCsocode(),detlDto.getIsoseq(),detlDto.getContainerCode()); |
| | | assert detlDto1 != null; |
| | |
| | | // 更新目标库位状态 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("O")){ |
| | | log.warn("Flag - 1,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), "S"); |
| | | locMast.setLocSts("S"); // S.入库预约 |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | log.warn("Flag - 2,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), ioType==101?"R":"P"); |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(taskDto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | log.warn("Flag - 3,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), ioType==101?"R":"P"); |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | |
| | | // 更新目标库位状态 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("O")){ |
| | | log.warn("Flag - 4,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), "S"); |
| | | locMast.setLocSts("S"); // S.入库预约 |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(new Date()); |
| | |
| | | } |
| | | // 更新库位状态 D.空板 -> R.出库预约 |
| | | if (locMast.getLocSts().equals("D")){ |
| | | log.warn("Flag - 5,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), "R"); |
| | | locMast.setLocSts("R"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(new Date()); |
| | |
| | | } |
| | | // 修改源库位状态 |
| | | if (sourceLoc.getLocSts().equals("D") || sourceLoc.getLocSts().equals("F")) { |
| | | log.warn("Flag - 6,{}库位状态变更,{} => {}", sourceLoc.getLocNo(), sourceLoc.getLocSts(), "R"); |
| | | sourceLoc.setLocSts("R"); // R.出库预约 |
| | | sourceLoc.setModiUser(userId); |
| | | sourceLoc.setModiTime(now); |
| | |
| | | } |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals("O")) { |
| | | log.warn("Flag - 7,{}库位状态变更,{} => {}", loc.getLocNo(), loc.getLocSts(), "S"); |
| | | loc.setLocSts("S"); // S.入库预约 |
| | | loc.setModiTime(now); |
| | | loc.setModiUser(userId); |
| | |
| | | int count = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | if (count == 0) { |
| | | log.warn("Flag - 8,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), "D"); |
| | | locMast.setLocSts("D"); |
| | | } |
| | | } |
| | | if (locMast.getLocSts().equals("D") || locMast.getLocSts().equals("O")) { |
| | | if (count > 0) { |
| | | log.warn("Flag - 9,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), "F"); |
| | | locMast.setLocSts("F"); |
| | | } |
| | | } |
| | |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消库位转移失败,源库位不存在:" + wrkMast.getSourceLocNo()); |
| | | } |
| | | log.warn("Flag - 9,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), "F"); |
| | | locMast.setLocSts("F"); |
| | | locMast.setModiTime(new Date()); |
| | | locMast.setModiUser(userId); |
| | |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消库位转移失败,目标库位不存在:" + wrkMast.getSourceLocNo()); |
| | | } |
| | | log.warn("Flag - 10,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), "O"); |
| | | locMast.setLocSts("O"); |
| | | locMast.setModiTime(new Date()); |
| | | locMast.setModiUser(userId); |
| | |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消工作档失败,库位不存在:"+ locNo); |
| | | } |
| | | log.warn("Flag - 11,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), locSts); |
| | | locMast.setLocSts(locSts); |
| | | locMast.setModiTime(new Date()); |
| | | locMast.setModiUser(userId); |
| | |
| | | } |
| | | // 修改库位状态 Q.拣料/盘点/并板再入库 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | log.warn("Flag - 12,{}库位状态变更,{} => {}", locMast.getLocNo(), locMast.getLocSts(), "Q"); |
| | | locMast.setLocSts("Q"); |
| | | locMast.setModiTime(new Date()); |
| | | locMast.setModiUser(userId); |