using Quartz; using System; using System.Threading.Tasks; using VOL.Core.CacheManager; namespace VOL.Core.Quartz { public class StatResultJob : IJob { private readonly ICacheService _cacheService; public StatResultJob( ICacheService cacheService) { _cacheService = cacheService; } public async Task Execute(IJobExecutionContext context) { await Console.Out.WriteLineAsync("开始统计"); //using (var dbContext = new VOLContext()) //{ // //int tenantId = (int)UserContext.Current.TenantId; // //var classIds = await dbContext.Set().Where(x => x.Creator == tenantId).Select(x => x.Id).ToListAsync(); // var resultModel = await ( // from r in dbContext.Set() // //where r.Creator == (int)UserContext.Current.TenantId && classIds.Contains(r.ClassId) // group r by new { r.StudentNo, r.CategoryId } into groupedResults // select groupedResults.OrderByDescending(r => r.CreateDate).FirstOrDefault() // ).ToListAsync(); //} } } }