diff --git a/Src/Dlhis.ScheduledTask/Packs/JobPack.cs b/Src/Dlhis.ScheduledTask/Packs/JobPack.cs index 49f75fff..a6d1ed78 100644 --- a/Src/Dlhis.ScheduledTask/Packs/JobPack.cs +++ b/Src/Dlhis.ScheduledTask/Packs/JobPack.cs @@ -13,7 +13,7 @@ public class JobPack : BaseAppPack public override void Invoke(IServiceProvider serviceProvider) { - RecurringJob.AddOrUpdate("SyncSap", s => s.SyncOrgInfo(), "0 0 2 * * ?", new RecurringJobOptions + RecurringJob.AddOrUpdate("SyncSap", s => s.RunAsync(), "0 0 2 * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncOrganizationJob.cs b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncOrganizationJob.cs index 2e7bc3e0..17e8567b 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncOrganizationJob.cs +++ b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncOrganizationJob.cs @@ -20,7 +20,7 @@ public class SyncOrganizationJob _jinkoSapService = jinkoSapService; } - public async Task SyncOrgInfo() + public async Task RunAsync() { var orgResult = await _jinkoSapService.GetSapOrganizationsAsync(); diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs index 4bf792b5..71969e5d 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs +++ b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs @@ -28,10 +28,12 @@ public class SyncPersonJob var personResp = await _jinkoSapService.GetPersonsAsync(); var persons = personResp.Person.Items; + _logger.LogInformation("获取SAP人员数量为:{count}", persons.Count); if (persons.Count > 0) { _positions = await _dbContext.Queryable().ToListAsync(); var modifiedPersons = await GetModifiedPersonAsync(persons.OrderByDescending(x => x.ZSTATUS).ThenBy(x => x.ZRZRQ).ToList()); + _logger.LogInformation("SAP人员差异数量为:{count}", modifiedPersons.Count); if (modifiedPersons.Count > 0) { var failedRecords = SavePerson(modifiedPersons);