From f638ff78e1dc7b5a8c2bc91a3bb0e6321caecb70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Wed, 27 Nov 2024 18:24:14 +0800 Subject: [PATCH] =?UTF-8?q?debug:=E9=80=80=E6=AC=BE=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TransactionBillServiceImpl.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java index 6829b900..ea071cbf 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java @@ -1209,15 +1209,13 @@ public class TransactionBillServiceImpl implements TransactionBillService, After // 计算需要退款的金额,若金额 > 0.01 则申请退款 BigDecimal refundAmount = this.calcRefundAmount(order, endTime, totalEle); if (BigDecimal.valueOf(0.01).compareTo(refundAmount) < 0) { - scheduledExecutorService.schedule(() -> { - // 申请退款 - BillRefundDTO refundDto = new BillRefundDTO(); - refundDto.setBillId(order.getBillId()); - refundDto.setRefundAmount(refundAmount); - refundDto.setRefundReason(String.format("充值订单%s智能退款%s元", order.getBillNo(), refundAmount)); - int refund = this.refund(refundDto); - ServiceUtil.assertion(refund != 1, "申请退款失败"); - }, 0, TimeUnit.SECONDS); + // 申请退款 + BillRefundDTO refundDto = new BillRefundDTO(); + refundDto.setBillId(order.getBillId()); + refundDto.setRefundAmount(refundAmount); + refundDto.setRefundReason(String.format("充值订单%s智能退款%s元", order.getBillNo(), refundAmount)); + int refund = this.refund(refundDto); + ServiceUtil.assertion(refund != 1, "申请退款失败"); } // 清零设备