| | |
| | | // }); |
| | | // } |
| | | |
| | | |
| | | List<WorldCupRankVo> list = new ArrayList<>(); |
| | | for (int i = 0; i < mapList.size(); i++) { |
| | | Map<String, Object> map = mapList.get(i); |
| | |
| | | if(i == 19 && b){ |
| | | break; |
| | | } |
| | | |
| | | //排名前20的数据添加完成后且包含自己,需要将自己找出来后添加到21位 |
| | | if(i > 19 && !b){ |
| | | if(worldCupRank.getIsStudent().compareTo(participantType) == 0 && worldCupRank.getId().compareTo(participantId) == 0){ |
| | |
| | | } |
| | | // 排序 |
| | | list= list.stream().sorted(Comparator.comparing(WorldCupRankVo::getIntegral).reversed().thenComparing(WorldCupRankVo::getTotalSession).reversed().thenComparing(WorldCupRankVo::getWinRate).reversed()).collect(Collectors.toList()); |
| | | int a=1; |
| | | for (WorldCupRankVo worldCupRankVo : list) { |
| | | worldCupRankVo.setRank(a); |
| | | a++; |
| | | } |
| | | return list; |
| | | } |
| | | |
| | |
| | | } |
| | | map.put("startTime", sdf.format(cupCompetitor.getStartTime())); |
| | | map.put("score", cupCompetitor.getOurScore() + ":" + cupCompetitor.getOpponentScore()); |
| | | map.put("matchResult", cupCompetitor.getMatchResult() == 1 ? "胜" : cupCompetitor.getMatchResult() == 0 ? "平" : "负"); |
| | | map.put("matchResult", cupCompetitor.getMatchResult() == 1 ? "胜" : (cupCompetitor.getMatchResult() == 0 ? "平" : "负")); |
| | | map.put("blue", cupCompetitor.getParticipant() == 1 ? cupCompetitor.getOurScore() : cupCompetitor.getOpponentScore()); |
| | | map.put("red", cupCompetitor.getParticipant() == 2 ? cupCompetitor.getOurScore() : cupCompetitor.getOpponentScore()); |
| | | mapList.add(map); |