bd 列表过滤bdleader 数据
This commit is contained in:
parent
4ec5bce294
commit
b0905a2a92
@ -28,6 +28,7 @@ import com.red.circle.component.redis.service.RedisService;
|
|||||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
import com.red.circle.tool.core.collection.CollectionUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -178,6 +179,8 @@ public class BdTeamQryExe {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bdList = filterBdLeader(bdLeaderUserId, bdList);
|
||||||
|
|
||||||
Set<Long> bdUserIdSet = bdList.stream()
|
Set<Long> bdUserIdSet = bdList.stream()
|
||||||
.map(BusinessDevelopmentBaseInfo::getUserId)
|
.map(BusinessDevelopmentBaseInfo::getUserId)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
@ -196,6 +199,19 @@ public class BdTeamQryExe {
|
|||||||
return result;
|
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 视角)
|
* 查询 Agency 列表(BD 视角)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.red.circle.framework.mybatis.service.BaseService;
|
import com.red.circle.framework.mybatis.service.BaseService;
|
||||||
import com.red.circle.other.infra.database.rds.entity.team.AdminRechargeAgentRelation;
|
import com.red.circle.other.infra.database.rds.entity.team.AdminRechargeAgentRelation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理员充值代理关系Service.
|
* 管理员充值代理关系Service.
|
||||||
*
|
*
|
||||||
@ -18,7 +20,7 @@ public interface AdminRechargeAgentRelationService extends BaseService<AdminRech
|
|||||||
* @param userId 充值代理用户ID
|
* @param userId 充值代理用户ID
|
||||||
* @return 关系实体
|
* @return 关系实体
|
||||||
*/
|
*/
|
||||||
AdminRechargeAgentRelation getByUserId(Long userId);
|
List<AdminRechargeAgentRelation> getByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查用户是否是充值代理.
|
* 检查用户是否是充值代理.
|
||||||
|
|||||||
@ -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 com.red.circle.other.infra.database.rds.service.team.AdminRechargeAgentRelationService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理员充值代理关系Service实现.
|
* 管理员充值代理关系Service实现.
|
||||||
*
|
*
|
||||||
@ -20,10 +22,9 @@ public class AdminRechargeAgentRelationServiceImpl extends
|
|||||||
AdminRechargeAgentRelationService {
|
AdminRechargeAgentRelationService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AdminRechargeAgentRelation getByUserId(Long userId) {
|
public List<AdminRechargeAgentRelation> getByUserId(Long userId) {
|
||||||
return getOne(new LambdaQueryWrapper<AdminRechargeAgentRelation>()
|
return list(new LambdaQueryWrapper<AdminRechargeAgentRelation>()
|
||||||
.eq(AdminRechargeAgentRelation::getUserId, userId)
|
.eq(AdminRechargeAgentRelation::getUserId, userId));
|
||||||
.last("LIMIT 1"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user