| | |
| | | |
| | | public async Task ExecuteAsync(JobExecutingContext context, CancellationToken stoppingToken) |
| | | { |
| | | //var env = App.GetConfig<string>("Environment"); |
| | | //if (env != "Local") |
| | | //{ |
| | | var env = App.GetConfig<string>("Environment"); |
| | | if (env != "Local") |
| | | { |
| | | var transactions = await channelWalletTransactionRepository.GetQueryable(false) |
| | | .Include(it => it.PingAnPay) |
| | | .Where(it => |
| | | it.TransactionStatus == EnumWalletTransactionStatus.WaitPay |
| | | || it.TransactionStatus == EnumWalletTransactionStatus.Dealing) |
| | | || it.TransactionStatus == EnumWalletTransactionStatus.Dealing |
| | | || it.TransactionStatus == EnumWalletTransactionStatus.Success |
| | | && it.EreceiptStatus != EnumWalletTransactionEreceiptStatus.SUCCESS |
| | | && it.EreceiptStatus != EnumWalletTransactionEreceiptStatus.FAIL) |
| | | .ToListAsync(); |
| | | var walletIds = transactions.Select(it => it.WalletId).Distinct().ToList(); |
| | | var wallets = await channelWalletRepository.GetQueryable(false) |
| | |
| | | var wallet = wallets.FirstOrDefault(it => it.Id == transaction.WalletId); |
| | | if (wallet != null) |
| | | { |
| | | // 查询交易详情 |
| | | await channelWalletService.GetTransactionDetail(wallet, transaction); |
| | | if (transaction.TransactionStatus == EnumWalletTransactionStatus.WaitPay |
| | | || transaction.TransactionStatus == EnumWalletTransactionStatus.Dealing) |
| | | { |
| | | // 查询交易详情 |
| | | await channelWalletService.GetTransactionDetail(wallet, transaction); |
| | | } |
| | | // 下载回单 |
| | | await channelWalletService.DownloadEreceiptUrl(wallet, transaction); |
| | | } |
| | | } |
| | | //} |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.EntityFrameworkCore.Metadata.Builders; |
| | | using Microsoft.EntityFrameworkCore.Migrations; |
| | | using Microsoft.Extensions.Configuration; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | ? p.IsModified |
| | | : true) |
| | | .ToDictionary(p => p.Metadata.Name, p => p.OriginalValue)); |
| | | Db.GetRepository<DbAuditLog, LogDbContextLocator>().InsertNow(log); |
| | | // 创建独立作用域 |
| | | using (var scope = App.GetRequiredService<IServiceScopeFactory>().CreateScope()) |
| | | { |
| | | var rep = scope.ServiceProvider.GetRequiredService<IRepository<DbAuditLog, LogDbContextLocator>>(); |
| | | rep.InsertNow(log); |
| | | } |
| | | } |
| | | } |
| | | } |