fix 任务名称修改
This commit is contained in:
@@ -59,7 +59,7 @@ public enum DeviceTaskEnumType
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 同步时间
|
/// 上传记录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("上传记录")]
|
[Description("上传记录")]
|
||||||
UploadRecord = 500,
|
UploadRecord = 500,
|
||||||
|
|||||||
@@ -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
|
TimeZone = TimeZoneInfo.Local
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ using Kurisu.SqlSugar.Services;
|
|||||||
|
|
||||||
namespace Dlhis.ScheduledTask.TaskAssignment.Job;
|
namespace Dlhis.ScheduledTask.TaskAssignment.Job;
|
||||||
|
|
||||||
public class CreateGetAttendanceJob
|
public class CreateGetUploadRecordJob
|
||||||
{
|
{
|
||||||
private readonly IDbContext _dbContext;
|
private readonly IDbContext _dbContext;
|
||||||
private readonly ILogger<CreateSyncServerDateTimeJob> _logger;
|
private readonly ILogger<CreateSyncServerDateTimeJob> _logger;
|
||||||
|
|
||||||
public CreateGetAttendanceJob(IDbContext dbContext, ILogger<CreateSyncServerDateTimeJob> logger)
|
public CreateGetUploadRecordJob(IDbContext dbContext, ILogger<CreateSyncServerDateTimeJob> logger)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
@@ -25,7 +25,8 @@ public class CreateGetAttendanceJob
|
|||||||
{
|
{
|
||||||
var devices = await _dbContext.Queryable<DeviceEntity>()
|
var devices = await _dbContext.Queryable<DeviceEntity>()
|
||||||
.Where(x => x.Enable)
|
.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();
|
.ToListAsync();
|
||||||
|
|
||||||
var ds = devices.Select(x => x.UniqueNo).ToList();
|
var ds = devices.Select(x => x.UniqueNo).ToList();
|
||||||
@@ -48,7 +49,6 @@ public class CreateGetAttendanceJob
|
|||||||
|
|
||||||
TenantId = x.TenantId,
|
TenantId = x.TenantId,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
UserNo = string.Empty,
|
|
||||||
Type = DeviceTaskEnumType.UploadRecord,
|
Type = DeviceTaskEnumType.UploadRecord,
|
||||||
|
|
||||||
CreatedBy = 1,
|
CreatedBy = 1,
|
||||||
@@ -56,7 +56,8 @@ public class CreateGetAttendanceJob
|
|||||||
ModifiedBy = 1,
|
ModifiedBy = 1,
|
||||||
ModifiedTime = DateTime.Now,
|
ModifiedTime = DateTime.Now,
|
||||||
|
|
||||||
}).ToList();
|
})
|
||||||
|
.ToList();
|
||||||
|
|
||||||
await _dbContext.InsertAsync(tasks);
|
await _dbContext.InsertAsync(tasks);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user