refactor(ComponentOutboundControllerService): 优化出库流程逻辑

- 将库存出库操作、装箱单状态更新和扫描记录保存移到条件判断之前
- 确保在处理ZWM3A20数据之前完成基础出库操作
- 调整代码执行顺序以提高业务逻辑的合理性
- 保持事务性操作的完整性
This commit is contained in:
曹鹏飞 2026-03-30 13:53:27 +08:00
parent 7d4e857eea
commit f004f434a5
1 changed files with 12 additions and 12 deletions

View File

@ -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