| | |
| | | // 获取到赛事id集合 去重 |
| | | List<Integer> collect = comIds.stream().distinct().collect(Collectors.toList()); |
| | | // 根据赛事id 查询赛事支付记录 获取用户ids |
| | | if (collect.size() == 0) { |
| | | if (collect.isEmpty()) { |
| | | return new ArrayList<>(); |
| | | } else { |
| | | List<Integer> userIds = paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>() |
| | | .in("competitionId", collect)).stream() |
| | | .in("competitionId", collect) |
| | | .eq("payStatus",2)).stream() |
| | | .map(PaymentCompetition::getAppUserId).collect(Collectors.toList()); |
| | | return userIds; |
| | | } |
| | |
| | | List<Integer> operatorId = cttService.list(new QueryWrapper<Competition>() |
| | | .eq("operatorId", operatorId1)).stream().map(Competition::getId).collect(Collectors.toList()); |
| | | query.setUserIds(operatorId); |
| | | } else if (query.getStoreId() != null) { |
| | | List<Competition> list = cttService.list(new QueryWrapper<Competition>()); |
| | | List<Integer> integers = new ArrayList<>(); |
| | | for (Competition competition : list) { |
| | | for (String s : competition.getStoreId().split(",")) { |
| | | if (s.equals(""+query.getStoreId())){ |
| | | integers.add(competition.getId()); |
| | | } |
| | | } |
| | | } |
| | | if (integers.isEmpty()){ |
| | | integers.add(-1); |
| | | } |
| | | query.setUserIds(integers); |
| | | } |
| | | List<PaymentCompetition> paymentCompetitions = paymentCompetitionService.listAll(query); |
| | | List<PaymentCompetition> result = new ArrayList<>(); |
| | |
| | | String transaction_id = map.get("transaction_id"); |
| | | String result = map.get("result"); |
| | | |
| | | PaymentCompetition paymentCompetition = paymentCompetitionService.getOne(new QueryWrapper<PaymentCompetition>().eq("code", code) |
| | | .eq("payType", 1)); |
| | | PaymentCompetition paymentCompetition = paymentCompetitionService.getOne(new QueryWrapper<PaymentCompetition>().eq("code", code).eq("payType", 1)); |
| | | if (paymentCompetition.getPayStatus() == 1) { |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetition.setPayStatus(2); |
| | | paymentCompetition.setPayTime(new Date()); |
| | | paymentCompetition.setPayOrderNo(transaction_id); |
| | | paymentCompetitionService.updateById(paymentCompetition); |
| | | |
| | | Competition competition = cttService.getById(paymentCompetition.getCompetitionId()); |
| | | competition.setApplicantsNumber(competition.getApplicantsNumber() + 1); |
| | | cttService.updateById(competition); |
| | | } |
| | | |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | |
| | | String code = map.get("out_refund_no"); |
| | | String refund_id = map.get("refund_id"); |
| | | String result = map.get("result"); |
| | | PaymentCompetition paymentCompetition = paymentCompetitionService.getOne(new QueryWrapper<PaymentCompetition>().eq("code", code).eq("payType", 1)); |
| | | if (paymentCompetition.getPayStatus() == 1) { |
| | | PaymentCompetition paymentCompetition = paymentCompetitionService.getOne(new QueryWrapper<PaymentCompetition>() |
| | | .eq("code", code).eq("payType", 1)); |
| | | if (paymentCompetition.getPayStatus() == 2) { |
| | | paymentCompetition.setPayStatus(3); |
| | | paymentCompetition.setRefundTime(new Date()); |
| | | paymentCompetition.setRefundOrderNo(refund_id); |
| | |
| | | Competition competition = cttService.getById(paymentCompetition.getCompetitionId()); |
| | | competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); |
| | | cttService.updateById(competition); |
| | | |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | |
| | | String payOrderNo = paymentCompetition.getPayOrderNo(); |
| | | if (paymentCompetition.getPayType() == 1) {//微信支付 |
| | | Map<String, String> map = payMoneyUtil.wxRefund(payOrderNo, code, amount.toString(), amount.toString(), "/base/competition/weChatCancelPaymentCompetitionCallback"); |
| | | 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")); |
| | |
| | | } |
| | | String refund_id = map.get("refund_id"); |
| | | paymentCompetition.setRefundOrderNo(refund_id); |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetitionService.updateById(paymentCompetition); |
| | | storeClient.addBackRecord(paymentCompetition.getAmount() + "_" + paymentCompetition.getAppUserId()); |
| | | |