| | |
| | | } |
| | | if (paymentCompetitionVo.getPayType() == 4) {//课程 |
| | | money = new BigDecimal(competition.getClassPrice()).multiply(new BigDecimal(jsonArray.size())).setScale(2, RoundingMode.HALF_EVEN); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | // Participant participant = participantService.getById(s); |
| | | // Student student = studentClient.queryStudentByPhone(participant.getPhone()); |
| | | // if(null == student){ |
| | | // return ResultUtil.error(participant.getName() + "不是学员,无法使用课时支付。"); |
| | | // } |
| | | // 2.0 |
| | | Integer integer = coursePackagePaymentClient.queryResidueClassHourById(paymentCompetitionVo.getCoursePaymentId()); |
| | | if (new BigDecimal(integer).compareTo(new BigDecimal(competition.getClassPrice())) < 0) { |
| | | return new ResultUtil(3, "剩余课时不足,无法完成支付。"); |
| | | |
| | | } |
| | | Integer integer = coursePackagePaymentClient.queryResidueClassHourById(paymentCompetitionVo.getCoursePaymentId()); |
| | | if (new BigDecimal(integer).compareTo(money) < 0) { |
| | | return new ResultUtil(3, "剩余课时不足,无法完成支付。"); |
| | | } |
| | | } |
| | | |
| | |
| | | paymentCompetition.setPayOrderNo(""); |
| | | paymentCompetitionService.updateById(paymentCompetition); |
| | | |
| | | // competition.setApplicantsNumber(competition.getApplicantsNumber() + 1); |
| | | this.updateById(competition); |
| | | } |
| | | if (paymentCompetitionVo.getPayType() == 4) {//课程 |
| | |
| | | if(isStudent == 0){ |
| | | continue; |
| | | } |
| | | //扣减课时 |
| | | PaymentDeductionClassHour paymentDeductionClassHour = new PaymentDeductionClassHour(); |
| | | paymentDeductionClassHour.setId(id); |
| | | paymentDeductionClassHour.setClassHour(competition.getClassPrice()); |
| | |
| | | paymentDeductionClassHour.setUid(uid); |
| | | coursePackagePaymentClient.paymentDeductionClassHour(paymentDeductionClassHour); |
| | | } |
| | | |
| | | paymentCompetition = paymentCompetitionService.getById(paymentCompetition.getId()); |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetition.setPayStatus(2); |