fix 实体校验调整
This commit is contained in:
@@ -53,7 +53,6 @@ public class AppointmentReceiveItemDto : IValidatableObject
|
||||
/// <summary>
|
||||
/// 预约门岗区域
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "预约门岗区域不可为空")]
|
||||
public string ApplyDoorArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -89,9 +88,17 @@ public class AppointmentReceiveItemDto : IValidatableObject
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<ValidationResult> 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)
|
||||
|
||||
Reference in New Issue
Block a user