| | |
| | | private StockItemService stockItemService; |
| | | @Autowired |
| | | private DeviceSiteService deviceSiteService; |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private OrderItemService orderItemService; |
| | | |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | |
| | | @Autowired |
| | | private DeviceBindService deviceBindService; |
| | | @Autowired |
| | | private WarehouseAreasService warehouseAreasService; |
| | | |
| | | @Autowired |
| | | private WarehouseAreasItemService warehouseAreasItemService; |
| | | |
| | | |
| | | /** |
| | |
| | | if (!taskItemService.saveBatch(taskItems)) { |
| | | throw new CoolException("任务明细保存失败!!"); |
| | | } |
| | | waitPakinItems.forEach(item -> { |
| | | if (! waitPakinItemService.update(new LambdaUpdateWrapper<WaitPakinItem>() |
| | | .set(WaitPakinItem::getWorkQty, item.getAnfme()) |
| | | .eq(WaitPakinItem::getId, item.getId()))) { |
| | | throw new CoolException("组托明细修执行数量修改失败!!"); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | if (!waitPakinService.update(new LambdaUpdateWrapper<WaitPakin>() |
| | |
| | | //保存库存明细 |
| | | try { |
| | | saveStockItems(items, pakinItem); |
| | | //移出收货区库存 |
| | | removeReceiptStock(pakinItem); |
| | | } catch (Exception e) { |
| | | throw new CoolException("库存管理保存更新失败!!"); |
| | | } |
| | |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 移除收货区库存 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/30 16:32 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | private void removeReceiptStock(WaitPakinItem pakinItem) { |
| | | WarehouseAreasItem itemServiceOne = warehouseAreasItemService.getOne(new LambdaQueryWrapper<WarehouseAreasItem>() |
| | | .eq(WarehouseAreasItem::getTrackCode, pakinItem.getTrackCode()) |
| | | .eq(WarehouseAreasItem::getSplrBatch, pakinItem.getBatch())); |
| | | if (Objects.isNull(itemServiceOne)) { |
| | | throw new CoolException("数据错误,请查看请货区库存是否存在!!"); |
| | | } |
| | | Double workQty = itemServiceOne.getWorkQty() - pakinItem.getAnfme(); |
| | | Double qty = itemServiceOne.getQty() + pakinItem.getAnfme(); |
| | | itemServiceOne.setWorkQty(workQty).setQty(qty); |
| | | |
| | | if (!waitPakinService.update(new LambdaUpdateWrapper<WaitPakin>() |
| | | .set(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_TASK_DONE.val) |
| | | .eq(WaitPakin::getId, pakinItem.getPakinId()))) { |
| | | throw new CoolException("组拖状态修改失败!!"); |
| | | } |
| | | |
| | | if (qty.compareTo(itemServiceOne.getAnfme()) == 0.00) { |
| | | if (!warehouseAreasItemService.removeById(itemServiceOne.getId())) { |
| | | throw new CoolException("收货区物料删除失败!!"); |
| | | } |
| | | } else { |
| | | if (!warehouseAreasItemService.updateById(itemServiceOne)) { |
| | | throw new CoolException("收货区库完成数量修改失败!!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 更新库位明细 |
| | | * @param |
| | | * @return |