fix 考勤任务生成处理
This commit is contained in:
@@ -24,11 +24,13 @@ public class JobPack : BaseAppPack
|
||||
TimeZone = TimeZoneInfo.Local
|
||||
});
|
||||
|
||||
//创建设备同步时间任务
|
||||
RecurringJob.AddOrUpdate<CreateSyncServerDateTimeJob>("SyncServerDateTime", s => s.RunAsync(), "0 0 0/1 * * ?", new RecurringJobOptions
|
||||
{
|
||||
TimeZone = TimeZoneInfo.Local
|
||||
});
|
||||
|
||||
//创建设备获取考勤的任务
|
||||
RecurringJob.AddOrUpdate<CreateGetAttendanceJob>("CreateGetAttendance", s => s.RunAsync(), "0 0/1 * * * ?", new RecurringJobOptions
|
||||
{
|
||||
TimeZone = TimeZoneInfo.Local
|
||||
|
||||
@@ -23,16 +23,19 @@ public class CreateGetAttendanceJob
|
||||
_dbContext.Client.QueryFilter.ClearAndBackup<ITenantId>();
|
||||
try
|
||||
{
|
||||
var devices = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Enable).ToListAsync();
|
||||
devices = devices.Where(x => x.Funcs.Contains(DeviceFuncEnumType.Attendance)).ToList();
|
||||
var devices = await _dbContext.Queryable<DeviceEntity>()
|
||||
.Where(x => x.Enable)
|
||||
.Where(x => x.Type == DeviceTypeEnumType.Attendance || (x.Type == DeviceTypeEnumType.Door && x.AsAttendance))
|
||||
.ToListAsync();
|
||||
|
||||
var ds = devices.Select(x => x.UniqueNo).ToList();
|
||||
|
||||
var b = await _dbContext.Queryable<DeviceTaskEntity>()
|
||||
var b = await _dbContext.Queryable<DeviceTaskEntity>()
|
||||
.Where(x => ds.Contains(x.DeviceUniqueNo))
|
||||
.Where(x => x.Type == DeviceTaskEnumType.UploadRecord)
|
||||
.Where(x => x.Status == DeviceTaskStatusEnumType.Process)
|
||||
.AnyAsync();
|
||||
|
||||
if (b)
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user