44323
2024-03-13 eadc1f646e81e8ffbe940b13163aee9d107d6663
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java
@@ -81,7 +81,7 @@
        for (int i = 0; i < mapList.size(); i++) {
            Map<String, Object> map = mapList.get(i);
            Integer participantType = Integer.valueOf(map.get("participantType").toString());
            Integer participantId = Integer.valueOf(map.get("participantId").toString());
            Long participantId = Long.valueOf(map.get("participantId").toString());
            Integer num = Integer.valueOf(map.get("num").toString());
            if(null != participantId && participantId.equals(entrantRank.getId()) && participantType.equals(entrantRank.getIsStudent())){
                entrantRankVo.setNationalRank(i + 1);
@@ -101,7 +101,7 @@
        for (int i = 0; i < mapList1.size(); i++) {
            Map<String, Object> map = mapList1.get(i);
            Integer participantType = Integer.valueOf(map.get("participantType").toString());
            Integer participantId = Integer.valueOf(map.get("participantId").toString());
            Long participantId = Long.valueOf(map.get("participantId").toString());
            Integer num = Integer.valueOf(map.get("num").toString());
            if(null != participantId && participantId.equals(entrantRank.getId()) && participantType.equals(entrantRank.getIsStudent())){
                entrantRankVo.setCityRank(i + 1);
@@ -145,7 +145,7 @@
        matchRecord.setPageNo(pageNo);
        MatchRecordVo matchRecordVo = new MatchRecordVo();
        int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("participantId", matchRecord.getId())
                .eq("participantType", matchRecord.getIsStudent()));
                .eq("participantType", matchRecord.getIsStudent()).isNotNull("matchResult"));
        matchRecordVo.setTotalSession(count);
        List<MatchRecordList> matchRecord1 = this.baseMapper.getMatchRecord(matchRecord);
        matchRecordVo.setList(matchRecord1);
@@ -196,9 +196,8 @@
                }
                //参赛人员
                if(participantType == 2){
                    AppUser appUser1 = appUserClient.getAppUser(appUserId);
                    Participant participant = participantClient.getParticipant(participantId);
                    worldCupRankVo.setAvatar(appUser1.getHeadImg());
                    worldCupRankVo.setAvatar(participant.getHeadImg());
                    String name = participant.getName();
                    if(name.length() > 2){
                        name = name.charAt(0) + "*" + name.substring(2);
@@ -242,9 +241,8 @@
                    }
                    //参赛人员
                    if(participantType == 2){
                        AppUser appUser1 = appUserClient.getAppUser(appUserId);
                        Participant participant = participantClient.getParticipant(participantId);
                        worldCupRankVo.setAvatar(appUser1.getHeadImg());
                        worldCupRankVo.setAvatar(participant.getHeadImg());
                        String name = participant.getName();
                        if(name.length() > 2){
                            name = name.charAt(0) + "*" + name.substring(2);
@@ -398,7 +396,7 @@
                if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){
                    continue;
                }
                if(ToolUtil.isNotEmpty(phone) && tStudent.getPhone().indexOf(phone) == -1){
                if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone()).indexOf(phone) == -1){
                    continue;
                }
                if(ToolUtil.isNotEmpty(idcard) && tStudent.getIdCard().indexOf(idcard) == -1){
@@ -407,12 +405,13 @@
                map.put("name", tStudent.getName());
                map.put("phone", ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone());
                map.put("idcard", tStudent.getIdCard());
            }else{
                Participant participant = participantClient.getParticipant(participantId);
                if(ToolUtil.isNotEmpty(name) && participant.getName().indexOf(name) == -1){
                    continue;
                }
                if(ToolUtil.isNotEmpty(phone) && participant.getPhone().indexOf(phone) == -1){
                if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()).indexOf(phone) == -1){
                    continue;
                }
                if(ToolUtil.isNotEmpty(idcard) && participant.getIdcard().indexOf(idcard) == -1){
@@ -421,14 +420,15 @@
                map.put("name", participant.getName());
                map.put("phone", ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone());
                map.put("idcard", participant.getIdcard());
            }
            list.add(map);
        }
        map1.put("total", mapList.size());
        map1.put("total", list.size());
        Integer offset = worldCupGameStatisticsInfoList.getOffset();
        Integer limit = worldCupGameStatisticsInfoList.getLimit();
        limit += offset;
        map1.put("rows", mapList.subList(offset, mapList.size() >= limit ? limit : mapList.size()));
        map1.put("rows", list.subList(offset, list.size() >= limit ? limit : list.size()));
        return map1;
    }
@@ -607,9 +607,7 @@
                }
                map.put("userName", participant.getName());
            }
            map.put("score", ourScore.compareTo(opponentScore) > 0 ?
                    ourScore + ":" + opponentScore :
                    opponentScore + ":" + ourScore);
            map.put("score", ourScore + ":" + opponentScore);
            map.put("matchResult", matchResult == 1 ? "胜" : matchResult == 0 ? "平" :"负");
            mapList.add(map);
        }
@@ -621,4 +619,15 @@
        map.put("rows", mapList.subList(offset, mapList.size() >= limit ? limit : mapList.size()));
        return map;
    }
    /**
     * 获取比赛场次
     * @param worldCupId
     * @return
     */
    @Override
    public int getMatchTime(Integer worldCupId) {
        return this.baseMapper.getMatchTime(worldCupId);
    }
}