|
@@ -12,6 +12,9 @@ import com.zanxiang.advertising.tencent.base.rpc.IUserActionSetRpc;
|
|
|
import com.zanxiang.erp.base.ErpServer;
|
|
|
import com.zanxiang.erp.base.rpc.ISysUserRpc;
|
|
|
import com.zanxiang.erp.security.util.SecurityUtil;
|
|
|
+import com.zanxiang.game.back.base.ServerInfo;
|
|
|
+import com.zanxiang.game.back.base.pojo.vo.GameBackPolicyRpcVO;
|
|
|
+import com.zanxiang.game.back.base.rpc.IGameBackPolicyRpc;
|
|
|
import com.zanxiang.game.module.manage.pojo.dto.AgentDTO;
|
|
|
import com.zanxiang.game.module.manage.pojo.enums.AccountTypeEnum;
|
|
|
import com.zanxiang.game.module.manage.pojo.params.AgentAddParam;
|
|
@@ -59,6 +62,9 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
@DubboReference(providedBy = ErpServer.SERVER_DUBBO_NAME)
|
|
|
private ISysUserRpc sysUserRpc;
|
|
|
|
|
|
+ @DubboReference(providedBy = ServerInfo.SERVER_DUBBO_NAME)
|
|
|
+ private IGameBackPolicyRpc gameBackPolicyRpc;
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<AgentVO> listOfPage(AgentListParam param) {
|
|
|
IPage<Agent> agentIPage = page(param.toPage(), new LambdaQueryWrapper<Agent>()
|
|
@@ -133,12 +139,16 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
Set<Long> gameIds = new HashSet<>(agentList.size());
|
|
|
Set<Long> txAccountIds = new HashSet<>(agentList.size());
|
|
|
Set<Long> userIds = new HashSet<>(1);
|
|
|
+ Set<Long> backPolicyIds = new HashSet<>();
|
|
|
agentList.forEach(agent -> {
|
|
|
gameIds.add(agent.getGameId());
|
|
|
if (AccountTypeEnum.TENCENT.getValue().equals(agent.getAccountType())) {
|
|
|
txAccountIds.add(agent.getAccountId());
|
|
|
}
|
|
|
userIds.add(agent.getCreateBy());
|
|
|
+ if (agent.getBackPolicyId() != null) {
|
|
|
+ backPolicyIds.add(agent.getBackPolicyId());
|
|
|
+ }
|
|
|
});
|
|
|
Map<String, UserActionSetRpcVO> userActionSetMap = new HashMap<>();
|
|
|
if (CollectionUtils.isNotEmpty(txAccountIds)) {
|
|
@@ -150,6 +160,10 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
userActionSetMap.putAll(userActionSetList.stream().collect(Collectors.toMap(obj -> obj.getAccountId() + "_" + obj.getUserActionSetId(), Function.identity())));
|
|
|
}
|
|
|
}
|
|
|
+ Map<Long, GameBackPolicyRpcVO> backPolicyMap = new HashMap<>(0);
|
|
|
+ if (CollectionUtils.isNotEmpty(backPolicyIds)) {
|
|
|
+ backPolicyMap.putAll(gameBackPolicyRpc.listByIds(new ArrayList<>(backPolicyIds)).getData());
|
|
|
+ }
|
|
|
Map<Long, GameInfoVO> gameMap = gameService.infoByIds(gameIds).stream().collect(Collectors.toMap(GameInfoVO::getId, Function.identity()));
|
|
|
Map<Long, String> userMap = sysUserRpc.getUserNameByIds(new ArrayList<>(userIds)).getData();
|
|
|
return agentList.stream().map(agent -> {
|
|
@@ -159,6 +173,9 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
vo.setUserActionSet(userActionSetMap.get(agent.getAccountId() + "_" + agent.getUserActionSetId()));
|
|
|
}
|
|
|
vo.setCreateByName(userMap.get(agent.getCreateBy()));
|
|
|
+ if (agent.getBackPolicyId() != null) {
|
|
|
+ vo.setBackPolicyInfo(backPolicyMap.get(agent.getBackPolicyId()));
|
|
|
+ }
|
|
|
return vo;
|
|
|
}).collect(Collectors.toList());
|
|
|
}
|