From f088078e626e16b28d69cdbcbf514b30f1dcefe7 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期三, 22 四月 2026 11:51:58 +0800
Subject: [PATCH] refactor(production): 优化生产订单及工单号生成逻辑

---
 src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
index 12af6c7..d8c7881 100644
--- a/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
+++ b/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -185,12 +185,15 @@
         if (!salesLedgers.isEmpty()) {
             throw new RuntimeException("瀹㈡埛妗f涓嬫湁閿�鍞悎鍚岋紝璇峰厛鍒犻櫎閿�鍞悎鍚�");
         }
-        //  鍒犻櫎瀹㈡埛鐨勫悓鏃朵篃闇�瑕佸垹闄ゅ搴旂殑瀹㈡埛璺熼殢銆侀檮浠跺拰鍥炶鎻愰啋
-        for (Long id : ids) {
-            customerFollowUpService.deleteByCustomerId(id);
-            customerReturnVisitService.deleteByCustomerId(id);
+        List<CustomerPrivatePool> customerPrivatePools = customerPrivatePoolMapper.selectList(new QueryWrapper<CustomerPrivatePool>().lambda().in(CustomerPrivatePool::getCustomerId, idList));
+        if (!customerPrivatePools.isEmpty()) {
+            throw new RuntimeException("瀹㈡埛妗f涓嬫湁瀹㈡埛绉佹捣锛岃鍏堟敹鍥炵娴锋暟鎹�");
         }
-
+        //  鍒犻櫎瀹㈡埛鐨勫悓鏃朵篃闇�瑕佸垹闄ゅ搴旂殑瀹㈡埛璺熼殢銆侀檮浠跺拰鍥炶鎻愰啋
+//        for (Long id : ids) {
+//            customerFollowUpService.deleteByCustomerId(id);
+//            customerReturnVisitService.deleteByCustomerId(id);
+//        }
         return customerMapper.deleteBatchIds(idList);
     }
 

--
Gitblit v1.9.3