| | |
| | | import com.dsh.competition.entity.Participant; |
| | | import com.dsh.competition.entity.PaymentCompetition; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.account.AppUserClient; |
| | | import com.dsh.competition.feignclient.account.StudentClient; |
| | | import com.dsh.competition.feignclient.account.model.AppUser; |
| | | import com.dsh.competition.feignclient.account.model.Student; |
| | | import com.dsh.competition.feignclient.account.model.TStudent; |
| | | import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; |
| | |
| | | |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Autowired |
| | | private UserCompetitionService userCompetitionService; |
| | |
| | | public Page<CompetitionUser> getPeopleFromId1(long offset, long limit, Integer id, Integer state) { |
| | | List<UserCompetition> peopleFromId1 = this.baseMapper.getPeopleFromId1(id, state, offset, limit); |
| | | int count = this.baseMapper.getPeopleFromIdCount(id, state); |
| | | Map<Integer, AppUser> userMap = appUserClient.getAllUser().stream().collect(Collectors.toMap(AppUser::getId, e -> e)); |
| | | List<CompetitionUser> list = new ArrayList<>(); |
| | | for (UserCompetition userCompetition : peopleFromId1) { |
| | | Long paymentCompetitionId = userCompetition.getPaymentCompetitionId(); |
| | |
| | | Participant participant = this.getById(userCompetition.getParticipantId()); |
| | | CompetitionUser competitionUser = new CompetitionUser(); |
| | | if(null != participant){ |
| | | AppUser appUser = userMap.get(participant.getAppUserId()); |
| | | if (appUser!=null){ |
| | | competitionUser.setAppUserId(appUser.getId()); |
| | | competitionUser.setRegisterPhone(appUser.getPhone()); |
| | | } |
| | | competitionUser.setName(participant.getName()); |
| | | competitionUser.setSex(participant.getGender()); |
| | | competitionUser.setPhone(participant.getPhone()); |
| | | competitionUser.setIdCard(participant.getIdcard()); |
| | | }else{ |
| | | TStudent tStudent = studentClient.queryById(userCompetition.getParticipantId()); |
| | | AppUser appUser = userMap.get(tStudent.getAppUserId()); |
| | | if (appUser!=null){ |
| | | competitionUser.setAppUserId(appUser.getId()); |
| | | competitionUser.setRegisterPhone(appUser.getPhone()); |
| | | } |
| | | competitionUser.setName(tStudent.getName()); |
| | | competitionUser.setSex(tStudent.getSex()); |
| | | competitionUser.setPhone(tStudent.getPhone()); |