From 46030cd9ab8ac9cf229b645253239643757927f8 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期五, 29 八月 2025 19:31:30 +0800
Subject: [PATCH] 赛事

---
 cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java           |    2 +-
 cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java              |    2 +-
 cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java |    9 +++++++--
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java
index fbdb7c1..77570a4 100644
--- a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java
+++ b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java
@@ -1396,7 +1396,7 @@
                     vo.setType(10);
                     userIntegralChangesClient.saveUserIntegralChanges(vo);
                 }
-                worldCupCompetitor.setOpponentScore(redScore);
+                worldCupCompetitor.setOpponentScore(blueScore);
                 worldCupCompetitor.setParticipationIntegral(worldCup.getParticipationIntegral());
                 //增加积分明细
                 SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo();
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 6ec3abd..0b03835 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
@@ -247,7 +247,6 @@
 //            });
 //        }
 
-
         List<WorldCupRankVo> list = new ArrayList<>();
         for (int i = 0; i < mapList.size(); i++) {
             Map<String, Object> map = mapList.get(i);
@@ -303,6 +302,7 @@
             if(i == 19 && b){
                 break;
             }
+
             //排名前20的数据添加完成后且包含自己,需要将自己找出来后添加到21位
             if(i > 19 && !b){
                 if(worldCupRank.getIsStudent().compareTo(participantType) == 0 && worldCupRank.getId().compareTo(participantId) == 0){
@@ -343,6 +343,11 @@
         }
         // 排序
         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;
     }
 
@@ -668,7 +673,7 @@
             }
             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);
diff --git a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java
index 27ee251..73c0a76 100644
--- a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java
+++ b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java
@@ -1084,7 +1084,7 @@
                         vo.setType(9);
                         userIntegralChangesClient.saveUserIntegralChanges(vo);
                     }else if(null != worldCup.getLoseIntegral() && 0 < worldCup.getLoseIntegral() && blue_score.compareTo(red_score) < 0){
-                        worldCupCompetitor.setDrawIntegral(worldCup.getLoseIntegral());
+                        worldCupCompetitor.setLoseIntegral(worldCup.getLoseIntegral());
                         //增加积分明细
                         SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo();
                         vo.setAppUserId(worldCupCompetitor.getAppUserId());

--
Gitblit v1.7.1