bd 列表过滤bdleader 数据

This commit is contained in:
tianfeng 2025-12-16 15:44:46 +08:00
parent 4ec5bce294
commit b0905a2a92
3 changed files with 24 additions and 5 deletions

View File

@ -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<Long> bdUserIdSet = bdList.stream()
.map(BusinessDevelopmentBaseInfo::getUserId)
.collect(Collectors.toSet());
@ -196,6 +199,19 @@ public class BdTeamQryExe {
return result;
}
@NotNull
private List<BusinessDevelopmentBaseInfo> filterBdLeader(Long bdLeaderUserId, List<BusinessDevelopmentBaseInfo> bdList) {
Set<Long> bdIdSet = bdList.stream().map(BusinessDevelopmentBaseInfo::getUserId).collect(Collectors.toSet());
List<RoomBdLead> roomBdLeads = roomBdLeadService.listByUserIds(bdIdSet);
List<Long> 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 视角
*/

View File

@ -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<AdminRech
* @param userId 充值代理用户ID
* @return 关系实体
*/
AdminRechargeAgentRelation getByUserId(Long userId);
List<AdminRechargeAgentRelation> getByUserId(Long userId);
/**
* 检查用户是否是充值代理.

View File

@ -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<AdminRechargeAgentRelation>()
.eq(AdminRechargeAgentRelation::getUserId, userId)
.last("LIMIT 1"));
public List<AdminRechargeAgentRelation> getByUserId(Long userId) {
return list(new LambdaQueryWrapper<AdminRechargeAgentRelation>()
.eq(AdminRechargeAgentRelation::getUserId, userId));
}
@Override