From 28cf22aaff7f092256db2ad6df699e17426f62ea Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期四, 30 四月 2026 16:34:27 +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/SalesLedgerProductServiceImpl.java |   62 ++++++++++++++++++++----------
 1 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
index cf333a2..817bfc6 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -31,6 +31,7 @@
 import com.ruoyi.technology.mapper.TechnologyRoutingMapper;
 import com.ruoyi.technology.pojo.TechnologyRouting;
 import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -55,27 +56,44 @@
  * @date 2025-05-08
  */
 @Service
-@RequiredArgsConstructor
 public class SalesLedgerProductServiceImpl extends ServiceImpl<SalesLedgerProductMapper, SalesLedgerProduct> implements ISalesLedgerProductService {
 
-    private final SalesLedgerProductMapper salesLedgerProductMapper;
-    private final ProductionAccountMapper productionAccountMapper;
-    private final SalesLedgerMapper salesLedgerMapper;
-    private final PurchaseLedgerMapper purchaseLedgerMapper;
-    private final ProductionPlanMapper productionPlanMapper;
-    private final ProductionOperationTaskMapper productionOperationTaskMapper;
-    private final ProductionOrderService productionOrderService;
-    private final TechnologyRoutingMapper technologyRoutingMapper;
-    private final TechnologyBomStructureMapper technologyBomStructureMapper;
-    private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper;
-    private final ProductionProductMainMapper productionProductMainMapper;
-    private final ProductionProductOutputMapper productionProductOutputMapper;
-    private final ProductionProductInputMapper productionProductInputMapper;
-    private final QualityInspectMapper qualityInspectMapper;
-    private final ShippingInfoMapper shippingInfoMapper;
-    private final ShippingInfoServiceImpl shippingInfoService;
-    private final StockUtils stockUtils;
-    private final StockInventoryMapper stockInventoryMapper;
+    @Autowired
+    private SalesLedgerProductMapper salesLedgerProductMapper;
+    @Autowired
+    private ProductionAccountMapper productionAccountMapper;
+    @Autowired
+    private SalesLedgerMapper salesLedgerMapper;
+    @Autowired
+    private PurchaseLedgerMapper purchaseLedgerMapper;
+    @Autowired
+    private ProductionPlanMapper productionPlanMapper;
+    @Autowired
+    private ProductionOperationTaskMapper productionOperationTaskMapper;
+    @Autowired
+    private ProductionOrderService productionOrderService;
+    @Autowired
+    private TechnologyRoutingMapper technologyRoutingMapper;
+    @Autowired
+    private TechnologyBomStructureMapper technologyBomStructureMapper;
+    @Autowired
+    private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper;
+    @Autowired
+    private ProductionProductMainMapper productionProductMainMapper;
+    @Autowired
+    private ProductionProductOutputMapper productionProductOutputMapper;
+    @Autowired
+    private ProductionProductInputMapper productionProductInputMapper;
+    @Autowired
+    private QualityInspectMapper qualityInspectMapper;
+    @Autowired
+    private ShippingInfoMapper shippingInfoMapper;
+    @Autowired
+    private ShippingInfoServiceImpl shippingInfoService;
+    @Autowired
+    private StockUtils stockUtils;
+    @Autowired
+    private StockInventoryMapper stockInventoryMapper;
 
     @Override
     public SalesLedgerProduct selectSalesLedgerProductById(Long id) {
@@ -211,7 +229,6 @@
             result = salesLedgerProductMapper.updateById(salesLedgerProduct);
             /*鍒犻櫎瀵瑰簲鐨勭敓浜ф暟鎹苟閲嶆柊鏂板*/
             deleteProductionData(Arrays.asList(salesLedgerProduct.getId()));
-            // 鍒犻櫎鐢熶骇鏍哥畻鏁版嵁
 
             addProductionData(salesLedgerProduct);
         }
@@ -254,6 +271,7 @@
         if (!salesLedgerProduct.getIsProduction()) {
             return;
         }
+        SalesLedger salesLedger = salesLedgerMapper.selectById(salesLedgerProduct.getSalesLedgerId());
         ProductionPlan productionPlan = new ProductionPlan();
         productionPlan.setSalesLedgerId(salesLedgerProduct.getSalesLedgerId());
         productionPlan.setSalesLedgerProductId(salesLedgerProduct.getId());
@@ -262,6 +280,8 @@
         productionPlan.setQtyRequired(salesLedgerProduct.getQuantity());
         productionPlan.setSource("閿�鍞�");
         productionPlan.setStatus(0);
+        productionPlan.setRequiredDate(salesLedger.getDeliveryDate());//闇�姹傛棩鏈�=浜よ揣鏃ユ湡
+        productionPlan.setPromisedDeliveryDate(salesLedger.getDeliveryDate());//鎵胯鏃ユ湡=浜よ揣鏃ユ湡
         productionPlanMapper.insert(productionPlan);
 
     }
@@ -273,7 +293,7 @@
         List<ProductionPlan> productionPlans = productionPlanMapper.selectList(
                 new LambdaQueryWrapper<ProductionPlan>()
                         .in(ProductionPlan::getSalesLedgerProductId, productIds.stream().map(Long::intValue).collect(Collectors.toList())));
-        if (org.springframework.util.CollectionUtils.isEmpty(productionPlans)) {
+        if (CollectionUtils.isEmpty(productionPlans)) {
             return;
         }
         //濡傛灉鐢熶骇璁″垝宸蹭笅鍙戝垯涓嶈兘鍒犻櫎

--
Gitblit v1.9.3