| | |
| | | throw new CoolException("保存工作明细档历史档失败"); |
| | | } |
| | | // 删除工作明细档 |
| | | if (!wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()))) { |
| | | throw new CoolException("删除工作明细档档历史档失败"); |
| | | } |
| | | // if (!wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()))) { |
| | | // throw new CoolException("删除工作明细档档历史档失败"); |
| | | // } |
| | | // 保存工作主档历史档 |
| | | if (!wrkMastLogService.save(wrkMast.getWrkNo())) { |
| | | throw new CoolException("保存工作主档历史档失败"); |
| | |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("更新工作档数据状态失败"); |
| | | } |
| | | // 更新/删除拣料库存明细 |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locNo).eq("matnr", wrkDetl.getMatnr())); |
| | | // 库存数量计算 |
| | | locDetl.setAnfme(locDetl.getAnfme() - wrkDetl.getAnfme()); |
| | | if (locDetl.getAnfme() > 0) { |
| | | locDetl.setModiTime(new Date()); |
| | | locDetl.setModiUser(userId); |
| | | if (!locDetlService.updateById(locDetl)) { |
| | | throw new CoolException("更新库存明细失败"); |
| | | } |
| | | } else { |
| | | if (!locDetlService.delete(new EntityWrapper<>(locDetl))) { |
| | | throw new CoolException("删除库存明细失败"); |
| | | } |
| | | } |
| | | } |
| | | // // 更新/删除拣料库存明细 |
| | | // for (WrkDetl wrkDetl : wrkDetls) { |
| | | // LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locNo).eq("matnr", wrkDetl.getMatnr())); |
| | | // // 库存数量计算 |
| | | // locDetl.setAnfme(locDetl.getAnfme() - wrkDetl.getAnfme()); |
| | | // if (locDetl.getAnfme() > 0) { |
| | | // locDetl.setModiTime(new Date()); |
| | | // locDetl.setModiUser(userId); |
| | | // if (!locDetlService.updateById(locDetl)) { |
| | | // throw new CoolException("更新库存明细失败"); |
| | | // } |
| | | // } else { |
| | | // if (!locDetlService.delete(new EntityWrapper<>(locDetl))) { |
| | | // throw new CoolException("删除库存明细失败"); |
| | | // } |
| | | // } |
| | | // } |
| | | // 修改库位状态 Q.拣料/盘点/并板再入库 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | locMast.setLocType("Q"); |