| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.HH.dd HH:mm"); |
| | | for (WorldCupCompetitor cupCompetitor : list) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", cupCompetitor.getId()); |
| | | map.put("id", cupCompetitor.getId().toString()); |
| | | if(1 == participantType){ |
| | | TStudent tStudent = studentClient.queryById(participantId.intValue()); |
| | | if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){ |
| | |
| | | map.put("name", participant.getName()); |
| | | } |
| | | map.put("startTime", sdf.format(cupCompetitor.getStartTime())); |
| | | map.put("score", cupCompetitor.getOurScore().compareTo(cupCompetitor.getOpponentScore()) > 0 ? |
| | | cupCompetitor.getOurScore() + ":" + cupCompetitor.getOpponentScore() : |
| | | cupCompetitor.getOpponentScore() + ":" + cupCompetitor.getOurScore()); |
| | | map.put("score", cupCompetitor.getOurScore() + ":" + cupCompetitor.getOpponentScore()); |
| | | 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); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | Integer red = changeScore.getRed(); |
| | | WorldCupCompetitor worldCupCompetitor = this.getById(id); |
| | | List<WorldCupCompetitor> blueList = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode()) |
| | | .eq("participant", 1)); |
| | | .eq("participant", 1).eq("worldCupId", worldCupCompetitor.getWorldCupId())); |
| | | WorldCup worldCup = worldCupService.getById(blueList.get(0).getWorldCupId()); |
| | | for (WorldCupCompetitor cupCompetitor : blueList) { |
| | | //如果之前输了,现在赢/平了,需要增加积分 |
| | |
| | | } |
| | | cupCompetitor.setOurScore(blue); |
| | | cupCompetitor.setOpponentScore(red); |
| | | cupCompetitor.setWorldCupId(null); |
| | | } |
| | | this.updateBatchById(blueList); |
| | | |
| | | List<WorldCupCompetitor> redList = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode()).eq("participant", 2)); |
| | | List<WorldCupCompetitor> redList = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode()) |
| | | .eq("participant", 2).eq("worldCupId", worldCupCompetitor.getWorldCupId())); |
| | | for (WorldCupCompetitor cupCompetitor : redList) { |
| | | //如果之前输了,现在赢/平了,需要增加积分 |
| | | if(cupCompetitor.getMatchResult() == -1 && (red.compareTo(blue) > 0 || red.compareTo(blue) == 0)){ |
| | |
| | | } |
| | | cupCompetitor.setOurScore(red); |
| | | cupCompetitor.setOpponentScore(blue); |
| | | cupCompetitor.setWorldCupId(null); |
| | | } |
| | | this.updateBatchById(blueList); |
| | | this.updateBatchById(redList); |
| | | |
| | | |
| | | //修改勋章 |