From 18b58aaf9bd99cadd0e7f80fe5d80586f2f4831a Mon Sep 17 00:00:00 2001 From: nickchange <126672920+nickchange@users.noreply.github.com> Date: 星期五, 24 十一月 2023 18:32:43 +0800 Subject: [PATCH] 11.24 --- cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java | 40 +++++++++++++++++++++++++++++++++------- 1 files changed, 33 insertions(+), 7 deletions(-) diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java b/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java index d060cd8..d8c5a39 100644 --- a/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java +++ b/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java @@ -10,11 +10,13 @@ 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; import com.dsh.competition.feignclient.course.model.PaymentDeductionClassHour; import com.dsh.competition.feignclient.model.BillingRequest; import com.dsh.competition.feignclient.other.StoreClient; import com.dsh.competition.feignclient.other.model.Store; +import com.dsh.competition.mapper.CompetitionMapper; import com.dsh.competition.mapper.PaymentCompetitionMapper; import com.dsh.competition.model.*; import com.dsh.competition.service.CompetitionService; @@ -68,6 +70,8 @@ + @Resource + private CompetitionMapper competitionMapper; /** * 获取我的报名赛事记录 @@ -84,7 +88,12 @@ if(0 == type){ type = null; } - return this.baseMapper.queryMyCompetitionList(uid, type, pageSize, pageNo); + List<CompetitionListVo> competitionListVos = this.baseMapper.queryMyCompetitionList(uid, type, pageSize, pageNo); + for (CompetitionListVo competitionListVo : competitionListVos) { + Integer counts = competitionMapper.counts(competitionListVo.getPId()); + competitionListVo.setHeat(competitionListVo.getHeat()+counts); + } + return competitionListVos; } @@ -188,6 +197,23 @@ participantVo.setPhone(participant1.getPhone()); participant.add(participantVo); } + + + for (Integer i : collect) { + TStudent tStudent = studentClient.queryById(i); + if (tStudent!=null) { + ParticipantVo participantVo = new ParticipantVo(); + participantVo.setId(tStudent.getId()); + participantVo.setName(tStudent.getName()); + participantVo.setIdcard(tStudent.getIdCard()); + Integer age = Integer.valueOf(sdf_year.format(new Date())) - Integer.valueOf(sdf_year.format(tStudent.getBirthday())); + participantVo.setAge(age); + participantVo.setPhone(tStudent.getPhone()); + participant.add(participantVo); + } + + } + competitionInfo.setParticipant(participant); competitionInfo.setStatus(competition.getStatus()); if(paymentCompetition.getPayStatus() == 3){ @@ -246,7 +272,7 @@ paymentCompetition.setAppUserId(null); this.updateById(paymentCompetition); - competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); +// competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); competitionService.updateById(competition); } if(paymentCompetition.getPayType() == 3){//玩湃币支付 @@ -260,16 +286,16 @@ paymentCompetition.setAppUserId(null); this.updateById(paymentCompetition); - competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); +// competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); competitionService.updateById(competition); } if(paymentCompetition.getPayType() == 4){//课程支付 List<UserCompetition> list = userCompetitionService.list(new QueryWrapper<UserCompetition>().eq("paymentCompetitionId", paymentCompetition.getId())); for (UserCompetition userCompetition : list) { - Participant participant = participantService.getById(userCompetition.getId()); - Student student = studentClient.queryStudentByPhone(participant.getPhone()); +// Participant participant = participantService.getById(userCompetition.getId()); +// Student student = studentClient.queryStudentByPhone(participant.getPhone()); PaymentDeductionClassHour paymentDeductionClassHour = new PaymentDeductionClassHour(); - paymentDeductionClassHour.setId(student.getId()); + paymentDeductionClassHour.setId(userCompetition.getParticipantId()); paymentDeductionClassHour.setClassHour(competition.getClassPrice()); paymentDeductionClassHour.setCode(code); coursePackagePaymentClient.rollbackPaymentDeductionClassHour(paymentDeductionClassHour); @@ -281,7 +307,7 @@ paymentCompetition.setAppUserId(null); this.updateById(paymentCompetition); - competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); +// competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); competitionService.updateById(competition); } return ResultUtil.success(); -- Gitblit v1.7.1