From 866af3c6214671cd704f01dfc7333640080054c0 Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期三, 11 六月 2025 17:53:45 +0800 Subject: [PATCH] fix:运营端--订单管理--退款管理,用户自己发起退款申请后供应商订单状态更新为已完成,退款审核操作驳回后,该笔订单的平台退款状态应该更新为空 --- LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs b/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs index de9e04b..3ff1a0d 100644 --- a/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs +++ b/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs @@ -1,6 +1,7 @@ 锘縰sing LifePayment.Application.Contracts; using LifePayment.Domain; using LifePayment.Domain.Shared; +using Medallion.Threading; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Logging; @@ -10,6 +11,7 @@ using System.Threading.Tasks; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Caching; +using Volo.Abp.DistributedLocking; using Volo.Abp.Uow; using ZeroD.Util; @@ -26,6 +28,7 @@ private readonly ILifePayService _lifePayService; private readonly ILifePayOrderService _lifePayOrderService; private readonly IDistributedCache<string> distributedCache; + private readonly IAbpDistributedLock distributedLock; private readonly ILogger<WxPayNotifyController> _logger; public WxPayNotifyController( @@ -33,13 +36,15 @@ ILogger<WxPayNotifyController> logger, ILifePayService lifePayService, ILifePayOrderService lifePayOrderService, - IDistributedCache<string> distributedCache) + IDistributedCache<string> distributedCache, + IAbpDistributedLock distributedLock) { _wxPayApi = wxPayApi; _logger = logger; _lifePayService = lifePayService; _lifePayOrderService = lifePayOrderService; this.distributedCache = distributedCache; + this.distributedLock = distributedLock; } /// <summary> @@ -63,6 +68,8 @@ { if (wxPayNotice.TradeState == LifePaymentConstant.WxPayStatus.鏀粯鎴愬姛) { + await using var orderLock = await distributedLock.TryAcquireAsync($"LockKey:UpdateOrder:{wxPayNotice.OutTradeNo}", TimeSpan.FromSeconds(60)); + var key = $"WxRechargeNotify_{wxPayNotice.OutTradeNo}"; if (string.IsNullOrWhiteSpace(distributedCache.Get(key))) { -- Gitblit v1.9.1