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