From b412df0f87090856316776fac6b5dc660de725ea Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 11 Oct 2024 16:11:07 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A4=9A=E9=87=8D=E5=90=8DNo=E6=98=A0?= =?UTF-8?q?=E5=B0=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Appointment/Services/Implements/AppointmentService.cs | 1 + .../Appointment/Dto/AppointmentReceiveItemDto.cs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs index 120f5bd8..734dfc13 100644 --- a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs +++ b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs @@ -120,6 +120,7 @@ public class AppointmentService : IAppointmentService .Where(x => (x.IsEnterDoorArea && SqlFunc.DateIsSame(x.DoorStart, now)) || (x.IsEnterWorkplace && SqlFunc.DateIsSame(x.WorkplaceStart, now))) .Select(x => new AppointmentDetailResponse { + No = x.No, Mst = SqlFunc.Subqueryable().Where(p => p.No == x.No).First() }, true) .SingleAsync(); diff --git a/Src/Dlhis.External/Appointment/Dto/AppointmentReceiveItemDto.cs b/Src/Dlhis.External/Appointment/Dto/AppointmentReceiveItemDto.cs index 10cab989..256a852c 100644 --- a/Src/Dlhis.External/Appointment/Dto/AppointmentReceiveItemDto.cs +++ b/Src/Dlhis.External/Appointment/Dto/AppointmentReceiveItemDto.cs @@ -58,12 +58,12 @@ public class AppointmentReceiveItemDto : IValidatableObject /// /// 访客开始 /// - public DateTime DoorStart { get; set; } + public DateTime? DoorStart { get; set; } /// /// 访问结束 /// - public DateTime DoorEnd { get; set; } + public DateTime? DoorEnd { get; set; } /// /// 进入车间 @@ -95,7 +95,7 @@ public class AppointmentReceiveItemDto : IValidatableObject yield return new ValidationResult($"{Name}门岗区域不可为空", new[] { nameof(ApplyWorkplaceAreas) }); } - if (DoorStart >= DoorEnd) + if (!DoorStart.HasValue || !DoorEnd.HasValue || DoorStart >= DoorEnd) { yield return new ValidationResult($"{Name}门禁来访时间有误", new[] { nameof(DoorStart) }); }