| | |
| | | private CheckDiffService checkDiffService; |
| | | @Autowired |
| | | private CheckDiffItemService checkDiffItemService; |
| | | @Autowired |
| | | private BasContainerService basContainerService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | throw new CoolException("请检查组拖状态是否完成!!"); |
| | | } |
| | | waitPakins.forEach(pakin -> { |
| | | BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>() |
| | | .eq(BasContainer::getCode, pakin.getBarcode())); |
| | | /**获取库位*/ |
| | | String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId()); |
| | | String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), container.getContainerType()); |
| | | if (Cools.isEmpty(targetLoc)) { |
| | | throw new CoolException("该站点对应库区未找到库位"); |
| | | } |
| | |
| | | if (!this.save(task)) { |
| | | throw new CoolException("任务保存失败!!"); |
| | | } |
| | | BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, deviceSite.getSite())); |
| | | if (Objects.isNull(station) || !station.getUseStatus().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | throw new CoolException("站点不存在或站点不处于空库状态!!"); |
| | | } |
| | | station.setUseStatus(LocStsType.LOC_STS_TYPE_R.type); |
| | | |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("站点状态更新失败!!"); |
| | | } |
| | | |
| | | |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getCode, task.getTargLoc()) |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_S.type).set(Loc::getBarcode, pakin.getBarcode()))) { |
| | | throw new CoolException("库位预约失败!!"); |
| | |
| | | if (Objects.isNull(waveItem)) { |
| | | throw new CoolException("波次明细不存在!!"); |
| | | } |
| | | try { |
| | | saveOutStockItem(maps.get(key), null, waveItem, null, loginUserId); |
| | | } catch (Exception e) { |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | | // try { |
| | | // saveOutStockItem(maps.get(key), null, waveItem, null, loginUserId); |
| | | // } catch (Exception e) { |
| | | // throw new CoolException(e.getMessage()); |
| | | // } |
| | | } else if (task.getResource().equals(TaskResouceType.TASK_RESOUCE_ORDER_TYPE.val)) { |
| | | WkOrderItem orderItem = asnOrderItemService.getById(key); |
| | | if (Objects.isNull(orderItem)) { |
| | |
| | | * @description: 出库信息保存至库存明细表 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveOutStockItem(List<TaskItem> taskItems, WkOrderItem orderItem, WaveItem waveItem, WkOrderItem diffItem, Long loginUserId) throws Exception { |
| | | Stock stock = new Stock(); |