From 0ad2c8e379d85e2bd5d5fa7a027f40bea7e346b2 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 18 Mar 2025 10:01:45 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=86=85=E9=83=A8=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E9=97=A8=E5=B2=97=E9=94=99=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=E9=86=92=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Appointment/Services/Implements/AppointmentService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Src/Dlhis.External/Appointment/Services/Implements/AppointmentService.cs b/Src/Dlhis.External/Appointment/Services/Implements/AppointmentService.cs index 556bfdfa..7b0914f7 100644 --- a/Src/Dlhis.External/Appointment/Services/Implements/AppointmentService.cs +++ b/Src/Dlhis.External/Appointment/Services/Implements/AppointmentService.cs @@ -43,6 +43,14 @@ public class AppointmentService : IAppointmentService await _dbContext.InsertAsync(mst); var invalids = new[] { GainfoUserTypeEnumType.Normal, GainfoUserTypeEnumType.SecurityWhite }; + + var idNos = request.Items.Where(x => x.IsEnterDoorArea).Select(x => x.IdNo).Distinct().ToList(); + var errors = await _dbContext.Queryable().Where(x => idNos.Contains(x.Code) || idNos.Contains(x.Code)) + .Where(x => invalids.Contains(x.Type)) + .Select(x => x.Code).ToListAsync(); + + errors.ThrowIfExists($"内部人员无法发起门岗预约({errors.Join(",")})"); + foreach (var item in request.Items) { if (item.IsEnterDoorArea && areas.Where(x => x.Type == AppointmentAreaEnumType.Door)