nickchange
2023-11-17 a9564eae9f0169ca39329b2f14a8f13d13358a0a
cloud-server-competition/src/main/java/com/dsh/competition/service/impl/ParticipantServiceImpl.java
@@ -96,6 +96,9 @@
    public List<ParticipantVo> queryParticipantList(Integer uid) throws Exception {
        //拿到学员列表
        List<TStudent> tStudents = studentClient.queryStudentList(uid);
        List<ParticipantVo> listVo1 = new ArrayList<>();
        //利用HashMap去重身份证
        LinkedHashMap<String,ParticipantVo> linkedHashMap =new LinkedHashMap<>();
        SimpleDateFormat sdf_year = new SimpleDateFormat("yyyy");
@@ -118,6 +121,10 @@
            }
            participantVo.setGender(tStudent.getSex());
            participantVo.setIsStudent(1);
            if (tStudent.getIdCard()==null|| tStudent.getIdCard().isEmpty()){
                listVo1.add(participantVo);
                continue;
            }
            linkedHashMap.put(tStudent.getIdCard(),participantVo);
        }
@@ -156,15 +163,19 @@
                participantVo.setBirthday(format);
            }
            participantVo.setGender(participant.getGender());
            if (participant.getIdcard()==null|| participant.getIdcard().isEmpty()){
                listVo1.add(participantVo);
                continue;
            }
            linkedHashMap.put(participant.getIdcard(),participantVo);
            listVo.add(participantVo);
//            listVo.add(participantVo);
        }
        listVo1.addAll(linkedHashMap.values());
        List<ParticipantVo> listVo1 = new ArrayList<>(linkedHashMap.values());
//        List<ParticipantVo> listVo1 = new ArrayList<>(linkedHashMap.values());
        return listVo1;