From 20278363e48f68b3399ab9aa0330b74f54760e25 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 11 Feb 2025 08:05:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heritage/service/wx/impl/WeChatServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/cultural/heritage/service/wx/impl/WeChatServiceImpl.java b/src/main/java/com/cultural/heritage/service/wx/impl/WeChatServiceImpl.java index 9a7a0b7..670e8a7 100644 --- a/src/main/java/com/cultural/heritage/service/wx/impl/WeChatServiceImpl.java +++ b/src/main/java/com/cultural/heritage/service/wx/impl/WeChatServiceImpl.java @@ -317,6 +317,13 @@ public class WeChatServiceImpl implements WeChatService { ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "订单状态修改失败"); // 生成退款记录 + RefundRecord refundRecord = new RefundRecord(); + refundRecord.setOutTradeNo(refundNotification.getOutTradeNo()); + refundRecord.setOutRefundNo(refundNotification.getOutRefundNo()); + refundRecord.setRefundAmount(order.getTotalAmount()); + + boolean save = refundRecordService.save(refundRecord); + ThrowUtils.throwIf(!save, ErrorCode.OPERATION_ERROR, "退款记录生成失败"); // 恢复商品库存 QueryWrapper orderItemsQueryWrapper = new QueryWrapper<>();