From cbbb4b5c1c623e0ba61b4ed2bda1d8ec52de9ce6 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Sun, 1 Dec 2024 13:00:27 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=B4=A2=E5=BC=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs b/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs index 13dcf862..51b86322 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs @@ -23,17 +23,15 @@ public class SyncOriginCardInfoJob : BaseJob protected override async Task RunAsync(IServiceProvider serviceProvider) { - var start = DateTime.Now.AddDays(-2); + var start = DateTime.Now.AddDays(-3); var requests = await DbContext.Queryable() .LeftJoin((x, device) => x.DeviceUniqueNo == device.UniqueNo) .Where(x => x.ModifiedTime > start) - .Where(x => !string.IsNullOrEmpty(x.UserUniqueNo)) + .Where(x => x.Type == DeviceUploadLogTypeEnumType.Attendance) .Where(x => x.Sync == false) + .Where(x => !string.IsNullOrEmpty(x.UserUniqueNo)) .Where(x => SqlFunc.Subqueryable().Where(p => p.Code == x.UserUniqueNo).NotAny()) - .Where(x => SqlFunc.Subqueryable() - .Where(p => p.UniqueNo == x.DeviceUniqueNo) - .Where(p => p.Type == DeviceTypeEnumType.Attendance || (p.Type == DeviceTypeEnumType.Door && p.AsAttendance)).Any()) .Select((x, device) => new UploadAttendanceRequestItem { Id = x.Id, @@ -41,7 +39,7 @@ public class SyncOriginCardInfoJob : BaseJob ZNOTE = device.DeployPlace, ZWORKCODE = x.UserUniqueNo }) - .ToPageListAsync(1, 500); + .ToPageListAsync(1, 1000); Logger.LogInformation("获取待上传考勤记录数:{count}", requests.Count);