From 9ce1e6c2d5747155e165c4525cdd3d6b5cdea8c7 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 18 Dec 2025 19:08:29 +0800 Subject: [PATCH] =?UTF-8?q?bd=E6=80=BB=E8=A7=88=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/bd/query/BdTeamSummaryQryExe.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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 36061f55..caef3747 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 @@ -31,6 +31,7 @@ import com.red.circle.other.inner.model.dto.user.UserProfileDTO; import com.red.circle.tool.core.collection.CollectionUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Component; import java.math.BigDecimal; @@ -173,8 +174,14 @@ public class BdTeamSummaryQryExe { } List bdInfos = businessDevelopmentBaseInfoService.listBdByLeadUserId(bdUserId); + + bdInfos = filterBdLeader(bdUserId, bdInfos); + item.setCount(bdInfos.size()); + 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); item.setTotalIncome(totalIncome); @@ -182,6 +189,19 @@ public class BdTeamSummaryQryExe { return item; } + @NotNull + private List filterBdLeader(Long bdLeaderUserId, List bdList) { + Set bdIdSet = bdList.stream().map(BusinessDevelopmentBaseInfo::getUserId).collect(Collectors.toSet()); + List roomBdLeads = roomBdLeadService.listByUserIds(bdIdSet); + + List bdLeaderIdList = roomBdLeads.stream().map(RoomBdLead::getUserId) + .filter(e -> !e.equals(bdLeaderUserId)) + .toList(); + bdList = bdList.stream() + .filter(e -> !bdLeaderIdList.contains(e.getUserId())).collect(Collectors.toList()); + return bdList; + } + /** * 查询 Agency 汇总 */