From 832cb143304cc681f6022a032e2ec763f512358f Mon Sep 17 00:00:00 2001 From: liguoyang Date: Sat, 30 Nov 2024 16:06:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=90=8C=E6=AD=A5=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.ScheduledTask/Jobs/SyncPersonJob.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/Jobs/SyncPersonJob.cs b/Src/Dlhis.ScheduledTask/Jobs/SyncPersonJob.cs index abf781d6..ddb88339 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/SyncPersonJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/SyncPersonJob.cs @@ -24,15 +24,9 @@ public class SyncPersonJob : BaseJob foreach (var werk in werks) { - if (!werk.BackgroundJobKey.IsEmpty()) - { - var jobKey = BackgroundJob.Enqueue(x => x.SyncGainfoByWerkAsync(werk.Werk)); - werk.BackgroundJobKey = jobKey; - await DbContext.UpdateAsync(werk); - - continue; - } - + var jobKey = BackgroundJob.Enqueue(x => x.SyncGainfoByWerkAsync(werk.Werk)); + werk.BackgroundJobKey = jobKey; + await DbContext.UpdateAsync(werk); Logger.LogInformation("SAP创建人事范围{werk}后台调度任务", werk.Werk); } }