| | |
| | | // 修改库存明细数量,如果工作明细数量为0时,删除库存明细 |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()).eq("matnr", wrkDetl.getMatnr())); |
| | | if (null != locDetl) { |
| | | if (wrkDetl.getAnfme() == 0) { |
| | | if (!locDetlService.delete(new EntityWrapper<>(locDetl))) { |
| | | exceptionHandle(""); // todo |
| | | } |
| | | } else { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr())) { |
| | | exceptionHandle(""); // todo |
| | | } |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr())) { |
| | | exceptionHandle(""); // todo |
| | | } |
| | | // todo:luxiaotao 3)修改出库通知档 status ==> Y |
| | | } |
| | | } |
| | | // 修改库位状态 S ====>> F |
| | | // 修改库位状态 Q ====>> F |
| | | if (locMast.getLocType().equals("Q")) { |
| | | locMast.setLocType("F"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | |
| | | } |
| | | } |
| | | break; |
| | | // 并板入库 |
| | | case 54: |
| | | // 根据工作号,查询工作明细档 |
| | | List<WrkDetl> wrkDetls54 = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if (wrkDetls54.isEmpty()) { |
| | | exceptionHandle(""); // todo |
| | | } |
| | | // 修改库存明细数量,如无库存,曾新增 |
| | | for (WrkDetl wrkDetl:wrkDetls54) { |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()).eq("matnr", wrkDetl.getMatnr())); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr())) { |
| | | exceptionHandle(""); // todo |
| | | } |
| | | } else { |
| | | locDetl = new LocDetl( |
| | | wrkMast.getLocNo(), // 库位号 |
| | | wrkDetl.getMatnr(), // 物料号 |
| | | null, // 仓库号 |
| | | null, // 转储请求编号 |
| | | null, // 行项目 |
| | | null, // 物料标签ID |
| | | wrkDetl.getMaktx(), // 物料描述 |
| | | null, // 工厂 |
| | | wrkDetl.getAnfme(), // 数量 |
| | | wrkDetl.getAltme(), // 单位 |
| | | wrkDetl.getZpallet(), // 托盘条码 |
| | | null, // 用户ID |
| | | null, // 备注 |
| | | null, // 修改人员 |
| | | now, // 修改时间 |
| | | null, // 创建者 |
| | | now // 添加时间 |
| | | ); |
| | | if (!locDetlService.insert(locDetl)) { |
| | | exceptionHandle(""); // todo |
| | | } |
| | | } |
| | | // todo:luxiaotao 3)修改出库通知档 status ==> Y |
| | | } |
| | | // 修改库位状态 Q ====>> F |
| | | if (locMast.getLocType().equals("Q")) { |
| | | locMast.setLocType("F"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | exceptionHandle(""); // todo |
| | | } |
| | | } |
| | | break; |
| | | case 57: |
| | | break; |