From efaa975ca9a7fe133744e353e4eb321f11470fd2 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 20 三月 2026 11:28:45 +0800
Subject: [PATCH] fix: service导入修改

---
 src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java b/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
index 1444f36..5702c18 100644
--- a/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
+++ b/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
@@ -17,6 +17,7 @@
 import com.ruoyi.production.enums.ProductOrderStatusEnum;
 import com.ruoyi.production.pojo.ProductMaterialSku;
 import com.ruoyi.production.pojo.ProductOrder;
+import com.ruoyi.production.service.IProductionOrderAppendixService;
 import com.ruoyi.production.service.ProductMaterialService;
 import com.ruoyi.production.service.ProductMaterialSkuService;
 import com.ruoyi.production.service.ProductOrderService;
@@ -76,6 +77,9 @@
 
     @Autowired
     private ProductMaterialService productMaterialService;
+
+    @Autowired
+    private IProductionOrderAppendixService productionOrderAppendixService;
 
     /**
      * 鍚屾閿侊紝纭繚鎵嬪姩鍜屽畾鏃朵换鍔′笉鍚屾椂鎵ц
@@ -143,7 +147,19 @@
         productOrder.setQuantity(productionPlanDto.getTotalAssignedQuantity());
         productOrder.setPlanCompleteTime(productionPlanDto.getPlanCompleteTime());
         productOrder.setStatus(ProductOrderStatusEnum.WAIT.getCode());
-        productOrderService.addProductOrder(productOrder);
+        productOrder.setStrength(productionPlanDto.getStrength());
+
+        Long orderId = productOrderService.insertProductOrder(productOrder);
+
+        //  褰撲笅鍙戠殑浜у搧涓虹爩鍧楁垨鏉挎潗锛屽氨鎷夊彇BOM瀛愰泦涓庡伐鑹鸿矾绾垮瓙闆嗘暟鎹瓨鍏ュ埌闄勮〃涓�
+        if ("鐮屽潡".equals(productionPlanDto.getProductName())) {
+            productOrder.setRouteId(productionOrderAppendixService.populateBlocks(orderId, productionPlanDto));
+        }
+        if ("鏉挎潗".equals(productionPlanDto.getProductName())) {
+            productOrder.setRouteId(productionOrderAppendixService.populatePlates(orderId, productionPlanDto));
+        }
+        //  鏇存柊缁戝畾鐨勫伐鑹鸿矾绾�
+        productOrderService.updateById(productOrder);
 
         // 鏍规嵁涓嬪彂鏁伴噺锛屼粠绗竴涓敓浜ц鍒掑紑濮嬪垎閰嶆柟鏁�
         BigDecimal assignedVolume = BigDecimal.ZERO;

--
Gitblit v1.9.3