| | |
| | | import com.dsh.communityWorldCup.entity.WorldCupCompetitor; |
| | | import com.dsh.communityWorldCup.feignclient.account.AppUserClient; |
| | | import com.dsh.communityWorldCup.feignclient.account.StudentClient; |
| | | import com.dsh.communityWorldCup.feignclient.account.StudentHonorClient; |
| | | import com.dsh.communityWorldCup.feignclient.account.UserIntegralChangesClient; |
| | | import com.dsh.communityWorldCup.feignclient.account.model.AppUser; |
| | | import com.dsh.communityWorldCup.feignclient.account.model.AppUserIdsByCityName; |
| | | import com.dsh.communityWorldCup.feignclient.account.model.SaveUserIntegralChangesVo; |
| | | import com.dsh.communityWorldCup.feignclient.account.model.TStudent; |
| | | import com.dsh.communityWorldCup.feignclient.account.model.*; |
| | | import com.dsh.communityWorldCup.feignclient.competition.ParticipantClient; |
| | | import com.dsh.communityWorldCup.feignclient.competition.model.Participant; |
| | | import com.dsh.communityWorldCup.feignclient.other.StoreClient; |
| | |
| | | |
| | | @Resource |
| | | private UserIntegralChangesClient userIntegralChangesClient; |
| | | |
| | | @Resource |
| | | private StudentHonorClient studentHonorClient; |
| | | |
| | | |
| | | |
| | |
| | | worldCupRankVo.setName(name); |
| | | |
| | | } |
| | | if(worldCupRank.getIsStudent().equals(participantType) && worldCupRank.getId().equals(participantId)){ |
| | | if(worldCupRank.getIsStudent().compareTo(participantType) == 0 && worldCupRank.getId().compareTo(participantId) == 0){ |
| | | worldCupRankVo.setOneself(1); |
| | | b = true; |
| | | }else{ |
| | |
| | | } |
| | | //排名前20的数据添加完成后且包含自己,需要将自己找出来后添加到21位 |
| | | if(i > 19 && !b){ |
| | | if(worldCupRank.getIsStudent().equals(participantType) && worldCupRank.getId().equals(participantId)){ |
| | | if(worldCupRank.getIsStudent().compareTo(participantType) == 0 && worldCupRank.getId().compareTo(participantId) == 0){ |
| | | WorldCupRankVo worldCupRankVo = new WorldCupRankVo(); |
| | | worldCupRankVo.setRank(i + 1); |
| | | worldCupRankVo.setTotalSession(totalSession); |
| | |
| | | } |
| | | |
| | | this.updateBatchById(worldCupCompetitors); |
| | | |
| | | //添加勋章 |
| | | for (WorldCupCompetitor worldCupCompetitor : worldCupCompetitors) { |
| | | Integer appUserId = worldCupCompetitor.getAppUserId(); |
| | | //常胜将军 |
| | | if(1 == worldCupCompetitor.getMatchResult()){ |
| | | int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("appUserId", appUserId).eq("matchResult", 1)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(appUserId); |
| | | studentHonor.setHonorType(5); |
| | | studentHonor.setNumber(count); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | } |
| | | //越战越勇 |
| | | int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("appUserId", appUserId)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(appUserId); |
| | | studentHonor.setHonorType(6); |
| | | studentHonor.setNumber(count); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | if(1 == participantType){ |
| | | TStudent tStudent = studentClient.queryById(participantId.intValue()); |
| | | map.put("name", tStudent.getName()); |
| | | map.put("phone", tStudent.getPhone()); |
| | | map.put("phone", ToolUtil.isNotEmpty(tStudent.getPhone()) ? tStudent.getPhone() : appUser.getPhone()); |
| | | }else{ |
| | | Participant participant = participantClient.getParticipant(participantId); |
| | | map.put("name", participant.getName()); |
| | | map.put("phone", participant.getPhone()); |
| | | map.put("phone", ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()); |
| | | } |
| | | } |
| | | Integer offset = worldCupRecords.getOffset(); |
| | |
| | | cupCompetitor.setOpponentScore(blue); |
| | | } |
| | | this.updateBatchById(blueList); |
| | | |
| | | |
| | | //修改勋章 |
| | | List<WorldCupCompetitor> worldCupCompetitors = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode())); |
| | | for (WorldCupCompetitor wcc : worldCupCompetitors) { |
| | | Integer appUserId = wcc.getAppUserId(); |
| | | //常胜将军 |
| | | if(1 == wcc.getMatchResult()){ |
| | | int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("appUserId", appUserId).eq("matchResult", 1)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(appUserId); |
| | | studentHonor.setHonorType(5); |
| | | studentHonor.setNumber(count); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | } |
| | | //越战越勇 |
| | | int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("appUserId", appUserId)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(appUserId); |
| | | studentHonor.setHonorType(6); |
| | | studentHonor.setNumber(count); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | } |
| | | |
| | | } |
| | | |
| | | |