From a9c8ab7d00c22db716cf38d2c9c4e8d1304dad7c Mon Sep 17 00:00:00 2001 From: liguoyang Date: Wed, 21 Feb 2024 18:15:15 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.ScheduledTask/Packs/JobPack.cs | 2 +- Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncOrganizationJob.cs | 2 +- Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPersonJob.cs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) 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);