From c5ca376fd36d94686df33dc8675f621187e012a1 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 9 Jul 2024 13:38:02 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=95=B0=E6=8D=AE=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Jobs/CreateGetUploadRecordJob.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/Jobs/CreateGetUploadRecordJob.cs b/Src/Dlhis.ScheduledTask/Jobs/CreateGetUploadRecordJob.cs index 55fa29c0..de0f6ee4 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/CreateGetUploadRecordJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/CreateGetUploadRecordJob.cs @@ -11,7 +11,6 @@ namespace Dlhis.ScheduledTask.Jobs; [RecurringJob(nameof(CreateGetUploadRecordJob), "0 0/10 * * * ?", Name = "创建上传设备数据任务")] public class CreateGetUploadRecordJob : BaseJob { - public CreateGetUploadRecordJob(IServiceProvider serviceProvider) : base(serviceProvider) { } @@ -20,15 +19,15 @@ public class CreateGetUploadRecordJob : BaseJob { var devices = await DbContext.Queryable() .Where(x => x.Enable) - .Where(x => x.Type == DeviceTypeEnumType.Attendance || (x.Type == DeviceTypeEnumType.Door && x.AsAttendance)) + .Where(x => x.Type == DeviceTypeEnumType.Attendance || x.Type == DeviceTypeEnumType.Door) .ToListAsync(); //过滤处理中的任务 var currentUniqueNos = await DbContext.Queryable() - .Where(x => x.Type == DeviceTaskEnumType.UploadRecord) - .Where(x => x.Status == DeviceTaskStatusEnumType.Process || x.Status == DeviceTaskStatusEnumType.Wait) - .Select(x => x.DeviceUniqueNo) - .ToListAsync(); + .Where(x => x.Type == DeviceTaskEnumType.UploadRecord) + .Where(x => x.Status == DeviceTaskStatusEnumType.Process || x.Status == DeviceTaskStatusEnumType.Wait) + .Select(x => x.DeviceUniqueNo) + .ToListAsync(); var tasks = devices.Where(x => !currentUniqueNos.Contains(x.UniqueNo)).Select(x => new DeviceTaskEntity { @@ -40,10 +39,8 @@ public class CreateGetUploadRecordJob : BaseJob Type = DeviceTaskEnumType.UploadRecord, CancellationId = 0, Priority = 50, - - }) - .ToList(); + }).ToList(); await DbContext.InsertAsync(tasks); } -} +} \ No newline at end of file