From b27efc697f2f81e0d0f247a2708e58af52a5df9b Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 23 十月 2025 15:14:33 +0800
Subject: [PATCH] bug修改,后台新增修改用户积分
---
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java | 32 ++++++++++++++++++++------------
1 files changed, 20 insertions(+), 12 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 44e8560..bf8431e 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
@@ -619,6 +619,8 @@
if(null == uid){
return ResultUtil.success();
}
+ System.err.println("11111"+entrantRank);
+
entrantRank.setAppUserId(uid);
EntrantRankVo entrantRank1 = worldCupCompetitorService.getEntrantRank(entrantRank);
return ResultUtil.success(entrantRank1);
@@ -719,8 +721,11 @@
if(null == uid){
return ResultUtil.tokenErr();
}
+ System.err.println("22222"+worldCupRank);
+
worldCupRank.setAppUserId(uid);
List<WorldCupRankVo> worldCupRank1 = worldCupCompetitorService.getWorldCupRank(worldCupRank);
+ System.err.println("排名数据"+worldCupRank1);
return ResultUtil.success(worldCupRank1);
}catch (Exception e){
e.printStackTrace();
@@ -736,6 +741,7 @@
})
public ResultUtil<List<WorldCupListVo>> getWorldCupListFromRank(MyWorldCupList myWorldCupList){
try {
+ System.err.println("33333"+myWorldCupList);
Integer uid = tokenUtil.getUserIdFormRedis();
if(null == uid){
return ResultUtil.tokenErr();
@@ -1240,27 +1246,27 @@
public List<WorldCupUserListVo> userDetailsOfSearch(@RequestBody UserDetailsOfSearch search){
// 已报名的用户
List<WorldCupPaymentParticipant> list = worldCupPaymentParticipantService.list(new LambdaQueryWrapper<WorldCupPaymentParticipant>().eq(WorldCupPaymentParticipant::getWorldCupId, search.getId())
- .eq(WorldCupPaymentParticipant::getAlreadyEntered, 0));
+ );
ArrayList<WorldCupUserListVo> worldCupUserListVos = new ArrayList<>();
if(list.size()>0){
- List<Integer> collect = list.stream().map(WorldCupPaymentParticipant::getAppUserId).collect(Collectors.toList());
+ List<Long> collect = list.stream().map(WorldCupPaymentParticipant::getParticipantId).collect(Collectors.toList());
search.setUseIds(collect);
- List<AppUser> appUsers = appUserClient.queryAppUserByIds(search);
+ List<TStudent> appUsers = appUserClient.queryAppUserByIds(search);
- for (AppUser appUser : appUsers) {
+ for (TStudent appUser : appUsers) {
WorldCupUserListVo worldCupUserListVo = new WorldCupUserListVo();
- WorldCupPaymentParticipant worldCupPaymentParticipant = list.stream().filter(e -> e.getAppUserId().equals(appUser.getId())).findFirst().orElse(null);
+ WorldCupPaymentParticipant worldCupPaymentParticipant = list.stream().filter(e -> e.getParticipantId().toString().equals(appUser.getId().toString())).findFirst().orElse(null);
if(worldCupPaymentParticipant!=null){
- worldCupUserListVo.setId(worldCupPaymentParticipant.getId());
+ worldCupUserListVo.setId(worldCupPaymentParticipant.getId().toString());
worldCupUserListVo.setName(appUser.getName());
- worldCupUserListVo.setSex(appUser.getGender() !=null && appUser.getGender()==2?"女":"男");
+ worldCupUserListVo.setSex(appUser.getSex() !=null && appUser.getSex()==2?"女":"男");
worldCupUserListVo.setPhone(appUser.getPhone());
worldCupUserListVo.setIdCard(appUser.getIdCard());
// 当前日期和生日计算年龄
Date birthday = appUser.getBirthday();
LocalDate now = LocalDate.now();
if(birthday!=null){
- int age = now.getYear() - birthday.getYear();
+ int age = now.getYear() - (birthday.getYear()+1900);
worldCupUserListVo.setAge(age);
}
worldCupUserListVos.add(worldCupUserListVo);
@@ -1297,7 +1303,7 @@
String code = UUIDUtil.getTimeStr() + UUIDUtil.getNumberRandom(3);
ArrayList<WorldCupCompetitor> worldCupCompetitors = new ArrayList<>(red.length + blue.length);
for (String s : blue) {
- WorldCupPaymentParticipant worldCupPaymentParticipant = list1.stream().filter(e -> e.getId().equals(s)).findFirst().orElse(null);
+ WorldCupPaymentParticipant worldCupPaymentParticipant = list1.stream().filter(e -> e.getId().toString().equals(s)).findFirst().orElse(null);
if(worldCupPaymentParticipant!=null){
WorldCupCompetitor worldCupCompetitor =new WorldCupCompetitor();
worldCupCompetitor.setCode(code);
@@ -1308,6 +1314,7 @@
worldCupCompetitor.setParticipant(1);
worldCupCompetitor.setStartTime(startTime);
worldCupCompetitor.setEndTime(endTime);
+ worldCupCompetitor.setOurScore(blueScore);
if(blueScore>redScore){
worldCupCompetitor.setMatchResult(1);
worldCupCompetitor.setWinIntegral(worldCup.getWinIntegral());
@@ -1353,7 +1360,7 @@
}
for (String s : red) {
- WorldCupPaymentParticipant worldCupPaymentParticipant = list1.stream().filter(e -> e.getId().equals(s)).findFirst().orElse(null);
+ WorldCupPaymentParticipant worldCupPaymentParticipant = list1.stream().filter(e -> e.getId().toString().equals(s)).findFirst().orElse(null);
if(worldCupPaymentParticipant!=null){
WorldCupCompetitor worldCupCompetitor =new WorldCupCompetitor();
worldCupCompetitor.setCode(code);
@@ -1361,9 +1368,10 @@
worldCupCompetitor.setParticipantType(worldCupPaymentParticipant.getParticipantType());
worldCupCompetitor.setAppUserId(worldCupPaymentParticipant.getAppUserId());
worldCupCompetitor.setParticipantId(worldCupPaymentParticipant.getParticipantId());
- worldCupCompetitor.setParticipant(1);
+ worldCupCompetitor.setParticipant(2);
worldCupCompetitor.setStartTime(startTime);
worldCupCompetitor.setEndTime(endTime);
+ worldCupCompetitor.setOurScore(redScore);
if(redScore>blueScore){
worldCupCompetitor.setMatchResult(1);
worldCupCompetitor.setWinIntegral(worldCup.getWinIntegral());
@@ -1394,7 +1402,7 @@
vo.setType(10);
userIntegralChangesClient.saveUserIntegralChanges(vo);
}
- worldCupCompetitor.setOpponentScore(redScore);
+ worldCupCompetitor.setOpponentScore(blueScore);
worldCupCompetitor.setParticipationIntegral(worldCup.getParticipationIntegral());
//增加积分明细
SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo();
--
Gitblit v1.7.1