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)