From 205778fd9f073c5f7157c47cf5a37d579f9ba539 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 29 Feb 2024 10:48:48 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BB=BB=E5=8A=A1=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs | 2 +- Src/Dlhis.ScheduledTask/Packs/JobPack.cs | 2 +- ...etAttendanceJob.cs => CreateGetUploadRecordJob.cs} | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) rename Src/Dlhis.ScheduledTask/TaskAssignment/Job/{CreateGetAttendanceJob.cs => CreateGetUploadRecordJob.cs} (87%) diff --git a/Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs b/Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs index d642dcd5..788c41ec 100644 --- a/Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs +++ b/Src/Dlhis.Entity/Device/Enums/DeviceTaskEnumType.cs @@ -59,7 +59,7 @@ public enum DeviceTaskEnumType /// - /// 同步时间 + /// 上传记录 /// [Description("上传记录")] UploadRecord = 500, diff --git a/Src/Dlhis.ScheduledTask/Packs/JobPack.cs b/Src/Dlhis.ScheduledTask/Packs/JobPack.cs index fc4c8870..77a184a7 100644 --- a/Src/Dlhis.ScheduledTask/Packs/JobPack.cs +++ b/Src/Dlhis.ScheduledTask/Packs/JobPack.cs @@ -31,7 +31,7 @@ public class JobPack : BaseAppPack }); //创建设备获取考勤的任务 - RecurringJob.AddOrUpdate("CreateGetAttendance", s => s.RunAsync(), "0 0/1 * * * ?", new RecurringJobOptions + RecurringJob.AddOrUpdate("CreateGetUploadRecord", s => s.RunAsync(), "0 0/1 * * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetAttendanceJob.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs similarity index 87% rename from Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetAttendanceJob.cs rename to Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs index 6c8b6cd7..d17e7215 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetAttendanceJob.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Job/CreateGetUploadRecordJob.cs @@ -7,12 +7,12 @@ using Kurisu.SqlSugar.Services; namespace Dlhis.ScheduledTask.TaskAssignment.Job; -public class CreateGetAttendanceJob +public class CreateGetUploadRecordJob { private readonly IDbContext _dbContext; private readonly ILogger _logger; - public CreateGetAttendanceJob(IDbContext dbContext, ILogger logger) + public CreateGetUploadRecordJob(IDbContext dbContext, ILogger logger) { _logger = logger; _dbContext = dbContext; @@ -25,7 +25,8 @@ public class CreateGetAttendanceJob { var devices = await _dbContext.Queryable() .Where(x => x.Enable) - .Where(x => x.Type == DeviceTypeEnumType.Attendance || (x.Type == DeviceTypeEnumType.Door && x.AsAttendance) || x.Type == DeviceTypeEnumType.Door) + .Where(x => x.Type == DeviceTypeEnumType.Attendance || (x.Type == DeviceTypeEnumType.Door && x.AsAttendance) + || x.Type == DeviceTypeEnumType.Door) .ToListAsync(); var ds = devices.Select(x => x.UniqueNo).ToList(); @@ -48,7 +49,6 @@ public class CreateGetAttendanceJob TenantId = x.TenantId, Version = 0, - UserNo = string.Empty, Type = DeviceTaskEnumType.UploadRecord, CreatedBy = 1, @@ -56,7 +56,8 @@ public class CreateGetAttendanceJob ModifiedBy = 1, ModifiedTime = DateTime.Now, - }).ToList(); + }) + .ToList(); await _dbContext.InsertAsync(tasks); }