fix 任务名称修改

This commit is contained in:
2024-02-29 10:48:48 +08:00
parent d3521ec2de
commit 205778fd9f
3 changed files with 8 additions and 7 deletions

View File

@@ -59,7 +59,7 @@ public enum DeviceTaskEnumType
/// <summary>
/// 同步时间
/// 上传记录
/// </summary>
[Description("上传记录")]
UploadRecord = 500,

View File

@@ -31,7 +31,7 @@ public class JobPack : BaseAppPack
});
//创建设备获取考勤的任务
RecurringJob.AddOrUpdate<CreateGetAttendanceJob>("CreateGetAttendance", s => s.RunAsync(), "0 0/1 * * * ?", new RecurringJobOptions
RecurringJob.AddOrUpdate<CreateGetUploadRecordJob>("CreateGetUploadRecord", s => s.RunAsync(), "0 0/1 * * * ?", new RecurringJobOptions
{
TimeZone = TimeZoneInfo.Local
});

View File

@@ -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<CreateSyncServerDateTimeJob> _logger;
public CreateGetAttendanceJob(IDbContext dbContext, ILogger<CreateSyncServerDateTimeJob> logger)
public CreateGetUploadRecordJob(IDbContext dbContext, ILogger<CreateSyncServerDateTimeJob> logger)
{
_logger = logger;
_dbContext = dbContext;
@@ -25,7 +25,8 @@ public class CreateGetAttendanceJob
{
var devices = await _dbContext.Queryable<DeviceEntity>()
.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);
}