use of com.code.server.login.vo.ThreeLevelInfoVo in project summer by foxsugar.
the class DelegateRelataionServiceImpl method fetchThreeLevelDelegateList.
@Override
public List<ThreeLevelInfoVo> fetchThreeLevelDelegateList(long agentId) {
AgentBean agentBean = RedisManager.getAgentRedisService().getAgentBean(agentId);
logger.info("》》》》》》》》》》》》》{}", agentBean);
List<Long> aList = new ArrayList<>();
for (long uid : agentBean.getChildList()) {
if (RedisManager.getAgentRedisService().isExit(uid)) {
aList.add(uid);
}
}
// List<Long> bList = new ArrayList<>();
// for (Long id : aList){
// AgentBean bean = RedisManager.getAgentRedisService().getAgentBean(id);
// for (Long uid : bean.getChildList()){
// if (RedisManager.getAgentRedisService().isExit(uid)){
// bList.add(uid);
// }
// }
// }
// List<User> cList = userDao.findUsersByIdIn(bList);
// List<ThreeLevelInfoVo> resultList = new ArrayList<>();
// for (User user : cList){
// ThreeLevelInfoVo threeLevelInfoVo = new ThreeLevelInfoVo();
// threeLevelInfoVo.setImage(user.getImage() + "/96");
// threeLevelInfoVo.setUsername(user.getUsername());
// threeLevelInfoVo.setUid(user.getId());
// resultList.add(threeLevelInfoVo);
// }
List<User> cList = userDao.findUsersByIdIn(aList);
List<ThreeLevelInfoVo> resultList = new ArrayList<>();
for (User user : cList) {
ThreeLevelInfoVo threeLevelInfoVo = new ThreeLevelInfoVo();
threeLevelInfoVo.setImage(user.getImage() + "/96");
threeLevelInfoVo.setUsername(user.getUsername());
threeLevelInfoVo.setUid(user.getId());
resultList.add(threeLevelInfoVo);
}
return resultList;
}
Aggregations