| | |
| | | wrapper1.last("limit 1"); |
| | | Paylog paylog = iPaylogService.getOne(wrapper1); |
| | | log.info("paylog:{}", paylog); |
| | | if (paylog.getPayType() == 1) {//支付宝 |
| | | boolean bo = paylogServiceImpl.refundForAlipay(paylog.getOutTradeNo(), paylog.getTradeNo(), orderAuctionBond.getBond().doubleValue()); |
| | | if (!bo) { |
| | | return R.fail("支付宝退款失败!"); |
| | | if (Objects.nonNull(paylog)) { |
| | | if (paylog.getPayType() == 1) {// 支付宝 |
| | | boolean bo = paylogServiceImpl.refundForAlipay(paylog.getOutTradeNo(), |
| | | paylog.getTradeNo(), orderAuctionBond.getBond().doubleValue()); |
| | | if (!bo) { |
| | | return R.fail("支付宝退款失败!"); |
| | | } |
| | | } else {// 微信 |
| | | String refundMoney = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100d); |
| | | Integer refundFee = Integer.parseInt( |
| | | refundMoney.substring(0, refundMoney.length() - 3)); |
| | | String money = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100d); |
| | | Integer totalFee = Integer.parseInt(money.substring(0, money.length() - 3)); |
| | | refundFee = Integer.parseInt(money.substring(0, money.length() - 3)); |
| | | String refundNo = OrderUtil.getOrderNoForPrefix("R"); |
| | | boolean bo = paylogServiceImpl.refundForWxpay(4, paylog.getTradeNo(), |
| | | paylog.getOutTradeNo(), refundNo, totalFee, refundFee, "2"); |
| | | if (!bo) { |
| | | return R.fail("微信退款失败!"); |
| | | } |
| | | } |
| | | } else {//微信 |
| | | String refundMoney = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100d); |
| | | Integer refundFee = Integer.parseInt(refundMoney.substring(0, refundMoney.length() - 3)); |
| | | String money = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100d); |
| | | Integer totalFee = Integer.parseInt(money.substring(0, money.length() - 3)); |
| | | refundFee = Integer.parseInt(money.substring(0, money.length() - 3)); |
| | | String refundNo = OrderUtil.getOrderNoForPrefix("R"); |
| | | boolean bo = paylogServiceImpl.refundForWxpay(4, paylog.getTradeNo(), |
| | | paylog.getOutTradeNo(), refundNo, totalFee, refundFee, "2"); |
| | | if (!bo) { |
| | | return R.fail("微信退款失败!"); |
| | | } |
| | | orderAuctionBond.setBoundStatus(BondStatusEnum.REFUNDED); |
| | | } |
| | | orderAuctionBond.setBoundStatus(BondStatusEnum.REFUNDED); |
| | | } |
| | | this.updateBatchById(orderAuctionBondList); |
| | | return R.ok(); |