From f350465db70d6f9db9494483ee0cec7793a9007b Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 19 八月 2026 17:47:57 +0800
Subject: [PATCH] feat(approve): 实现审批流程或签会签功能并优化数据库配置

---
 src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 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 b756ed2..e8de010 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -18,6 +18,7 @@
 import com.ruoyi.production.pojo.*;
 import com.ruoyi.production.service.ProductProcessService;
 import com.ruoyi.production.service.ProductWorkOrderService;
+import com.ruoyi.production.service.ProductionProductMainService;
 import com.ruoyi.production.service.impl.ProductOrderServiceImpl;
 import com.ruoyi.purchase.mapper.PurchaseLedgerMapper;
 import com.ruoyi.purchase.pojo.PurchaseLedger;
@@ -63,8 +64,10 @@
 
     private final ProductWorkOrderService productWorkOrderService;
     private final ProductProcessService productProcessService;
+    private ProductionProductMainService productionProductMainService;
     private SalesLedgerProductMapper salesLedgerProductMapper;
     private SalesLedgerProductionAccountingMapper salesLedgerProductionAccountingMapper;
+    private ProductionReportPersonMapper productionReportPersonMapper;
     private SalesLedgerMapper salesLedgerMapper;
     private PurchaseLedgerMapper purchaseLedgerMapper;
     private ProductOrderMapper productOrderMapper;
@@ -316,6 +319,7 @@
                 productProcessRouteItem.setProductOrderId(productOrder.getId());
                 productProcessRouteItem.setProductRouteId(productProcessRoute.getId());
                 productProcessRouteItem.setDragSort(processRouteItem.getDragSort());
+                productProcessRouteItem.setIsQuality(processRouteItem.getIsQuality());
                 int insert = productProcessRouteItemMapper.insert(productProcessRouteItem);
                 if (insert > 0) {
                     ProductWorkOrder productWorkOrder = new ProductWorkOrder();
@@ -329,6 +333,8 @@
                 }
 
             }
+            // 鎺掍骇涓嬭揪鍚庤嚜鍔ㄨЕ鍙戠涓�閬撻渶璐ㄦ宸ュ簭鐨勮繃绋嬫楠�
+            productionProductMainService.preGenerateQualityInspectForOrder(productOrder.getId());
             productOrder.setRouteId(processRoute.getId());
             productOrderMapper.updateById(productOrder);
         }
@@ -400,9 +406,13 @@
                     qualityInspectMapper.deleteByProductMainIds(productMainIds);
                     salesLedgerProductionAccountingMapper.delete(new LambdaQueryWrapper<SalesLedgerProductionAccounting>()
                             .in(SalesLedgerProductionAccounting::getProductMainId, productMainIds));
+                    productionReportPersonMapper.delete(new LambdaQueryWrapper<ProductionReportPerson>()
+                            .in(ProductionReportPerson::getProductMainId, productMainIds));
                 }
 
                 productionProductMainMapper.deleteByWorkOrderIds(workOrderIds);
+                // 娓呯悊鎺掍骇棰勭敓鎴愮殑璐ㄦ鍗�
+                productionProductMainService.cleanPreGeneratedQualityInspects(workOrderIds);
 
                 productWorkOrderMapper.delete(new LambdaQueryWrapper<ProductWorkOrder>()
                         .in(ProductWorkOrder::getProductOrderId, orderIds));

--
Gitblit v1.9.3