| | |
| | | private WaitPakinService waitPakinService; |
| | | |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | | // 9.入库完成 |
| | | // 14.入库完成 |
| | | if (wrkMast.getWrkSts() == 9) { |
| | | return doIn(wrkMast); |
| | | // 17.出库完成 |
| | | } else if (wrkMast.getWrkSts() == 17) { |
| | | // 34.出库完成 |
| | | } else if (wrkMast.getWrkSts() == 29) { |
| | | return doOut(wrkMast); |
| | | } |
| | | return SUCCESS; |
| | |
| | | } |
| | | // 遍历工作明细,更新库存明细和入库通知档 |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), wrkMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) { |
| | | exceptionHandle("全板入库 ===>> 更新库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | } else { |
| | | locDetl = new LocDetl(); |
| | | LocDetl locDetl = new LocDetl(); |
| | | locDetl.sync(wrkDetl); |
| | | locDetl.setLocNo(wrkMast.getLocNo()); // 库位号 |
| | | locDetl.setAnfme(wrkDetl.getAnfme()); // 数量 |
| | |
| | | if (!locDetlService.insert(locDetl)) { |
| | | exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 更新入库通知档 ioStatus ===>> Y |
| | | try { |
| | |
| | | } |
| | | for (WrkDetl wrkDetl : wrkDetls53) { |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getSuppCode()); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) { |
| | | exceptionHandle("拣料入库 ===>> 修改库存明细数量失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | |
| | | // 修改库存明细数量,如无库存,曾新增 |
| | | for (WrkDetl wrkDetl:wrkDetls54) { |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getSuppCode()); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) { |
| | | exceptionHandle("并板入库 ===>> 修改库存明细数量失败;[workNo={0}],[matnr={1}]", wrkMast.getWrkNo(), wrkDetl.getMatnr()); |
| | |
| | | break; |
| | | } |
| | | // 修改工作主档状态 |
| | | wrkMast.setWrkSts(10L); |
| | | wrkMast.setWrkSts(10L);//15.库存更新完成 |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | exceptionHandle("更新入库完成状态失败;[workNo={0}]", wrkMast.getWrkNo()); |
| | |
| | | // 全板出库 |
| | | case 101: |
| | | // 出库确认信号位 |
| | | if (Cools.isEmpty(wrkMast.getInvWh()) || wrkMast.getInvWh().equals("N")) { |
| | | return SUCCESS; |
| | | } |
| | | // if (Cools.isEmpty(wrkMast.getInvWh()) || wrkMast.getInvWh().equals("N")) { |
| | | // return SUCCESS; |
| | | // } |
| | | // 根据工作号,查询工作明细档 |
| | | List<WrkDetl> wrkDetls101 = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if (wrkDetls101.isEmpty()) { |
| | |
| | | break; |
| | | } |
| | | // 修改工作主档状态 |
| | | wrkMast.setWrkSts(18L); |
| | | wrkMast.setWrkSts(30L);//35.库存更新完成 |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | exceptionHandle("更新出库完成状态失败;[workNo={0}]", wrkMast.getWrkNo()); |