From 9e32072aab0ef53e27c8f356cfca5cf52dd7cd2c 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: Sat, 23 Nov 2024 15:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=AC=BE=E6=B5=81=E7=A8=8B=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TransactionBillServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 1fd3494a..6829b900 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 @@ -1741,7 +1741,8 @@ public class TransactionBillServiceImpl implements TransactionBillService, After TransactionBillVO bill = this.selectSmTransactionBillByBillId(dto.getBillId()); ServiceUtil.assertion(bill == null, "待退款的订单不存在"); ServiceUtil.assertion(dto.getRefundAmount().compareTo(bill.getMoney()) > 0, "退款金额不允许大于订单金额"); - ServiceUtil.assertion(!TransactionBillStatus.SUCCESS.getStatus().equals(bill.getStatus()), "当前订单状态不允许退款"); + ServiceUtil.assertion(bill.getIsFinished() == null || !bill.getIsFinished(), "当前订单还未结束使用,无法退款"); + ServiceUtil.assertion(!TransactionBillStatus.SUCCESS.getStatus().equals(bill.getStatus()), "当前订单未支付成功,不允许退款"); // 拼接分成列表 transactionAssembler.assembleBonusList(bill); @@ -1755,6 +1756,7 @@ public class TransactionBillServiceImpl implements TransactionBillService, After TransactionBillQuery billQuery = new TransactionBillQuery(); billQuery.setBillId(dto.getBillId()); billQuery.setStatus(TransactionBillStatus.SUCCESS.getStatus()); + billQuery.setIsFinished(true); int updateBill = this.updateByQuery(data, billQuery); ServiceUtil.assertion(updateBill != 1, "退款时修改订单状态失败,订单状态已发生改变,请刷新后重试");