From f096da9e8d68a0a78b5efa3b6f7c06b432f7a960 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 6 Jan 2026 14:14:34 +0800 Subject: [PATCH] =?UTF-8?q?admin=E9=A1=B5=E9=9D=A2bd=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/bd/query/BdTeamSummaryQryExe.java | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamSummaryQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamSummaryQryExe.java index caef3747..8a5b7da4 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamSummaryQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamSummaryQryExe.java @@ -38,6 +38,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; import java.util.concurrent.TimeUnit; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -164,26 +165,22 @@ public class BdTeamSummaryQryExe { private BdTeamSummaryCO.TeamSummaryItem queryBdSummary(Long bdUserId, Integer currentBillBelong) { BdTeamSummaryCO.TeamSummaryItem item = new BdTeamSummaryCO.TeamSummaryItem(); - // 查询该用户下的所有 Agency 团队 - List bdTeamList = businessDevelopmentTeamService.listByUserId(bdUserId); - - if (CollectionUtils.isEmpty(bdTeamList)) { - item.setCount(0); - item.setTotalIncome(BigDecimal.ZERO); - return item; - } - List bdInfos = businessDevelopmentBaseInfoService.listBdByLeadUserId(bdUserId); - bdInfos = filterBdLeader(bdUserId, bdInfos); - item.setCount(bdInfos.size()); + List list = bdInfos.stream() + .filter(e -> !e.getUserId().equals(bdUserId)) + .map(BusinessDevelopmentBaseInfo::getUserId).toList(); - List list = bdInfos.stream().map(BusinessDevelopmentBaseInfo::getUserId).toList(); - bdTeamList = bdTeamList.stream().filter(e -> list.contains(e.getUserId())).collect(Collectors.toList()); - - // 计算总收入 - BigDecimal totalIncome = calculateBdTotalIncome(bdTeamList, currentBillBelong); + BigDecimal totalIncome = list.stream().map(bUserId -> { + // 查询该用户的bd下的所有 Agency 团队 + List bdTeamList = businessDevelopmentTeamService.listByUserId(bUserId); + if (CollectionUtils.isNotEmpty(bdTeamList)) { + // 计算总收入 + return calculateBdTotalIncome(bdTeamList, currentBillBelong); + } + return BigDecimal.ZERO; + }).reduce(BigDecimal.ZERO, BigDecimal::add); item.setTotalIncome(totalIncome); return item;