| | |
| | | @Resource |
| | | private OrderPakoutService orderPakOutService; |
| | | |
| | | @Autowired |
| | | private InventoryCheckOrderService checkOrderService; |
| | | |
| | | @Autowired |
| | | private InventoryCheckOrderDetlService checkOrderDetlService; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public String startupFullPutStore(FullStoreParam param, Long userId) { |
| | |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D")) { |
| | | // 启动出库开始 101.出库 |
| | | stockOut(staNo, locDetlDtos, null, userId); |
| | | stockOut(staNo, locDetlDtos, null, userId, null); |
| | | } else { |
| | | throw new CoolException("所选库位存在状态不为F、D的库位,库位号:" + locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, IoWorkType ioWorkType, Long userId) { |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, IoWorkType ioWorkType, Long userId, String checkOrderNo) { |
| | | Date now = new Date(); |
| | | // 合并同类项 |
| | | Set<String> locNos = new HashSet<>(); |
| | |
| | | ioType = dto.isAll() ? 101 : 103; |
| | | } else if (ioWorkType.equals(IoWorkType.CHECK_OUT)) { |
| | | ioType = 107; |
| | | if (Cools.isEmpty(checkOrderNo)) { |
| | | checkOrderNo = DateUtils.createTimeStamp(); |
| | | InventoryCheckOrder checkOrder = new InventoryCheckOrder(); |
| | | checkOrder.setCreateBy(userId); |
| | | checkOrder.setStatus("1"); |
| | | checkOrder.setCreateTime(new Date()); |
| | | checkOrder.setOrderNo(checkOrderNo); |
| | | checkOrderService.insert(checkOrder); |
| | | } |
| | | } |
| | | assert ioType != null; |
| | | // 获取库位 |
| | |
| | | wrkDetl.setModiUser(userId); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | if (ioType == 107) { |
| | | InventoryCheckOrderDetl checkOrderDetl = new InventoryCheckOrderDetl(); |
| | | checkOrderDetl.setOrderNo(checkOrderNo); |
| | | checkOrderDetl.setMatnr(detlDto.getLocDetl().getMatnr()); |
| | | checkOrderDetl.setMaktx(detlDto.getLocDetl().getMaktx()); |
| | | checkOrderDetl.setBatch(detlDto.getLocDetl().getBatch()); |
| | | checkOrderDetl.setLocNo(detlDto.getLocDetl().getLocNo()); |
| | | checkOrderDetl.setAnfme(detlDto.getLocDetl().getAnfme()); |
| | | checkOrderDetl.setStatus("0"); |
| | | checkOrderDetlService.insert(checkOrderDetl); |
| | | } |
| | | } |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | // 启动出库开始 107.盘点出库 |
| | | stockOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId); |
| | | stockOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId, param.getCheckId()); |
| | | } else { |
| | | throw new CoolException("所选库位存在状态不为F的库位,库位号:" + locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | } |
| | |
| | | //// stockOutRe(wrkMast, wrkDetls); |
| | | // } |
| | | // } |
| | | |
| | | if (wrkMast.getIoType() == 107) { |
| | | checkOrderDetlService.delete(new EntityWrapper<InventoryCheckOrderDetl>().eq("loc_no", locNo)); |
| | | } |
| | | // 取消操作人员记录 |
| | | wrkMast.setManuType("手动取消"); |
| | | wrkMast.setModiUser(userId); |