From db3e6f6d5a8f29a5dc576aba2eab76a8133ce03c Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期五, 08 三月 2024 21:46:10 +0800
Subject: [PATCH] 11.27,9
---
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 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 512837e..88902cb 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
@@ -172,6 +172,7 @@
boolean b = false;
if(i <= 19){
WorldCupRankVo worldCupRankVo = new WorldCupRankVo();
+ worldCupRankVo.setRank(i + 1);
worldCupRankVo.setTotalSession(totalSession);
worldCupRankVo.setWinRate(winRate);
//学员
@@ -217,6 +218,7 @@
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);
//学员
@@ -369,6 +371,8 @@
Integer win = Integer.valueOf(map.get("win").toString());
Integer lose = totalSession - win;
map.put("lose", lose);
+ map.put("participantType", participantType);
+ map.put("participantId", participantId);
AppUser appUser = appUserClient.getAppUser(appUserId);
map.put("province", appUser.getProvince() + appUser.getCity());
if(1 == participantType){
@@ -517,4 +521,49 @@
}
this.updateBatchById(blueList);
}
+
+
+ /**
+ * 获取用户比赛记录详情
+ * @param userGameRecordList
+ * @return
+ */
+ @Override
+ public Map<String, Object> userGameRecordList(UserGameRecordList userGameRecordList) {
+ String name = userGameRecordList.getUserName();
+ List<Map<String, Object>> list = this.baseMapper.userGameRecordList(userGameRecordList.getName());
+ 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());
+ 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);
+ if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){
+ continue;
+ }
+ map.put("userName", tStudent.getName());
+ }else{
+ Participant participant = participantClient.getParticipant(participantId);
+ if(ToolUtil.isNotEmpty(name) && participant.getName().indexOf(name) == -1){
+ continue;
+ }
+ map.put("userName", participant.getName());
+ }
+ map.put("score", ourScore.compareTo(opponentScore) > 0 ?
+ ourScore + ":" + opponentScore :
+ opponentScore + ":" + ourScore);
+ map.put("matchResult", matchResult == 1 ? "胜" : "负");
+ mapList.add(map);
+ }
+ Map<String, Object> map = new HashMap<>();
+ map.put("total", mapList.size());
+ Integer offset = userGameRecordList.getOffset();
+ Integer limit = userGameRecordList.getLimit();
+ limit += offset;
+ map.put("rows", mapList.subList(offset, mapList.size() >= limit ? limit : mapList.size()));
+ return map;
+ }
}
--
Gitblit v1.7.1