From 7501140cf637fef9629a80202907ed067c8a5a06 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期五, 08 三月 2024 20:07:45 +0800 Subject: [PATCH] 添加方法 --- cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java | 26 ++++++++++++++------------ 1 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java index 3b339fb..f3c89ee 100644 --- a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java +++ b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java @@ -65,7 +65,7 @@ entrantRankVo.setName(participant.getName()); }else{ //学员 - TStudent tStudent = studentClient.queryById(entrantRank.getId()); + TStudent tStudent = studentClient.queryById(entrantRank.getId().intValue()); entrantRankVo.setName(tStudent.getName()); } //全国排名---直接数据库分组查询后排序 @@ -164,7 +164,7 @@ for (int i = 0; i < lists.size(); i++) { Map<String, Object> map = lists.get(i); Integer participantType = Integer.valueOf(map.get("participantType").toString()); - Integer participantId = Integer.valueOf(map.get("participantId").toString()); + Long participantId = Long.valueOf(map.get("participantId").toString()); Integer appUserId = Integer.valueOf(map.get("appUserId").toString()); Integer totalSession = Integer.valueOf(map.get("totalSession").toString()); Double winRate = Double.valueOf(map.get("winRate").toString()); @@ -172,11 +172,12 @@ boolean b = false; if(i <= 19){ WorldCupRankVo worldCupRankVo = new WorldCupRankVo(); + worldCupRankVo.setRank(i + 1); worldCupRankVo.setTotalSession(totalSession); worldCupRankVo.setWinRate(winRate); //学员 if(participantType == 1){ - TStudent tStudent = studentClient.queryById(participantId); + TStudent tStudent = studentClient.queryById(participantId.intValue()); worldCupRankVo.setAvatar(tStudent.getHeadImg()); String name = tStudent.getName(); if(name.length() > 2){ @@ -217,11 +218,12 @@ if(i > 19 && !b){ if(worldCupRank.getIsStudent().equals(participantType) && worldCupRank.getId().equals(participantId)){ WorldCupRankVo worldCupRankVo = new WorldCupRankVo(); + worldCupRankVo.setRank(i + 1); worldCupRankVo.setTotalSession(totalSession); worldCupRankVo.setWinRate(winRate); //学员 if(participantType == 1){ - TStudent tStudent = studentClient.queryById(participantId); + TStudent tStudent = studentClient.queryById(participantId.intValue()); worldCupRankVo.setAvatar(tStudent.getHeadImg()); String name = tStudent.getName(); if(name.length() > 2){ @@ -318,7 +320,7 @@ for (int i = 0; i < mapList.size(); i++) { Map<String, Object> map = mapList.get(i); Integer participantType = Integer.valueOf(map.get("participantType").toString()); - Integer participantId = Integer.valueOf(map.get("participantId").toString()); + Long participantId = Long.valueOf(map.get("participantId").toString()); Integer appUserId = Integer.valueOf(map.get("appUserId").toString()); Integer totalSession = Integer.valueOf(map.get("totalSession").toString()); Integer win = Integer.valueOf(map.get("win").toString()); @@ -327,7 +329,7 @@ AppUser appUser = appUserClient.getAppUser(appUserId); map.put("province", appUser.getProvince() + appUser.getCity()); if(1 == participantType){ - TStudent tStudent = studentClient.queryById(participantId); + TStudent tStudent = studentClient.queryById(participantId.intValue()); map.put("name", tStudent.getName()); map.put("phone", tStudent.getPhone()); }else{ @@ -363,7 +365,7 @@ for (int i = 0; i < mapList.size(); i++) { Map<String, Object> map = mapList.get(i); Integer participantType = Integer.valueOf(map.get("participantType").toString()); - Integer participantId = Integer.valueOf(map.get("participantId").toString()); + Long participantId = Long.valueOf(map.get("participantId").toString()); Integer appUserId = Integer.valueOf(map.get("appUserId").toString()); Integer totalSession = Integer.valueOf(map.get("totalSession").toString()); Integer win = Integer.valueOf(map.get("win").toString()); @@ -374,7 +376,7 @@ AppUser appUser = appUserClient.getAppUser(appUserId); map.put("province", appUser.getProvince() + appUser.getCity()); if(1 == participantType){ - TStudent tStudent = studentClient.queryById(participantId); + TStudent tStudent = studentClient.queryById(participantId.intValue()); if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){ continue; } @@ -429,9 +431,9 @@ Map<String, Object> map = new HashMap<>(); map.put("id", cupCompetitor.getId()); Integer participantType = cupCompetitor.getParticipantType(); - Integer participantId = cupCompetitor.getParticipantId(); + Long participantId = cupCompetitor.getParticipantId(); if(1 == participantType){ - TStudent tStudent = studentClient.queryById(participantId); + TStudent tStudent = studentClient.queryById(participantId.intValue()); if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){ continue; } @@ -533,12 +535,12 @@ List<Map<String, Object>> mapList = new ArrayList<>(); for (Map<String, Object> map : list) { Long participantType = Long.valueOf(map.get("participantType").toString()); - Integer participantId = Integer.valueOf(map.get("participantId").toString()); + Long participantId = Long.valueOf(map.get("participantId").toString()); Integer ourScore = Integer.valueOf(map.get("ourScore").toString()); Integer opponentScore = Integer.valueOf(map.get("opponentScore").toString()); Integer matchResult = Integer.valueOf(map.get("matchResult").toString()); if(1 == participantType){ - TStudent tStudent = studentClient.queryById(participantId); + TStudent tStudent = studentClient.queryById(participantId.intValue()); if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){ continue; } -- Gitblit v1.7.1