From 1b9591936e7fd99f6cca82769a2311f1368f62c2 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Wed, 11 Sep 2024 14:19:23 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=AE=9E=E4=BD=93=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Appointment/Dto/AppointmentReceiveItemDto.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Src/Dlhis.External/Appointment/Dto/AppointmentReceiveItemDto.cs b/Src/Dlhis.External/Appointment/Dto/AppointmentReceiveItemDto.cs index 8710a565..f4552638 100644 --- a/Src/Dlhis.External/Appointment/Dto/AppointmentReceiveItemDto.cs +++ b/Src/Dlhis.External/Appointment/Dto/AppointmentReceiveItemDto.cs @@ -53,7 +53,6 @@ public class AppointmentReceiveItemDto : IValidatableObject /// /// 预约门岗区域 /// - [Required(ErrorMessage = "预约门岗区域不可为空")] public string ApplyDoorArea { get; set; } /// @@ -89,9 +88,17 @@ public class AppointmentReceiveItemDto : IValidatableObject /// public IEnumerable Validate(ValidationContext validationContext) { - if (DoorStart >= DoorEnd) + if (IsEnterDoorArea) { - yield return new ValidationResult($"{Name}门禁来访时间有误", new[] { nameof(DoorStart) }); + if (ApplyDoorArea.IsEmpty()) + { + yield return new ValidationResult($"{Name}门岗区域不可为空", new[] { nameof(ApplyWorkplaceAreas) }); + } + + if (DoorStart >= DoorEnd) + { + yield return new ValidationResult($"{Name}门禁来访时间有误", new[] { nameof(DoorStart) }); + } } if (IsEnterWorkplace)