退款流程优化

This commit is contained in:
磷叶 2024-11-23 15:15:27 +08:00
parent 9c9aeadb61
commit 9e32072aab

View File

@ -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, "退款时修改订单状态失败,订单状态已发生改变,请刷新后重试");