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<>();