From 60a9bdab2ee30ed2e49d0609586957eaba0a6414 Mon Sep 17 00:00:00 2001 From: "UNISINSIGHT\\rdpnr_jiangpeng" Date: Wed, 1 Apr 2026 14:06:23 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=AE=A2=E5=8D=95=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7=E5=8F=98=E6=9B=B4bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InventoryDeliveryController.java | 2 +- .../service/IInventoryDeliveryService.java | 2 +- .../impl/ExecutionTrackServiceImpl.java | 1 - .../impl/InventoryDeliveryServiceImpl.java | 21 ++++++++++++------- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/InventoryDeliveryController.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/InventoryDeliveryController.java index d57a6eec..dc796b42 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/InventoryDeliveryController.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/InventoryDeliveryController.java @@ -171,7 +171,7 @@ public class InventoryDeliveryController extends BaseController @ResponseBody public AjaxResult remove(Long id) { - return toAjax(inventoryDeliveryService.deleteInventoryOuterById(id, true)); + return toAjax(inventoryDeliveryService.deleteInventoryOuterById(id, true, null)); } @Log(title = "发货记录", businessType = BusinessType.DELETE) @PostMapping( "/recall") diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IInventoryDeliveryService.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IInventoryDeliveryService.java index 194bcf8b..2881b399 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IInventoryDeliveryService.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IInventoryDeliveryService.java @@ -64,7 +64,7 @@ public interface IInventoryDeliveryService void statusUpdate(InventoryDelivery inventoryDelivery); - int deleteInventoryOuterById(Long id, boolean realDeleted); + int deleteInventoryOuterById(Long id, boolean realDeleted, String orderCode); List getNumberInfo(ApiDataQueryDto dto); diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ExecutionTrackServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ExecutionTrackServiceImpl.java index 14b17a26..5739f72c 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ExecutionTrackServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ExecutionTrackServiceImpl.java @@ -287,7 +287,6 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService { //累计发货 List inventoryDeliveries = deliveryMapper.selectQuantityByOrderCodeStatus(projectOrderInfo.getOrderCode(), InventoryDelivery.DeliveryStatusEnum.CONFIRM_DELIVERY.getCode()); if (CollUtil.isNotEmpty(inventoryDeliveries)) { -// deliveryMapper.deleteInventoryDeliveryByIds(inventoryOuters.stream().map(item -> item.getId().toString()).toArray(String[]::new)); for (InventoryDelivery inventoryDeliverie : inventoryDeliveries) { InventoryDelivery updateDelivery = new InventoryDelivery(); updateDelivery.setId(inventoryDeliverie.getId()); diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java index bd84d974..358a7cfb 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java @@ -320,7 +320,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService { } @Override - public int deleteInventoryOuterById(Long id, boolean realDelete) { + public int deleteInventoryOuterById(Long id, boolean realDelete, String orderCode) { InventoryDelivery inventoryDelivery = inventoryDeliveryMapper.selectInventoryDeliveryById(id); //还原库存信息 InventoryInfo inventoryInfo = new InventoryInfo(); @@ -336,11 +336,18 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService { return inventoryDeliveryMapper.deleteInventoryDeliveryById(id); } else { // 2026-03-19:新逻辑,仅修改发货单状态为撤回,不删除库存表 - inventoryDelivery = new InventoryDelivery(); - inventoryDelivery.setId(id); - inventoryDelivery.setDeliveryStatus(InventoryDelivery.DeliveryStatusEnum.RECALL_DELIVERY.getCode()); - inventoryDelivery.setUpdateTime(DateUtils.getNowDate()); - return inventoryDeliveryMapper.updateInventoryDelivery(inventoryDelivery); + int rows = 0; + List inventoryDeliveries = inventoryDeliveryMapper.selectQuantityByOrderCodeStatus(orderCode, InventoryDelivery.DeliveryStatusEnum.CONFIRM_DELIVERY.getCode()); + if (CollUtil.isNotEmpty(inventoryDeliveries)) { + for (InventoryDelivery inventoryDeliverie : inventoryDeliveries) { + InventoryDelivery updateDelivery = new InventoryDelivery(); + updateDelivery.setId(inventoryDeliverie.getId()); + updateDelivery.setDeliveryStatus(InventoryDelivery.DeliveryStatusEnum.RECALL_DELIVERY.getCode()); + updateDelivery.setUpdateTime(DateUtils.getNowDate()); + rows += inventoryDeliveryMapper.updateInventoryDelivery(updateDelivery); + } + } + return rows; } } @@ -381,7 +388,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService { InventoryDelivery inventoryDelivery = inventoryDeliveryMapper.selectInventoryDeliveryById(id); ProjectOrderInfo projectOrderInfo = projectOrderInfoService.selectProjectOrderInfoByOrderCode(inventoryDelivery.getOrderCode()); - deleteInventoryOuterById(id, false); + deleteInventoryOuterById(id, false, projectOrderInfo.getOrderCode()); List projectProductInfos = projectProductInfoService.listDeliveryProductByOrderCode(Collections.singletonList(inventoryDelivery.getOrderCode())); //软硬件之和 long sum = projectProductInfos.stream().mapToLong(ProjectProductInfo::getQuantity).sum();