zhengyuxuan
2025-03-31 e80d0c59be1dd43fa5ce8c89ebc57764f091b2ae
fix:退款bug
1个文件已修改
13 ■■■■■ 已修改文件
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -29,6 +29,7 @@
using StackExchange.Redis;
using static Volo.Abp.Identity.Settings.IdentitySettingNames;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
using LifePayment.Application.LifePay;
namespace LifePayment.Application;
@@ -47,6 +48,7 @@
    private readonly IRepository<LifePayAccount, Guid> _lifePayAccount;
    private readonly IRepository<OperateHistory, Guid> _operateHistory;
    private readonly IRepository<LifePayChannlesRake, Guid> _lifePayChannlesRakeRepository;
    private readonly ILifePayOrderService _lifePayOrderService;
    private readonly IDataFilter dataFilter;
    private readonly IChannelFilter _channelFilter;
    private readonly IAliPayApi _aliPayApi;
@@ -67,6 +69,7 @@
                          IRepository<LifePayIntroInfo, Guid> lifePayIntroInfoRepository,
                          IRepository<LifePayChannlesRake, Guid> lifePayChannlesRakeRepository,
                          IRepository<OperateHistory, Guid> operateHistory,
                          ILifePayOrderService lifePayOrderService,
                          IAliPayApi aliPayApi,
                          IAlipayInterfaceManager aliPayInterfaceManager,
                          IWxPayApi wxPayApi,
@@ -86,6 +89,7 @@
        _lifePayPremiumRepository = lifePayPremiumRepository;
        _lifePayIntroInfoRepository = lifePayIntroInfoRepository;
        _aliPayApi = aliPayApi;
        _lifePayOrderService = lifePayOrderService;
        _alipayInterfaceManager = aliPayInterfaceManager;
        _wxPayApi = wxPayApi;
        _wxPayOptions = wxPayOptions.Value;
@@ -850,6 +854,13 @@
        {
            order.LifePayOrderStatus = LifePayOrderStatusEnum.已退款;
            order.LifePayRefundStatus = LifePayRefundStatusEnum.已退款;
            await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput()
            {
                OrderNo = result.OutTradeNo,
                OutOrderNo = result.TradeNo,
                LifePayType = LifePayTypeEnum.AliPay,
                ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Receipts
            });
        }
        return result;
@@ -1431,7 +1442,6 @@
        }
        var outRefundNo = order.ChannelId + CreateRefundOrderNo();
        order.RefundOrderNo = outRefundNo;
        switch (order.LifePayType)
        {
            case LifePayTypeEnum.WxPay:
@@ -1466,6 +1476,7 @@
            default: throw new UserFriendlyException("退款失败");
        }
        order.RefundOrderNo = outRefundNo;
        order.RefundCredentialsImgUrl = input.RefundCredentialsImgUrl;
        order.RefundCheckRemark = input.RefundCheckRemark;
        order.RefundTime = DateTime.Now;