From b0905a2a925516e5b6190553b5ae63b592b2a95c Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 16 Dec 2025 15:44:46 +0800 Subject: [PATCH] =?UTF-8?q?bd=20=E5=88=97=E8=A1=A8=E8=BF=87=E6=BB=A4bdlead?= =?UTF-8?q?er=20=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/app/command/bd/query/BdTeamQryExe.java | 16 ++++++++++++++++ .../team/AdminRechargeAgentRelationService.java | 4 +++- .../AdminRechargeAgentRelationServiceImpl.java | 9 +++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamQryExe.java index c2ab4112..96b6161f 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamQryExe.java @@ -28,6 +28,7 @@ import com.red.circle.component.redis.service.RedisService; 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; @@ -178,6 +179,8 @@ public class BdTeamQryExe { return Collections.emptyList(); } + bdList = filterBdLeader(bdLeaderUserId, bdList); + Set bdUserIdSet = bdList.stream() .map(BusinessDevelopmentBaseInfo::getUserId) .collect(Collectors.toSet()); @@ -196,6 +199,19 @@ public class BdTeamQryExe { return result; } + @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 列表(BD 视角) */ diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/team/AdminRechargeAgentRelationService.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/team/AdminRechargeAgentRelationService.java index 6b6cff5f..d779715a 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/team/AdminRechargeAgentRelationService.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/team/AdminRechargeAgentRelationService.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.red.circle.framework.mybatis.service.BaseService; import com.red.circle.other.infra.database.rds.entity.team.AdminRechargeAgentRelation; +import java.util.List; + /** * 管理员充值代理关系Service. * @@ -18,7 +20,7 @@ public interface AdminRechargeAgentRelationService extends BaseService getByUserId(Long userId); /** * 检查用户是否是充值代理. diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/team/impl/AdminRechargeAgentRelationServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/team/impl/AdminRechargeAgentRelationServiceImpl.java index de3572b7..cc8ea4ef 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/team/impl/AdminRechargeAgentRelationServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/team/impl/AdminRechargeAgentRelationServiceImpl.java @@ -9,6 +9,8 @@ import com.red.circle.other.infra.database.rds.entity.team.AdminRechargeAgentRel import com.red.circle.other.infra.database.rds.service.team.AdminRechargeAgentRelationService; import org.springframework.stereotype.Service; +import java.util.List; + /** * 管理员充值代理关系Service实现. * @@ -20,10 +22,9 @@ public class AdminRechargeAgentRelationServiceImpl extends AdminRechargeAgentRelationService { @Override - public AdminRechargeAgentRelation getByUserId(Long userId) { - return getOne(new LambdaQueryWrapper() - .eq(AdminRechargeAgentRelation::getUserId, userId) - .last("LIMIT 1")); + public List getByUserId(Long userId) { + return list(new LambdaQueryWrapper() + .eq(AdminRechargeAgentRelation::getUserId, userId)); } @Override