From d17024670efca145ff97bc26913bfd9b0fef2cd0 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 16 十月 2026 10:26:31 +0800
Subject: [PATCH] feat(crm): 开放客户跨模块访问权限以支持业务集成

---
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/api/customer/CrmCustomerApiImpl.java |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/api/customer/CrmCustomerApiImpl.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/api/customer/CrmCustomerApiImpl.java
index 75d0cc3..248cd45 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/api/customer/CrmCustomerApiImpl.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/api/customer/CrmCustomerApiImpl.java
@@ -24,7 +24,7 @@
 /**
  * CRM 瀹㈡埛 API 瀹炵幇绫�
  *
- * @author 鑺嬮亾婧愮爜
+ * @author 瓒呯骇绠$悊鍛�
  */
 @Service
 public class CrmCustomerApiImpl implements CrmCustomerApi {
@@ -38,7 +38,8 @@
 
     @Override
     public CrmCustomerRespDTO getCustomer(Long id) {
-        CrmCustomerDO customer = customerService.getCustomer(id);
+        List<CrmCustomerDO> customers = customerService.getCustomerList(Collections.singleton(id));
+        CrmCustomerDO customer = CollUtil.isEmpty(customers) ? null : customers.get(0);
         return BeanUtils.toBean(customer, CrmCustomerRespDTO.class);
     }
 
@@ -48,9 +49,10 @@
             return Collections.emptyList();
         }
         List<CrmCustomerDO> customers = customerService.getCustomerList(ids);
-        // 杩囨护鎺夌敤鎴锋病鏈夋潈闄愮殑瀹㈡埛
-        List<CrmCustomerDO> filteredCustomers = filterCustomersByPermission(customers);
-        return BeanUtils.toBean(filteredCustomers, CrmCustomerRespDTO.class);
+        // 杩欐槸渚� MES銆丒RP銆佸敭鍚庣瓑涓氬姟妯″潡瑙f瀽鍏宠仈瀹㈡埛鐨勮法妯″潡 API銆�
+        // 钀ラ攢绠$悊鑷韩鐨勫垪琛ㄦ潈闄愮敱 CrmCustomerMapper 鍒嗛〉鏌ヨ缁熶竴鎺у埗锛屼笉鑳藉湪杩欓噷鍐嶆鎸夊綋鍓嶇敤鎴疯繃婊わ紝
+        // 鍚﹀垯鍏朵粬妯″潡鏌ョ湅宸叉湁涓氬姟鍗曟嵁鏃朵細涓㈠け闈炴湰浜哄鎴峰悕绉般��
+        return BeanUtils.toBean(customers, CrmCustomerRespDTO.class);
     }
 
     @Override
@@ -59,9 +61,7 @@
             return Collections.emptyMap();
         }
         List<CrmCustomerDO> customers = customerService.getCustomerList(ids);
-        // 杩囨护鎺夌敤鎴锋病鏈夋潈闄愮殑瀹㈡埛
-        List<CrmCustomerDO> filteredCustomers = filterCustomersByPermission(customers);
-        return filteredCustomers.stream()
+        return customers.stream()
                 .collect(Collectors.toMap(
                         CrmCustomerDO::getId,
                         customer -> BeanUtils.toBean(customer, CrmCustomerRespDTO.class)));
@@ -121,6 +121,12 @@
         return new ArrayList<>(permittedIds);
     }
 
+    @Override
+    public List<CrmCustomerRespDTO> getCustomerSimpleList() {
+        List<CrmCustomerDO> customers = customerService.getCustomerList();
+        return BeanUtils.toBean(customers, CrmCustomerRespDTO.class);
+    }
+
     /**
      * 杩囨护鎺夌敤鎴锋病鏈夋潈闄愮殑瀹㈡埛
      * <p>

--
Gitblit v1.9.3