37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
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<S_Class>().Where(x => x.Creator == tenantId).Select(x => x.Id).ToListAsync();
|
|
|
|
// var resultModel = await (
|
|
// from r in dbContext.Set<N_SportsTestResult>()
|
|
// //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();
|
|
|
|
//}
|
|
}
|
|
}
|
|
} |