| | |
| | | import com.dsh.competition.feignclient.account.AppUserClient; |
| | | import com.dsh.competition.feignclient.account.model.AppUser; |
| | | import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; |
| | | import com.dsh.competition.feignclient.course.model.PaymentDeductionClassHour; |
| | | import com.dsh.competition.feignclient.model.*; |
| | | import com.dsh.competition.feignclient.other.StoreClient; |
| | | import com.dsh.competition.model.*; |
| | | import com.dsh.competition.service.CompetitionService; |
| | | import com.dsh.competition.service.IParticipantService; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取赛事报名记录 |
| | | */ |
| | |
| | | } |
| | | return paymentCompetitions; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/getPayedCompetitions") |
| | | public BillingRequestVo getAllCompetitionPayRecord(@RequestBody BillingDataRequestVo requestVo){ |
| | |
| | | |
| | | return paymentCompetitionService.queryByCode(code); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/competition/getCompetitionsDetails") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/queryCompetitionList") |
| | | @ApiOperation(value = "获取赛事列表", tags = {"APP-赛事活动列表"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | |
| | | |
| | | /** |
| | | * 报名赛事微信支付回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 报名赛事支付宝支付回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/competition/queryMyCompetitionList") |
| | | @ApiOperation(value = "获取已报名赛事列表", tags = {"APP-赛事活动列表"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/competition/queryMyCompetitionInfo") |
| | | @ApiOperation(value = "获取已报名赛事详情", tags = {"APP-赛事活动列表"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 取消已报名赛事后微信回退金额回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | return new Page<Competition>(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/base/competition/listAudit") |
| | | public Page<Competition> listAudit(@RequestBody ListQuery listQuery){ |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | @Resource |
| | | private StoreClient storeClient; |
| | | |
| | | @Autowired |
| | | private UserCompetitionService userCompetitionService; |
| | | |
| | | |
| | | @PostMapping("/base/competition/cancel") |
| | | public void cancel(@RequestBody Integer id){ |
| | | try { |
| | | Competition byId = cttService.getById(id); |
| | | byId.setStatus(4); |
| | | cttService.updateById(byId); |
| | | List<PaymentCompetition> list = paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>().eq("competitionId", byId.getId()).eq("payStatus", 2)); |
| | | for (PaymentCompetition pay : list) { |
| | | PaymentCompetition paymentCompetition = pay; |
| | | |
| | | String code = paymentCompetition.getCode(); |
| | | Double amount = paymentCompetition.getAmount(); |
| | | Competition competition = competitionService.getById(paymentCompetition.getCompetitionId()); |
| | | |
| | | |
| | | String payOrderNo = paymentCompetition.getPayOrderNo(); |
| | | if (paymentCompetition.getPayType() == 1) {//微信支付 |
| | | Map<String, String> map = payMoneyUtil.wxRefund(payOrderNo, code, amount.toString(), amount.toString(), "/base/competition/weChatCancelPaymentCompetitionCallback"); |
| | | String return_code = map.get("return_code"); |
| | | if (!"SUCCESS".equals(return_code)) { |
| | | // return ResultUtil.error(map.get("return_msg")); |
| | | continue; |
| | | } |
| | | String refund_id = map.get("refund_id"); |
| | | paymentCompetition.setRefundOrderNo(refund_id); |
| | | paymentCompetitionService.updateById(paymentCompetition); |
| | | |
| | | storeClient.addBackRecord(paymentCompetition.getAmount() + "_" + paymentCompetition.getAppUserId()); |
| | | |
| | | |
| | | } |
| | | if (paymentCompetition.getPayType() == 2) {//支付宝支付 |
| | | Map<String, String> map = payMoneyUtil.aliRefund(payOrderNo, amount.toString()); |
| | | String return_code = map.get("code"); |
| | | if (!"10000".equals(return_code)) { |
| | | // return ResultUtil.error(map.get("msg")); |
| | | continue; |
| | | } |
| | | String refund_id = map.get("trade_no"); |
| | | paymentCompetition.setRefundOrderNo(refund_id); |
| | | paymentCompetition.setRefundTime(new Date()); |
| | | paymentCompetition.setPayStatus(3); |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetitionService.updateById(paymentCompetition); |
| | | |
| | | // competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); |
| | | competitionService.updateById(competition); |
| | | } |
| | | if (paymentCompetition.getPayType() == 3) {//玩湃币支付 |
| | | AppUser appUser = appUserClient.queryAppUser(paymentCompetition.getAppUserId()); |
| | | appUser.setPlayPaiCoins(appUser.getPlayPaiCoins() + amount.intValue()); |
| | | appUserClient.updateAppUser(appUser); |
| | | |
| | | paymentCompetition.setRefundOrderNo(""); |
| | | paymentCompetition.setRefundTime(new Date()); |
| | | paymentCompetition.setPayStatus(3); |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetitionService.updateById(paymentCompetition); |
| | | |
| | | // competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); |
| | | competitionService.updateById(competition); |
| | | } |
| | | if (paymentCompetition.getPayType() == 4) {//课程支付 |
| | | List<UserCompetition> list1 = userCompetitionService.list(new QueryWrapper<UserCompetition>().eq("paymentCompetitionId", paymentCompetition.getId())); |
| | | for (UserCompetition userCompetition : list1) { |
| | | // Participant participant = participantService.getById(userCompetition.getId()); |
| | | // Student student = studentClient.queryStudentByPhone(participant.getPhone()); |
| | | PaymentDeductionClassHour paymentDeductionClassHour = new PaymentDeductionClassHour(); |
| | | paymentDeductionClassHour.setId(userCompetition.getParticipantId()); |
| | | paymentDeductionClassHour.setClassHour(competition.getClassPrice()); |
| | | paymentDeductionClassHour.setCode(code); |
| | | coursePackagePaymentClient.rollbackPaymentDeductionClassHour(paymentDeductionClassHour); |
| | | } |
| | | |
| | | paymentCompetition.setRefundOrderNo(""); |
| | | paymentCompetition.setRefundTime(new Date()); |
| | | paymentCompetition.setPayStatus(3); |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetitionService.updateById(paymentCompetition); |
| | | |
| | | // competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); |
| | | competitionService.updateById(competition); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/base/competition/getPeoples") |
| | | @ResponseBody |
| | | public List<CompetitionUser> getPeoples(@RequestBody GetPeopleQuery getPeopleQuery){ |
| | |
| | | getPeopleQuery.getId(),getPeopleQuery.getState()); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/competition/queryFee") |
| | |
| | | double sum = list.stream().mapToDouble(PaymentCompetition::getAmount).sum(); |
| | | return sum; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return map; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/actYys") |
| | | public HashMap<String, Object> actYys(@RequestBody CompetionVO vo){ |