| | |
| | | worldCupCompetitor.setWinIntegral(0); |
| | | if(null != worldCup.getWinIntegral() && 0 < worldCup.getWinIntegral() && blue_score.compareTo(red_score) >= 0){ |
| | | worldCupCompetitor.setWinIntegral(worldCup.getWinIntegral()); |
| | | AppUser appUser = appUserClient.getAppUser(worldCupCompetitor.getAppUserId()); |
| | | appUser.setIntegral(appUser.getIntegral() + worldCup.getWinIntegral()); |
| | | appUserClient.updateAppUser(appUser); |
| | | //增加积分明细 |
| | | SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo(); |
| | | vo.setAppUserId(appUser.getId()); |
| | | vo.setAppUserId(worldCupCompetitor.getAppUserId()); |
| | | vo.setIntegral(worldCup.getWinIntegral()); |
| | | vo.setType(7); |
| | | userIntegralChangesClient.saveUserIntegralChanges(vo); |
| | |
| | | worldCupCompetitor.setWinIntegral(0); |
| | | if(null != worldCup.getWinIntegral() && 0 < worldCup.getWinIntegral() && red_score.compareTo(blue_score) >= 0){ |
| | | worldCupCompetitor.setWinIntegral(worldCup.getWinIntegral()); |
| | | AppUser appUser = appUserClient.getAppUser(worldCupCompetitor.getAppUserId()); |
| | | appUser.setIntegral(appUser.getIntegral() + worldCup.getWinIntegral()); |
| | | appUserClient.updateAppUser(appUser); |
| | | //增加积分明细 |
| | | SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo(); |
| | | vo.setAppUserId(appUser.getId()); |
| | | vo.setAppUserId(worldCupCompetitor.getAppUserId()); |
| | | vo.setIntegral(worldCup.getWinIntegral()); |
| | | vo.setType(7); |
| | | userIntegralChangesClient.saveUserIntegralChanges(vo); |
| | |
| | | map.put("score", cupCompetitor.getOurScore().compareTo(cupCompetitor.getOpponentScore()) > 0 ? |
| | | cupCompetitor.getOurScore() + ":" + cupCompetitor.getOpponentScore() : |
| | | cupCompetitor.getOpponentScore() + ":" + cupCompetitor.getOurScore()); |
| | | map.put("matchResult", cupCompetitor.getMatchResult() == 1 ? "胜" : "负"); |
| | | map.put("matchResult", cupCompetitor.getMatchResult() == 1 ? "胜" : cupCompetitor.getMatchResult() == 0 ? "平" : "负"); |
| | | mapList.add(map); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | Integer blue = changeScore.getBlue(); |
| | | Integer red = changeScore.getRed(); |
| | | WorldCupCompetitor worldCupCompetitor = this.getById(id); |
| | | List<WorldCupCompetitor> blueList = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode()).eq("participant", 1)); |
| | | List<WorldCupCompetitor> blueList = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode()) |
| | | .eq("participant", 1)); |
| | | WorldCup worldCup = worldCupService.getById(blueList.get(0).getWorldCupId()); |
| | | for (WorldCupCompetitor cupCompetitor : blueList) { |
| | | //如果之前输了,现在赢了,需要增加积分 |
| | | if(cupCompetitor.getMatchResult() == -1 && blue.compareTo(red) > 0){ |
| | | AppUser appUser = appUserClient.getAppUser(cupCompetitor.getAppUserId()); |
| | | appUser.setIntegral(appUser.getIntegral() + worldCup.getWinIntegral()); |
| | | appUserClient.updateAppUser(appUser); |
| | | //如果之前输了,现在赢/平了,需要增加积分 |
| | | if(cupCompetitor.getMatchResult() == -1 && (blue.compareTo(red) > 0 || blue.compareTo(red) == 0)){ |
| | | //增加积分明细 |
| | | SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo(); |
| | | vo.setAppUserId(cupCompetitor.getAppUserId()); |
| | | vo.setIntegral(worldCup.getWinIntegral()); |
| | | vo.setType(7); |
| | | userIntegralChangesClient.saveUserIntegralChanges(vo); |
| | | |
| | | cupCompetitor.setMatchResult(1); |
| | | cupCompetitor.setWinIntegral(worldCup.getWinIntegral()); |
| | | } |
| | | //如果之前赢了,现在输了,需要扣减积分 |
| | | if(cupCompetitor.getMatchResult() == 1 && blue.compareTo(red) < 0){ |
| | | AppUser appUser = appUserClient.getAppUser(cupCompetitor.getAppUserId()); |
| | | appUser.setIntegral(appUser.getIntegral() - worldCup.getWinIntegral()); |
| | | appUserClient.updateAppUser(appUser); |
| | | //增加积分明细 |
| | | SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo(); |
| | | vo.setAppUserId(cupCompetitor.getAppUserId()); |
| | | vo.setIntegral(worldCup.getWinIntegral() * -1); |
| | | vo.setType(8); |
| | | userIntegralChangesClient.saveUserIntegralChanges(vo); |
| | | |
| | | cupCompetitor.setMatchResult(-1); |
| | | cupCompetitor.setWinIntegral(0); |
| | | } |
| | | //如果之前平了,现在输了,需要扣减积分 |
| | | if(cupCompetitor.getMatchResult() == 0 && blue.compareTo(red) < 0){ |
| | | //增加积分明细 |
| | | SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo(); |
| | | vo.setAppUserId(cupCompetitor.getAppUserId()); |
| | | vo.setIntegral(worldCup.getWinIntegral() * -1); |
| | | vo.setType(8); |
| | | userIntegralChangesClient.saveUserIntegralChanges(vo); |
| | | |
| | | cupCompetitor.setMatchResult(-1); |
| | | cupCompetitor.setWinIntegral(0); |
| | |
| | | |
| | | List<WorldCupCompetitor> redList = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode()).eq("participant", 2)); |
| | | for (WorldCupCompetitor cupCompetitor : redList) { |
| | | //如果之前输了,现在赢了,需要增加积分 |
| | | if(cupCompetitor.getMatchResult() == -1 && red.compareTo(blue) > 0){ |
| | | AppUser appUser = appUserClient.getAppUser(cupCompetitor.getAppUserId()); |
| | | appUser.setIntegral(appUser.getIntegral() + worldCup.getWinIntegral()); |
| | | appUserClient.updateAppUser(appUser); |
| | | //如果之前输了,现在赢/平了,需要增加积分 |
| | | if(cupCompetitor.getMatchResult() == -1 && (red.compareTo(blue) > 0 || red.compareTo(blue) == 0)){ |
| | | //增加积分明细 |
| | | SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo(); |
| | | vo.setAppUserId(cupCompetitor.getAppUserId()); |
| | | vo.setIntegral(worldCup.getWinIntegral()); |
| | | vo.setType(7); |
| | | userIntegralChangesClient.saveUserIntegralChanges(vo); |
| | | |
| | | cupCompetitor.setMatchResult(1); |
| | | cupCompetitor.setWinIntegral(worldCup.getWinIntegral()); |
| | | } |
| | | //如果之前赢了,现在输了,需要扣减积分 |
| | | if(cupCompetitor.getMatchResult() == 1 && red.compareTo(blue) < 0){ |
| | | AppUser appUser = appUserClient.getAppUser(cupCompetitor.getAppUserId()); |
| | | appUser.setIntegral(appUser.getIntegral() - worldCup.getWinIntegral()); |
| | | appUserClient.updateAppUser(appUser); |
| | | //增加积分明细 |
| | | SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo(); |
| | | vo.setAppUserId(cupCompetitor.getAppUserId()); |
| | | vo.setIntegral(worldCup.getWinIntegral() * -1); |
| | | vo.setType(8); |
| | | userIntegralChangesClient.saveUserIntegralChanges(vo); |
| | | |
| | | cupCompetitor.setMatchResult(-1); |
| | | cupCompetitor.setWinIntegral(0); |
| | | } |
| | | //如果之前平了,现在输了,需要扣减积分 |
| | | if(cupCompetitor.getMatchResult() == 0 && red.compareTo(blue) < 0){ |
| | | //增加积分明细 |
| | | SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo(); |
| | | vo.setAppUserId(cupCompetitor.getAppUserId()); |
| | | vo.setIntegral(worldCup.getWinIntegral() * -1); |
| | | vo.setType(8); |
| | | userIntegralChangesClient.saveUserIntegralChanges(vo); |
| | | |
| | | cupCompetitor.setMatchResult(-1); |
| | | cupCompetitor.setWinIntegral(0); |
| | |
| | | map.put("score", ourScore.compareTo(opponentScore) > 0 ? |
| | | ourScore + ":" + opponentScore : |
| | | opponentScore + ":" + ourScore); |
| | | map.put("matchResult", matchResult == 1 ? "胜" : "负"); |
| | | map.put("matchResult", matchResult == 1 ? "胜" : matchResult == 0 ? "平" :"负"); |
| | | mapList.add(map); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |