| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | // 空板入库 |
| | | case 10: |
| | | // 修改库位状态=D |
| | | if (locMast.getLocType().equals("S") || locMast.getLocType().equals("Q")) { |
| | | locMast.setLocType("D"); |
| | | if (locMast.getLocSts().equals("S") || locMast.getLocSts().equals("Q")) { |
| | | locMast.setLocSts("D"); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | |
| | | exceptionHandle("全板入库 ===>> 更新库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | } 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 // 添加时间 |
| | | ); |
| | | locDetl = new LocDetl(); |
| | | locDetl.setLocNo(wrkMast.getLocNo()); // 库位号 |
| | | VersionUtils.setLocDetl(locDetl, wrkDetl); // 版本控制 |
| | | locDetl.setModiTime(now); |
| | | locDetl.setAppeTime(now); |
| | | if (!locDetlService.insert(locDetl)) { |
| | | exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | |
| | | , new EntityWrapper<WaitPakin>().eq("barcode", wrkDetl.getZpallet()) |
| | | .eq("matnr", wrkDetl.getMatnr()) |
| | | .eq("anfme", wrkDetl.getAnfme())); |
| | | if (!updateRes) { |
| | | if (!updateRes && updateRes) { |
| | | exceptionHandle("全板入库 ===>> 更新入库通知档失败;[workNo={0}]", wrkMast.getWrkNo()); |
| | | } |
| | | } |
| | | // 修改库位状态 S ====>> F |
| | | if (locMast.getLocType().equals("S")) { |
| | | locMast.setLocType("F"); |
| | | if (locMast.getLocSts().equals("S")) { |
| | | locMast.setLocSts("F"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | |
| | | // 修改库存明细数量,如果工作明细数量为0时,删除库存明细 |
| | | 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())) { |
| | | if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr())) { |
| | | exceptionHandle("拣料入库 ===>> 修改库存明细数量失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | // todo:luxiaotao 3)修改出库通知档 status ==> Y |
| | | } |
| | | } |
| | | // 修改库位状态 Q ====>> F |
| | | if (locMast.getLocType().equals("Q")) { |
| | | locMast.setLocType("F"); |
| | | if (locMast.getLocSts().equals("Q")) { |
| | | locMast.setLocSts("F"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | |
| | | exceptionHandle("并板入库 ===>> 修改库存明细数量失败;[workNo={0}],[matnr={1}]", wrkMast.getWrkNo(), wrkDetl.getMatnr()); |
| | | } |
| | | } 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 // 添加时间 |
| | | ); |
| | | locDetl = new LocDetl(); |
| | | locDetl.setLocNo(wrkMast.getLocNo()); // 库位号 |
| | | VersionUtils.setLocDetl(locDetl, wrkDetl); // 版本控制 |
| | | locDetl.setModiTime(now); |
| | | locDetl.setAppeTime(now); |
| | | if (!locDetlService.insert(locDetl)) { |
| | | exceptionHandle("并板入库 ===>> 新增库存明细失败;[workNo={0}],[matnr={1}]", wrkMast.getWrkNo(), wrkDetl.getMatnr()); |
| | | } |
| | |
| | | // todo:luxiaotao 3)修改出库通知档 status ==> Y |
| | | } |
| | | // 修改库位状态 Q ====>> F |
| | | if (locMast.getLocType().equals("Q")) { |
| | | locMast.setLocType("F"); |
| | | if (locMast.getLocSts().equals("Q")) { |
| | | locMast.setLocSts("F"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | |
| | | } |
| | | // todo:luxiaotao 3)修改盘点通知档 status ==> Y |
| | | // 修改库位状态 Q ====>> F |
| | | if (locMast.getLocType().equals("Q")) { |
| | | locMast.setLocType("F"); |
| | | if (locMast.getLocSts().equals("Q")) { |
| | | locMast.setLocSts("F"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | |
| | | // 库位移转 |
| | | case 11: |
| | | // 默认目标库位是空板 |
| | | String locType = "D"; |
| | | String locSts = "D"; |
| | | // 库位移转判断是否为空板移转 |
| | | if (wrkMast.getEmptyMk().equals("N")) { |
| | | locType = "F"; |
| | | locSts = "F"; |
| | | // 转移库存明细数据: 库存号 由工作档源库位变为目标库位 |
| | | if (!locDetlService.updateLocNo(wrkMast.getLocNo(), wrkMast.getSourceLocNo())) { |
| | | exceptionHandle("库位移转 ===>> 转移库存明细数据失败;[源库位={0}],[目标库位={1}]", wrkMast.getSourceLocNo(), wrkMast.getLocNo()); |
| | |
| | | LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (null != sourceLoc) { |
| | | sourceLoc.setBarcode(""); |
| | | sourceLoc.setLocType("O"); |
| | | sourceLoc.setLocSts("O"); |
| | | sourceLoc.setModiTime(now); |
| | | sourceLoc.setIoTime(now); |
| | | if (!locMastService.updateById(sourceLoc)) { |
| | | exceptionHandle("库位移转 ===>> 修改源库位状态失败;[workNo={0}],[sourceLoc={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | | } |
| | | } |
| | | // 修改目标库位状态 ==> .locType |
| | | locMast.setLocType(locType); |
| | | // 修改目标库位状态 ==> .locSts |
| | | locMast.setLocSts(locSts); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | |
| | | exceptionHandle("全板出库 ===>> 删除库存明细失败;[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | | } |
| | | // 修改源库位状态 R ===>> O |
| | | if (locMast.getLocType().equals("R")) { |
| | | locMast.setLocType("O"); |
| | | if (locMast.getLocSts().equals("R")) { |
| | | locMast.setLocSts("O"); |
| | | locMast.setBarcode(""); |
| | | locMast.setModiTime(now); |
| | | locMast.setIoTime(now); |
| | |
| | | // 空板出库 |
| | | case 110: |
| | | // 修改库位状态 R ===>> O |
| | | if (locMast.getLocType().equals("R")) { |
| | | locMast.setLocType("O"); |
| | | if (locMast.getLocSts().equals("R")) { |
| | | locMast.setLocSts("O"); |
| | | locMast.setBarcode(""); |
| | | locMast.setModiTime(now); |
| | | locMast.setIoTime(now); |