From c7fce25959bbab6a0913c7731d3ca2296d3f1df6 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 20 Jan 2026 10:02:36 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=AE=8C=E6=95=B4=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Implements/AppointmentService.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Src/Dlhis.External/Appointment/Services/Implements/AppointmentService.cs b/Src/Dlhis.External/Appointment/Services/Implements/AppointmentService.cs index eaf26c4b..be385e11 100644 --- a/Src/Dlhis.External/Appointment/Services/Implements/AppointmentService.cs +++ b/Src/Dlhis.External/Appointment/Services/Implements/AppointmentService.cs @@ -58,15 +58,24 @@ public class AppointmentService : IAppointmentService var invalids = new[] { GainfoUserTypeEnumType.Normal, GainfoUserTypeEnumType.SecurityWhite }; - var idNos = request.Items.Where(x => x.IsEnterDoorArea).Select(x => x.IdNo).Distinct().ToList(); + var enterDoorAreaIdNos = request.Items.Where(x => x.IsEnterDoorArea).Select(x => x.IdNo).Distinct().ToList(); var errors = await _dbContext.Queryable() - .Where(x => idNos.Contains(x.IdNo) || idNos.Contains(x.Code)) + .Where(x => enterDoorAreaIdNos.Contains(x.IdNo) || enterDoorAreaIdNos.Contains(x.Code)) .Where(x => invalids.Contains(x.Type)) .Select(x => x.IdNo + x.Name) .ToListAsync(); errors.ThrowIfExists($"内部人员无法发起门岗预约({errors.Join(",")})"); + var idNos = request.Items.Select(x => x.IdNo).Distinct().ToList(); + var outsources = await _dbContext.Queryable() + .Where(x => idNos.Contains(x.IdNo) || idNos.Contains(x.Code)) + .Where(x => x.Type == GainfoUserTypeEnumType.Outsource) + .Select(x => x.IdNo + x.Name) + .ToListAsync(); + + outsources.ThrowIfExists($"存在外包人员申请,请检查一下人员:{outsources.Join(",")}"); + foreach (var item in request.Items) { if (item.IsEnterDoorArea && areas.Where(x => x.Type == AppointmentAreaEnumType.Door)