|
@@ -106,17 +106,31 @@ public class AppGameCommissionServiceImpl extends ServiceImpl<AppGameCommissionM
|
|
|
List<AppGameCommission> list = appGameCommissionMapper.selectList(queryWrapper);
|
|
|
if(null != list && list.size() > 0){
|
|
|
List<Long> gameIds = list.stream().map(e->e.getGameId()).collect(Collectors.toList());
|
|
|
- List<AppGame> games = appGameService.selectByIds(gameIds);
|
|
|
- Map<String,String> map = new HashMap<>();
|
|
|
- if(null != games && games.size() > 0){
|
|
|
- map = games.stream().collect(Collectors.toMap(j->String.valueOf(j.getId()),AppGame::getName,(k1,k2)->k1));
|
|
|
- }
|
|
|
- Map<String, String> finalMap = map;
|
|
|
- list.forEach(e->{
|
|
|
- if(null != finalMap.get(String.valueOf(e.getGameId()))){
|
|
|
- e.setGameName(finalMap.get(String.valueOf(e.getGameId())));
|
|
|
+ AppGame queryGame = new AppGame();
|
|
|
+// queryGame.setStatus(1L);
|
|
|
+ List<AppGame> games = appGameService.selectAppGameList(queryGame);
|
|
|
+ for(AppGame game:games){
|
|
|
+ Map<String,Boolean> userMap = new HashMap<>();
|
|
|
+ for(AppGameCommission appGameCommission : list){
|
|
|
+ if(game.getId().equals(appGameCommission.getGameId())){
|
|
|
+ if(null == userMap.get(appGameCommission.getUserId())){
|
|
|
+ userMap.put(String.valueOf(appGameCommission.getUserId()),true);
|
|
|
+ }
|
|
|
+ appGameCommission.setGameName(game.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Long> unIds = ids.stream().filter(e->null==userMap.get(String.valueOf(e))).collect(Collectors.toList());
|
|
|
+ for(Long unId:unIds){
|
|
|
+ //未设置过该游戏
|
|
|
+ AppGameCommission appGameCommission = new AppGameCommission();
|
|
|
+ appGameCommission.setGameId(game.getId());
|
|
|
+ appGameCommission.setGameRate(0L);
|
|
|
+ appGameCommission.setGameName(game.getName());
|
|
|
+ appGameCommission.setUserId(unId);
|
|
|
+ list.add(appGameCommission);
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
return list;
|
|
|
}
|