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 | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 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 927cd1e..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
@@ -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