From 581294237cd09064271ea9e27c721b10ac6a789e Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 16 Apr 2024 19:38:54 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/Services/Implements/GainfoUpdateService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs index 7924d9bd..260e1186 100644 --- a/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs @@ -368,7 +368,10 @@ public class GainfoUpdateService : IGainfoUpdateService gainfo.Id = 0; gainfo.ResignationDate = item.ZLZRQ; - await _dbContext.Client.Insertable(gainfo).AS("GainfoLeave").ExecuteCommandAsync(); + if (!await _dbContext.Queryable().AnyAsync(x => x.Code == item.ename)) + { + await _dbContext.Client.Insertable(gainfo).AS("GainfoLeave").ExecuteCommandAsync(); + } await _dbContext.DeleteReallyAsync(gainfo); } else