From 8443dd7446a9cd4d9ebd3e7bd68b8aa9ef80d28b Mon Sep 17 00:00:00 2001 From: liguoyang Date: Mon, 15 Apr 2024 18:03:30 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A4=84=E7=90=86=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=86=99=E5=85=A5=E7=B4=A2=E5=BC=95=E7=BA=A6=E6=9D=9F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/Services/Implements/GainfoUpdateService.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs index 4fa23cbf..7924d9bd 100644 --- a/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs @@ -237,7 +237,10 @@ public class GainfoUpdateService : IGainfoUpdateService } else { - await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync(); + if (!await _dbContext.Queryable().AnyAsync(x => x.Code == item.ename)) + { + await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync(); + } return null; } } @@ -371,7 +374,10 @@ public class GainfoUpdateService : IGainfoUpdateService else { var info = GainfoSapToGainfo(item); - await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync(); + if (!await _dbContext.Queryable().AnyAsync(x => x.Code == item.ename)) + { + await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync(); + } } }