From ec10fcd5ef6425aded311d8413c99a3c78d2e30d Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 24 六月 2026 09:38:16 +0800
Subject: [PATCH] 删除销售报价记录后,对应报价审批记录也删除

---
 src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
index c2748f0..4503e4d 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
@@ -194,7 +194,16 @@
         if(salesQuotation==null) return false;
         salesQuotationMapper.deleteById(id);
         salesQuotationProductMapper.delete(new LambdaQueryWrapper<SalesQuotationProduct>().eq(SalesQuotationProduct::getSalesQuotationId, id));
-        // 鍒犻櫎鎶ヤ环瀹℃壒
+        // 鍒犻櫎鎶ヤ环瀹℃壒瀹炰緥锛圓pprovalInstance锛�
+        ApprovalInstance approvalInstance = approvalInstanceService.getOne(new LambdaQueryWrapper<ApprovalInstance>()
+                .eq(ApprovalInstance::getBusinessId, id)
+                .eq(ApprovalInstance::getBusinessType, 6L)
+                .eq(ApprovalInstance::getDeleted, 0)
+                .last("LIMIT 1"));
+        if(approvalInstance != null){
+            approvalInstanceService.delete(Collections.singletonList(approvalInstance.getId()));
+        }
+        // 鍒犻櫎鎶ヤ环瀹℃壒娴佺▼锛圓pproveProcess锛�
         ApproveProcess one = approveProcessService.getOne(new LambdaQueryWrapper<ApproveProcess>()
                 .eq(ApproveProcess::getApproveType, 6)
                 .eq(ApproveProcess::getApproveDelete, IsDeleteEnum.NOT_DELETED)

--
Gitblit v1.9.3