|
@@ -229,6 +229,11 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
//判断运营
|
|
|
GameAuthRole gameAuthRole = gameAuthRoleService.getOne(new LambdaQueryWrapper<GameAuthRole>()
|
|
|
.eq(GameAuthRole::getUserId, SecurityUtil.getUserId()));
|
|
|
+ //分配的游戏不存在
|
|
|
+ Tuple2<String, List<Long>> gameTuple = gameAuthService.getUserGameList(null);
|
|
|
+ if (CollectionUtils.isEmpty(gameTuple.getT2())) {
|
|
|
+ return Tuples.of(Collections.emptyList(), Collections.emptyList());
|
|
|
+ }
|
|
|
//自然量查询
|
|
|
if (Objects.equals(agentId, Agent.DEFAULT_AGENT)) {
|
|
|
//超管, 运营, 组长可以查询自然量
|
|
@@ -240,7 +245,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
return Tuples.of(Collections.emptyList(), Collections.emptyList());
|
|
|
}
|
|
|
//渠道列表
|
|
|
- List<Agent> agentList = new ArrayList<>();
|
|
|
+ List<Agent> agentList;
|
|
|
//是否需要自然量
|
|
|
boolean defaultAgent = true;
|
|
|
//超管权限, 返回所有渠道
|
|
@@ -251,26 +256,28 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
.eq(agentId != null, Agent::getId, agentId));
|
|
|
} else if (Objects.equals(gameAuthRole.getAuthType(), GameAuthEnum.OPERATE.getValue())) {
|
|
|
//运营权限, 获取拥有的游戏的所有渠道
|
|
|
- Tuple2<String, List<Long>> tuple2 = gameAuthService.getUserGameList(null);
|
|
|
- if (CollectionUtils.isNotEmpty(tuple2.getT2())) {
|
|
|
- agentList = super.list(new LambdaQueryWrapper<Agent>()
|
|
|
- .in(Agent::getGameId, tuple2.getT2())
|
|
|
- .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
|
|
|
- .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
|
|
|
- .eq(agentId != null, Agent::getId, agentId));
|
|
|
- }
|
|
|
+ agentList = super.list(new LambdaQueryWrapper<Agent>()
|
|
|
+ .in(Agent::getGameId, gameTuple.getT2())
|
|
|
+ .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
|
|
|
+ .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
|
|
|
+ .eq(agentId != null, Agent::getId, agentId));
|
|
|
} else if (sysGameUserGroupRpcVO != null) {
|
|
|
//组长权限, 获取组员id, 查询组内所有渠道
|
|
|
Collection<Long> memberUserIdList = sysGameUserGroupRpc.memberUserIds(SecurityUtil.getCompanyId(),
|
|
|
SecurityUtil.getUserId()).getData();
|
|
|
+ if (CollectionUtils.isEmpty(memberUserIdList)){
|
|
|
+ return Tuples.of(Collections.emptyList(), Collections.emptyList());
|
|
|
+ }
|
|
|
agentList = super.list(new LambdaQueryWrapper<Agent>()
|
|
|
+ .in(Agent::getGameId, gameTuple.getT2())
|
|
|
.eq(Strings.isNotBlank(account), Agent::getAccountId, account)
|
|
|
.eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
|
|
|
- .in(Strings.isBlank(pitcherId), Agent::getCreateBy, memberUserIdList)
|
|
|
+ .in(Agent::getCreateBy, memberUserIdList)
|
|
|
.eq(agentId != null, Agent::getId, agentId));
|
|
|
} else {
|
|
|
//组员, 只允许查看自己的数据
|
|
|
agentList = super.list(new LambdaQueryWrapper<Agent>()
|
|
|
+ .in(Agent::getGameId, gameTuple.getT2())
|
|
|
.eq(Strings.isNotBlank(account), Agent::getAccountId, account)
|
|
|
.eq(Agent::getCreateBy, SecurityUtil.getUserId())
|
|
|
.eq(agentId != null, Agent::getId, agentId));
|