From abf1c0a35d85d38239ff5d2ed746a4e4b797c9d1 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期四, 20 八月 2026 14:05:02 +0800
Subject: [PATCH] feat 功能修正
---
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java
index bf22058..dd8251e 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java
@@ -17,6 +17,7 @@
import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerPoolConfigDO;
import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerPoolConfigService;
import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService;
+import cn.iocoder.yudao.module.crm.service.receivable.CrmReceivablePlanService;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
@@ -33,10 +34,12 @@
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
+import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.stream.Stream;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
@@ -56,6 +59,8 @@
private CrmCustomerService customerService;
@Resource
private CrmCustomerPoolConfigService customerPoolConfigService;
+ @Resource
+ private CrmReceivablePlanService receivablePlanService;
@Resource
private DeptApi deptApi;
@@ -139,6 +144,10 @@
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(userMap.values(), AdminUserRespDTO::getDeptId));
// 1.2 鑾峰彇璺濈杩涘叆鍏捣鐨勬椂闂�
Map<Long, Long> poolDayMap = getPoolDayMap(list);
+ // 1.3 鑾峰彇娆犺垂閲戦銆佹瑺璐圭瑪鏁帮紙鏈洖娆� + 宸查�炬湡鐨勫洖娆捐鍒掞級
+ Set<Long> customerIds = convertSet(list, CrmCustomerDO::getId);
+ Map<Long, BigDecimal> overdueAmountMap = receivablePlanService.getOverdueAmountMapByCustomerIds(customerIds);
+ Map<Long, Integer> overdueCountMap = receivablePlanService.getOverdueCountMapByCustomerIds(customerIds);
// 2. 杞崲鎴� VO
return BeanUtils.toBean(list, CrmCustomerRespVO.class, customerVO -> {
customerVO.setAreaName(AreaUtils.format(customerVO.getAreaId()));
@@ -153,6 +162,9 @@
if (customerVO.getOwnerUserId() != null) {
customerVO.setPoolDay(poolDayMap.get(customerVO.getId()));
}
+ // 2.3 璁剧疆娆犺垂椋庨櫓锛堟瑺璐归噾棰�/娆犺垂绗旀暟锛�
+ customerVO.setOverdueAmount(overdueAmountMap.get(customerVO.getId()));
+ customerVO.setOverdueCount(overdueCountMap.get(customerVO.getId()));
});
}
--
Gitblit v1.9.3