| | |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(ioType); // 入出库状态 |
| | | wrkMast.setIoPri(13D); // 优先级:13 |
| | | wrkMast.setIoPri(staDesc.getStnNo() == 1064 || staDesc.getStnNo() == 1031 ? 14D: 13D); // 空桶出库到二号罐装线,去打包,优先级提高 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站 |
| | | wrkMast.setStaNo(staDesc.getStnNo()); // 目标站 |
| | |
| | | throw new CoolException(locDetl.getLocNo() + "," + locDetl.getMatnr() + "," + locDetl.getBatch() + "库存明细已被冻结!"); |
| | | } |
| | | |
| | | if (!loc.getLocSts().equals("O") || (!sourceLoc.getLocSts().equals("F") && !sourceLoc.getLocSts().equals("D"))){ |
| | | if (!loc.getLocSts().equals("O") || (!sourceLoc.getLocSts().equals("F") && !sourceLoc.getLocSts().equals("M") && !sourceLoc.getLocSts().equals("Z"))){ |
| | | throw new CoolException("库位状态已改变"); |
| | | } |
| | | if (!sourceLoc.getCrnNo().equals(loc.getCrnNo())) { |
| | |
| | | wrkMast.setFullPlt(Cools.isEmpty(locDetls)?"N":"Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D")?"Y":"N"); // 空板 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("M") ? "M" : sourceLoc.getLocSts().equals("Z") ? "Z" : "N"); // 空板 |
| | | wrkMast.setBarcode(sourceLoc.getBarcode()); // 托盘码 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setAppeUser(userId); |
| | |
| | | } |
| | | } |
| | | // 修改源库位状态 |
| | | if (sourceLoc.getLocSts().equals("D") || sourceLoc.getLocSts().equals("F")) { |
| | | if (sourceLoc.getLocSts().equals("F") || sourceLoc.getLocSts().equals("M") || sourceLoc.getLocSts().equals("Z")) { |
| | | sourceLoc.setLocSts("R"); // R.出库预约 |
| | | sourceLoc.setModiUser(userId); |
| | | sourceLoc.setModiTime(now); |
| | |
| | | if (wrkMast.getStaNo() == 1090 && wrkMast.getLocNo() == null) { |
| | | throw new CoolException(workNo+"工作档无法完成,库位号为空!"); |
| | | } |
| | | if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 14) { |
| | | if (wrkMast.getWrkSts() == 4L || wrkMast.getWrkSts() == 14L || wrkMast.getWrkSts() == 54L) { |
| | | throw new CoolException("当前工作档已完成"); |
| | | } |
| | | // 完成空桶库入出库任务另一个任务 |
| | |
| | | } else if(wrkMast.getIoType() == 1 && wrkMast.getWrkSts() == 10) { |
| | | wrkMast.setWrkSts(2L); |
| | | wrkMast.setRgvFinishTime(new Date()); |
| | | } else if(wrkMast.getIoType() == 120) { |
| | | wrkMast.setWrkSts(54L); |
| | | wrkMast.setRgvFinishTime(new Date()); |
| | | } |
| | | Date now = new Date(); |
| | | wrkMast.setCrnStrTime(DateUtils.calculate(now, 1L, TimeUnit.SECONDS, true)); |
| | |
| | | } |
| | | if(workNoOther != 0) { |
| | | WrkMast wrkMast1 = wrkMastService.selectById(workNoOther); |
| | | wrkMast1.setWrkSts(wrkMast.getWrkSts()); |
| | | wrkMast1.setCrnStrTime(wrkMast.getCrnStrTime()); |
| | | wrkMast1.setCrnEndTime(now); |
| | | wrkMast1.setModiTime(now); |
| | | wrkMast1.setModiUser(userId); |
| | | wrkMast1.setManuType("手动完成"); |
| | | wrkMastService.updateById(wrkMast1); |
| | | if (wrkMast1 != null) { |
| | | wrkMast1.setWrkSts(wrkMast.getWrkSts()); |
| | | wrkMast1.setCrnStrTime(wrkMast.getCrnStrTime()); |
| | | wrkMast1.setCrnEndTime(now); |
| | | wrkMast1.setModiTime(now); |
| | | wrkMast1.setModiUser(userId); |
| | | wrkMast1.setManuType("手动完成"); |
| | | wrkMastService.updateById(wrkMast1); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | String locNo = ""; // 待修改目标库位 |
| | | String locSts = ""; // 待修改目标库位状态 |
| | | // 入库取消(修改目标库位) |
| | | if (wrkMast.getWrkSts() <= 10) { |
| | | if (wrkMast.getWrkSts() <= 10 && wrkMast.getIoType()!=120) { |
| | | locNo = wrkMast.getLocNo(); |
| | | locSts = "O"; |
| | | |
| | |
| | | locMastService.updateById(locMast); |
| | | } |
| | | // 出库取消(修改源库位) |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) { |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14 && wrkMast.getIoType()!=120) { |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | if (wrkMast.getIoType() == 110) { |
| | | if(wrkMast.getStaNo() == 1035) { // 子拆盘机站点 |
| | |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | } else if (wrkMast.getIoType()==120){ |
| | | // 取消操作人员记录 |
| | | wrkMast.setWrkSts(54L); |
| | | wrkMast.setManuType("手动取消"); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("取消工作档失败"); |
| | | } |
| | | return; |
| | | } else { |
| | | throw new CoolException("当前工作状态无法取消"); |
| | | } |