From 6198e4bb8e5b89ca32c46b12f43d6c4d05d9ce3b Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 22 Apr 2025 10:43:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=BF=87=E6=BB=A4=E5=9C=A8=E8=81=8C?= =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OpenApi/Services/Implements/GainfoService.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Src/Dlhis.External/OpenApi/Services/Implements/GainfoService.cs b/Src/Dlhis.External/OpenApi/Services/Implements/GainfoService.cs index b154d303..c76b5c30 100644 --- a/Src/Dlhis.External/OpenApi/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.External/OpenApi/Services/Implements/GainfoService.cs @@ -8,6 +8,7 @@ using Kurisu.AspNetCore.CustomClass; using Kurisu.AspNetCore.DataAccess.Dto; using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; +using SqlSugar; namespace Dlhis.External.OpenApi.Services.Implements; @@ -42,6 +43,11 @@ public class GainfoService : IGainfoService var gainfoLeaves = await _dbContext.Queryable().AS("GainfoLeave") .LeftJoin((x, d) => x.DepartmentNo == d.No) .Where(x => factories.Contains(x.Factory)) + .Where(x => SqlFunc.Subqueryable() + .Where(p => factories.Contains(p.Factory)) + .Where(p => p.Code == x.Code) + .NotAny() + ) .Select((x, d) => new GainfoOpenResponse { Code = x.Code, @@ -74,7 +80,7 @@ public class GainfoService : IGainfoService Status = GainfoStatusEnumType.Working, }) .ToListAsync(); - + return gainfos; }