From 11e7ea2839eebe94d3f666d33429b13967feb164 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 24 六月 2026 13:26:16 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_New_pro
---
src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java | 14 ++++++++++++++
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml | 2 +-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java
index 103a4f2..be34bc0 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java
@@ -172,6 +172,17 @@
@Override
public boolean addReq(ShippingInfoDto req) {
+ // 鏍¢獙璇ヤ骇鍝佹槸鍚﹀凡鏈夊緟瀹℃牳/瀹℃牳涓殑鍙戣揣璁板綍锛岄槻姝㈤噸澶嶆彁浜�
+ Long salesLedgerProductId = req.getSalesLedgerProductId();
+ if (salesLedgerProductId != null) {
+ long pendingCount = this.count(new LambdaQueryWrapper<ShippingInfo>()
+ .eq(ShippingInfo::getSalesLedgerProductId, salesLedgerProductId)
+ .in(ShippingInfo::getStatus, "寰呭鏍�", "瀹℃牳涓�"));
+ if (pendingCount > 0) {
+ throw new RuntimeException("璇ヤ骇鍝佸凡鏈夊緟瀹℃牳鐨勫彂璐ц褰曪紝璇峰嬁閲嶅鎻愪氦");
+ }
+ }
+
LoginUser loginUser = SecurityUtils.getLoginUser();
String sh = OrderUtils.countTodayByCreateTime(shippingInfoMapper, "SH","shipping_no",req.getCreateTime());
// 鍏堜繚瀛樺彂璐у崟锛屽啀鍙戣捣瀹℃壒锛涙棤瀹℃牳浜鸿嚜鍔ㄩ�氳繃鏃堕渶瑕佹寜鍙戣揣缂栧彿鍥炲啓鍙戣揣鐘舵�併��
@@ -200,6 +211,9 @@
approvalInstance.setApplicantName(loginUser.getNickName());
approvalInstance.setApplyTime(LocalDateTime.now());
approvalInstanceService.add(approvalInstance);
+ // 鍒涘缓瀹℃壒瀹炰緥鍚庯紝鏇存柊鍙戣揣鐘舵�佷负"瀹℃牳涓�"锛屼娇鍓嶇姝g‘鏄剧ず瀹℃壒鐘舵��
+ req.setStatus("瀹℃牳涓�");
+ this.updateById(req);
return true;
}
}
diff --git a/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml b/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
index 2ae23b1..ec5cca2 100644
--- a/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
+++ b/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -33,7 +33,7 @@
WHEN (IFNULL(t2.qualitity, 0) - IFNULL(t2.locked_quantity, 0)) >0 THEN 1
ELSE 0
END as has_sufficient_stock,
- (IFNULL(T1.quantity, 0) - IFNULL(t3.shipped_quantity, 0)) as no_quantity,
+ (IFNULL(T1.quantity, 0) - IFNULL(t3.shipped_quantity, 0) - IFNULL(t5.pending_approval_quantity, 0)) as no_quantity,
IFNULL(t5.pending_approval_quantity, 0) as pending_approval_quantity,
CASE
WHEN IFNULL(t3.shipped_quantity, 0) = 0 AND IFNULL(t5.pending_approval_quantity, 0) = 0 THEN '寰呭彂璐�'
--
Gitblit v1.9.3