From f004f434a5bc2796815f1e38e9d0b446e7f8d3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Mon, 30 Mar 2026 13:53:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ComponentOutboundControllerService):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E5=87=BA=E5=BA=93=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将库存出库操作、装箱单状态更新和扫描记录保存移到条件判断之前 - 确保在处理ZWM3A20数据之前完成基础出库操作 - 调整代码执行顺序以提高业务逻辑的合理性 - 保持事务性操作的完整性 --- .../ComponentOutboundControllerService.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/ComponentOutboundControllerService.java b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/ComponentOutboundControllerService.java index 8353ca1a..f06e3939 100644 --- a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/ComponentOutboundControllerService.java +++ b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/ComponentOutboundControllerService.java @@ -66,6 +66,18 @@ public class ComponentOutboundControllerService { wmsComponentOutboundItemService.saveBatch(outboundItems); } + if (CollectionUtil.isNotEmpty(inventories)) { + inventoryService.out(inventories); + } + //处理装箱单的货物详情的出库数量 + wmscomponentPackingService.lambdaUpdate() + .set(WmsComponentPacking::getIsCompleted, 2) + .eq(WmsComponentPacking::getId, outbound.getPackingId()) + .update(); + wmsComponentPackingItemService.addOutQty(outbound.getPackingId()); + + outMaterialScanRecordRespository.saveAll(records); + if (Objects.nonNull(zwm3a20DTO)) { OptRecordDTO optRecordDTO = new OptRecordDTO(); optRecordDTO.setOperationType((short)1); @@ -79,18 +91,6 @@ public class ComponentOutboundControllerService { .eq(WmsComponentOutbound::getId, outbound.getId()) .update(); } - - if (CollectionUtil.isNotEmpty(inventories)) { - inventoryService.out(inventories); - } - //处理装箱单的货物详情的出库数量 - wmscomponentPackingService.lambdaUpdate() - .set(WmsComponentPacking::getIsCompleted, 2) - .eq(WmsComponentPacking::getId, outbound.getPackingId()) - .update(); - wmsComponentPackingItemService.addOutQty(outbound.getPackingId()); - - outMaterialScanRecordRespository.saveAll(records); } @Transactional