From 67fda7b2dfbfc9e6a8d8b9472499a67906d2bad1 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期六, 09 五月 2026 18:05:22 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_浪潮_pro' into dev_浪潮_pro

---
 src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java
index 8c885cd..3bc5aa5 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java
@@ -101,12 +101,13 @@
             throw new BaseException("鍚堝苟澶辫触锛屾墍閫夌敓浜ц鍒掔殑浜у搧鍨嬪彿涓嶄竴鑷�");
         }
 
-        // 宸蹭笅鍙戞垨閮ㄥ垎涓嬪彂鐨勮鍒掍笉鍏佽鍐嶆鍚堝苟
-        boolean hasIssuedPlan = planLists.stream()
+        // 浠呪�滃凡涓嬪彂鈥濊鍒掍笉鍏佽鍐嶆鍙備笌鍚堝苟涓嬪彂锛�
+        // 鈥滃緟涓嬪彂/閮ㄥ垎涓嬪彂鈥濆厑璁哥户缁笅鍙戝墿浣欐暟閲忋��
+        boolean hasFullyIssuedPlan = planLists.stream()
                 .anyMatch(item -> item.getStatus() != null
-                        && (item.getStatus() == PLAN_STATUS_PARTIAL || item.getStatus() == PLAN_STATUS_ISSUED));
-        if (hasIssuedPlan) {
-            throw new BaseException("鍚堝苟澶辫触锛屾墍閫夌敓浜ц鍒掑瓨鍦ㄥ凡涓嬪彂鎴栭儴鍒嗕笅鍙戠殑鏁版嵁");
+                        && item.getStatus() == PLAN_STATUS_ISSUED);
+        if (hasFullyIssuedPlan) {
+            throw new BaseException("鍚堝苟澶辫触锛屾墍閫夌敓浜ц鍒掑瓨鍦ㄥ凡涓嬪彂鐨勬暟鎹�");
         }
 
         // 璁$畻鏈鍙笅鍙戠殑鍓╀綑闇�姹傛�婚噺
@@ -149,6 +150,7 @@
         productionOrder.setProductionPlanIds(formatPlanIds(issuedPlanIds));
         productionOrder.setProductModelId(firstPlan.getProductModelId());
         productionOrder.setQuantity(assignedQuantity);
+        productionOrder.setWorkshopId(productionPlanDto.getWorkshopId());
         productionOrder.setPlanCompleteTime(productionPlanDto.getPlanCompleteTime());
         if (!productionOrderService.saveProductionOrder(productionOrder)) {
             throw new ServiceException("涓嬪彂澶辫触锛岀敓浜ц鍗曚繚瀛樺け璐�");

--
Gitblit v1.9.3