| | |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Logging; |
| | | using Microsoft.Extensions.Options; |
| | | using NPOI.SS.Formula.Functions; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | { |
| | | public class GetStaticsWorker : AsyncPeriodicBackgroundWorkerBase |
| | | { |
| | | private readonly ILifePayService _lifePayService; |
| | | private readonly IStatisticsService _statisticService; |
| | | private readonly int _doWorkHour = 0; |
| | | private readonly int _doWorkMinute = 30; |
| | | public GetStaticsWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, ILifePayService lifePayService) : base(timer, serviceScopeFactory) |
| | | public GetStaticsWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory, IStatisticsService statisticService) : base(timer, serviceScopeFactory) |
| | | { |
| | | _lifePayService = lifePayService; |
| | | _statisticService = statisticService; |
| | | timer.Period = PeriodTool.CalcuPeriodFromEveryDayTime(_doWorkHour, _doWorkMinute, 0); |
| | | //timer.Period =5 * 60000; |
| | | //timer.Period =1 * 60000; |
| | | } |
| | | |
| | | [UnitOfWork] |
| | |
| | | { |
| | | try |
| | | { |
| | | await _lifePayService.GetTopStatistics(); |
| | | await _statisticService.GetTopStatistics(new List<string>()); |
| | | Logger.LogError($"获取统计信息开始: {DateTime.Now}"); |
| | | } |
| | | catch (Exception ex) |