| | |
| | | Integer win = Integer.valueOf(map.get("win").toString()); |
| | | Integer lose = totalSession - win; |
| | | map.put("lose", lose); |
| | | map.put("participantType", participantType); |
| | | map.put("participantId", participantId); |
| | | AppUser appUser = appUserClient.getAppUser(appUserId); |
| | | map.put("province", appUser.getProvince() + appUser.getCity()); |
| | | if(1 == participantType){ |
| | |
| | | } |
| | | this.updateBatchById(blueList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户比赛记录详情 |
| | | * @param userGameRecordList |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> userGameRecordList(UserGameRecordList userGameRecordList) { |
| | | String name = userGameRecordList.getUserName(); |
| | | List<Map<String, Object>> list = this.baseMapper.userGameRecordList(userGameRecordList.getName()); |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | for (Map<String, Object> map : list) { |
| | | Long participantType = Long.valueOf(map.get("participantType").toString()); |
| | | Integer participantId = Integer.valueOf(map.get("participantId").toString()); |
| | | Integer ourScore = Integer.valueOf(map.get("ourScore").toString()); |
| | | Integer opponentScore = Integer.valueOf(map.get("opponentScore").toString()); |
| | | Integer matchResult = Integer.valueOf(map.get("matchResult").toString()); |
| | | if(1 == participantType){ |
| | | TStudent tStudent = studentClient.queryById(participantId); |
| | | if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){ |
| | | continue; |
| | | } |
| | | map.put("userName", tStudent.getName()); |
| | | }else{ |
| | | Participant participant = participantClient.getParticipant(participantId); |
| | | if(ToolUtil.isNotEmpty(name) && participant.getName().indexOf(name) == -1){ |
| | | continue; |
| | | } |
| | | map.put("userName", participant.getName()); |
| | | } |
| | | map.put("score", ourScore.compareTo(opponentScore) > 0 ? |
| | | ourScore + ":" + opponentScore : |
| | | opponentScore + ":" + ourScore); |
| | | map.put("matchResult", matchResult == 1 ? "胜" : "负"); |
| | | mapList.add(map); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", mapList.size()); |
| | | Integer offset = userGameRecordList.getOffset(); |
| | | Integer limit = userGameRecordList.getLimit(); |
| | | limit += offset; |
| | | map.put("rows", mapList.subList(offset, mapList.size() >= limit ? limit : mapList.size())); |
| | | return map; |
| | | } |
| | | } |