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/service/receivable/CrmReceivablePlanServiceImpl.java |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanServiceImpl.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanServiceImpl.java
index 5005508..c96eecf 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanServiceImpl.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanServiceImpl.java
@@ -24,8 +24,12 @@
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
 
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@@ -36,7 +40,7 @@
 /**
  * 鍥炴璁″垝 Service 瀹炵幇绫�
  *
- * @author 鑺嬮亾婧愮爜
+ * @author 瓒呯骇绠$悊鍛�
  */
 @Service
 @Validated
@@ -185,4 +189,32 @@
         return receivablePlanMapper.selectReceivablePlanCountByRemind(userId);
     }
 
+    @Override
+    public Map<Long, BigDecimal> getOverdueAmountMapByCustomerIds(Collection<Long> customerIds) {
+        Map<Long, BigDecimal> result = new HashMap<>();
+        if (CollUtil.isEmpty(customerIds)) {
+            return result;
+        }
+        List<CrmReceivablePlanDO> overdueList =
+                receivablePlanMapper.selectOverdueListByCustomerIds(customerIds, LocalDateTime.now());
+        for (CrmReceivablePlanDO plan : overdueList) {
+            result.merge(plan.getCustomerId(), plan.getPrice(), BigDecimal::add);
+        }
+        return result;
+    }
+
+    @Override
+    public Map<Long, Integer> getOverdueCountMapByCustomerIds(Collection<Long> customerIds) {
+        Map<Long, Integer> result = new HashMap<>();
+        if (CollUtil.isEmpty(customerIds)) {
+            return result;
+        }
+        List<CrmReceivablePlanDO> overdueList =
+                receivablePlanMapper.selectOverdueListByCustomerIds(customerIds, LocalDateTime.now());
+        for (CrmReceivablePlanDO plan : overdueList) {
+            result.merge(plan.getCustomerId(), 1, Integer::sum);
+        }
+        return result;
+    }
+
 }

--
Gitblit v1.9.3