diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs index d98f124b..c9a09dcf 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs @@ -99,7 +99,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService var workGridInfo = new WorkGridInfo(); var currentWorkGridTimePeriods = workGridTimePeriods.Where(x => x.TenantId == device.TenantId).ToList(); var workGridUser = workGridUsers.FirstOrDefault(x => x.UserCode == request.UserUniqueNo); - if (currentWorkGridTimePeriods.Any() && workGridUser != null) + if (needUpload && currentWorkGridTimePeriods.Any() && workGridUser != null) { workGridInfo.TimeSetting = currentWorkGridTimePeriods; workGridInfo.WorkGrid = new @@ -152,6 +152,8 @@ public class DeviceUploadLogService : IDeviceUploadLogService } } } + + needUpload = workGridInfo.PeriodType.HasValue; } inserts.Add(new DeviceUploadLogEntity @@ -406,6 +408,4 @@ public class WorkGridInfo public object WorkGrid { get; set; } public WorkGridTimePeriodEnumType? PeriodType { get; set; } public object TimeSetting { get; set; } - - public bool NeedUpload => WorkGrid != null && PeriodType.HasValue; } \ No newline at end of file