From 7cd3dea07f5b7cefad9dea9fd7daf992449aaac8 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期二, 12 三月 2024 18:24:38 +0800 Subject: [PATCH] 修改bug --- cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java | 33 +++++++++++++++++++++------------ 1 files changed, 21 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 c4d585a..08d83a7 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 @@ -145,7 +145,7 @@ matchRecord.setPageNo(pageNo); MatchRecordVo matchRecordVo = new MatchRecordVo(); int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("participantId", matchRecord.getId()) - .eq("participantType", matchRecord.getIsStudent())); + .eq("participantType", matchRecord.getIsStudent()).isNotNull("matchResult")); matchRecordVo.setTotalSession(count); List<MatchRecordList> matchRecord1 = this.baseMapper.getMatchRecord(matchRecord); matchRecordVo.setList(matchRecord1); @@ -196,9 +196,8 @@ } //参赛人员 if(participantType == 2){ - AppUser appUser1 = appUserClient.getAppUser(appUserId); Participant participant = participantClient.getParticipant(participantId); - worldCupRankVo.setAvatar(appUser1.getHeadImg()); + worldCupRankVo.setAvatar(participant.getHeadImg()); String name = participant.getName(); if(name.length() > 2){ name = name.charAt(0) + "*" + name.substring(2); @@ -242,9 +241,8 @@ } //参赛人员 if(participantType == 2){ - AppUser appUser1 = appUserClient.getAppUser(appUserId); Participant participant = participantClient.getParticipant(participantId); - worldCupRankVo.setAvatar(appUser1.getHeadImg()); + worldCupRankVo.setAvatar(participant.getHeadImg()); String name = participant.getName(); if(name.length() > 2){ name = name.charAt(0) + "*" + name.substring(2); @@ -398,7 +396,7 @@ if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){ continue; } - if(ToolUtil.isNotEmpty(phone) && tStudent.getPhone().indexOf(phone) == -1){ + if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone()).indexOf(phone) == -1){ continue; } if(ToolUtil.isNotEmpty(idcard) && tStudent.getIdCard().indexOf(idcard) == -1){ @@ -407,12 +405,13 @@ map.put("name", tStudent.getName()); map.put("phone", ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone()); + map.put("idcard", tStudent.getIdCard()); }else{ Participant participant = participantClient.getParticipant(participantId); if(ToolUtil.isNotEmpty(name) && participant.getName().indexOf(name) == -1){ continue; } - if(ToolUtil.isNotEmpty(phone) && participant.getPhone().indexOf(phone) == -1){ + if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()).indexOf(phone) == -1){ continue; } if(ToolUtil.isNotEmpty(idcard) && participant.getIdcard().indexOf(idcard) == -1){ @@ -421,14 +420,15 @@ map.put("name", participant.getName()); map.put("phone", ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()); + map.put("idcard", participant.getIdcard()); } list.add(map); } - map1.put("total", mapList.size()); + map1.put("total", list.size()); Integer offset = worldCupGameStatisticsInfoList.getOffset(); Integer limit = worldCupGameStatisticsInfoList.getLimit(); limit += offset; - map1.put("rows", mapList.subList(offset, mapList.size() >= limit ? limit : mapList.size())); + map1.put("rows", list.subList(offset, list.size() >= limit ? limit : list.size())); return map1; } @@ -607,9 +607,7 @@ } map.put("userName", participant.getName()); } - map.put("score", ourScore.compareTo(opponentScore) > 0 ? - ourScore + ":" + opponentScore : - opponentScore + ":" + ourScore); + map.put("score", ourScore + ":" + opponentScore); map.put("matchResult", matchResult == 1 ? "胜" : matchResult == 0 ? "平" :"负"); mapList.add(map); } @@ -621,4 +619,15 @@ map.put("rows", mapList.subList(offset, mapList.size() >= limit ? limit : mapList.size())); return map; } + + + /** + * 获取比赛场次 + * @param worldCupId + * @return + */ + @Override + public int getMatchTime(Integer worldCupId) { + return this.baseMapper.getMatchTime(worldCupId); + } } -- Gitblit v1.7.1