diff --git a/Src/Dlhis.ScheduledTask/BaseJob.cs b/Src/Dlhis.ScheduledTask/BaseJob.cs index c8dcaa44..702f5530 100644 --- a/Src/Dlhis.ScheduledTask/BaseJob.cs +++ b/Src/Dlhis.ScheduledTask/BaseJob.cs @@ -30,7 +30,7 @@ public abstract class BaseJob : IJob sqlSugarOptionsService.IgnoreTenant = true; var name = this.GetType().GetCustomAttribute()!.Name; - Logger.LogDebug("[{name}]开始执行...", name); + Logger.LogInformation("[{name}]开始执行...", name); try { @@ -42,7 +42,7 @@ public abstract class BaseJob : IJob } finally { - Logger.LogDebug("[{name}]执行结束...", name); + Logger.LogInformation("[{name}]执行结束...", name); DbContext.Client.QueryFilter.Restore(); sqlSugarOptionsService.IgnoreTenant = false; } diff --git a/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs b/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs index 84a054cc..4e910b0b 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs @@ -48,14 +48,11 @@ public class MealSupplementHandlerJob : BaseJob if (gainfo == null) { gainfo = await DbContext.Queryable().AS("GainfoLeave").Where(x => x.Code == item.Code).SingleAsync(); - if (gainfo != null) + if (gainfo != null && gainfo.ResignationDate < item.Date) { try { - //离职数据 - if (gainfo.ResignationDate < item.Date) - { - var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List + var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List { new() { @@ -65,14 +62,14 @@ public class MealSupplementHandlerJob : BaseJob } }); - await DbContext.Updateable() - .SetColumns(x => x.Result == r) - .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Success) - .SetColumns(x => x.Sync == true) - .SetColumns(x => x.ModifiedTime == DateTime.Now) - .Where(x => x.UniqueId == item.UniqueId) - .ExecuteCommandAsync(); - } + await DbContext.Updateable() + .SetColumns(x => x.Result == r) + .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Success) + .SetColumns(x => x.Sync == true) + .SetColumns(x => x.ModifiedTime == DateTime.Now) + .Where(x => x.UniqueId == item.UniqueId) + .ExecuteCommandAsync(); + } catch {