From 2e84a447af471fe5ada907c28849838a6bc3a340 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 13 七月 2026 17:58:41 +0800
Subject: [PATCH] 1.仓储物流-转移产品模块
---
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/productsales/MesWmProductSalesServiceImpl.java | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/productsales/MesWmProductSalesServiceImpl.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/productsales/MesWmProductSalesServiceImpl.java
index baec481..7309606 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/productsales/MesWmProductSalesServiceImpl.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/productsales/MesWmProductSalesServiceImpl.java
@@ -251,9 +251,9 @@
productSalesMapper.updateById(new MesWmProductSalesDO()
.setId(id).setStatus(MesWmProductSalesStatusEnum.FINISHED.getStatus()));
- // 5. 鏇存柊鍏宠仈鐨勫彂璐ч�氱煡鍗曠姸鎬�
+ // 5. 鏇存柊鍏宠仈鐨勫彂璐ч�氱煡鍗曞嚭搴撴暟閲忓拰鐘舵��
if (sales.getNoticeId() != null) {
- salesNoticeService.finishSalesNotice(sales.getNoticeId());
+ updateSalesNoticeOutCount(sales);
}
// 6. 鍥炲啓 ERP 閿�鍞鍗曠殑鍑哄簱鏁伴噺鍜岀姸鎬�
@@ -261,6 +261,23 @@
}
/**
+ * 鏇存柊鍙戣揣閫氱煡鍗曠殑鍑哄簱鏁伴噺鍜岀姸鎬�
+ */
+ private void updateSalesNoticeOutCount(MesWmProductSalesDO sales) {
+ // 鑾峰彇鍑哄簱鍗曡
+ List<MesWmProductSalesLineDO> lines = productSalesLineService.getProductSalesLineListBySalesId(sales.getId());
+ if (CollUtil.isEmpty(lines)) {
+ return;
+ }
+ // 閬嶅巻琛岋紝鎸� noticeLineId 鏇存柊鍑哄簱鏁伴噺
+ for (MesWmProductSalesLineDO line : lines) {
+ if (line.getNoticeLineId() != null && line.getQuantity() != null) {
+ salesNoticeService.updateSalesNoticeLineOutCount(line.getNoticeLineId(), line.getQuantity());
+ }
+ }
+ }
+
+ /**
* 鍥炲啓 ERP 閿�鍞鍗曠殑鍑哄簱鏁伴噺鍜岀姸鎬�
*/
private void updateErpSaleOrderOutCount(MesWmProductSalesDO sales) {
--
Gitblit v1.9.3