| | |
| | | { |
| | | private readonly int _doWorkHour = 0; |
| | | private readonly int _doWorkMinute = 1; |
| | | private readonly ILogger<CheckUnPayOrderWork> logger; |
| | | private readonly ILifePayOrderService lifePayOrderService; |
| | | private readonly ILifePayService lifePayService; |
| | | private readonly IAbpDistributedLock distributedLock; |
| | |
| | | |
| | | public CheckUnPayOrderWork( |
| | | AbpAsyncTimer timer, |
| | | ILogger<CheckUnPayOrderWork> logger, |
| | | IServiceScopeFactory serviceScopeFactory, |
| | | ILifePayOrderService lifePayOrderService, |
| | | ILifePayService lifePayService, |
| | |
| | | IRepository<LifePayOrder, Guid> lifePayOrderRepository) : base(timer, serviceScopeFactory) |
| | | { |
| | | timer.Period = (int)TimeSpan.FromSeconds(5).TotalMilliseconds; |
| | | this.logger = logger; |
| | | this.lifePayOrderService = lifePayOrderService; |
| | | this.lifePayService = lifePayService; |
| | | this.distributedLock = distributedLock; |
| | |
| | | foreach (var order in orders) |
| | | { |
| | | await using var orderLock = await distributedLock.TryAcquireAsync($"LockKey:UpdateOrder:{order.OrderNo}", TimeSpan.FromSeconds(60)); |
| | | logger.LogInformation($"锁:LockKey:UpdateOrder:{order.OrderNo} - {orderLock != null}"); |
| | | |
| | | Logger.LogInformation($"订单:{order.OrderNo}-{order.ToJson()}"); |
| | | var wxPayNotice = await lifePayService.WxPayTradeQuery(order.OrderNo); |