fix 任务获取支持根据厂区
This commit is contained in:
@@ -27,11 +27,16 @@ public class DeviceTaskGetRequest : PageDto, IValidatableObject
|
||||
/// </summary>
|
||||
public bool IsProcess { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 厂区
|
||||
/// </summary>
|
||||
public string Factory { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (Brand.IsEmpty() && DeviceUniqueNo.IsEmpty())
|
||||
if (Brand.IsEmpty() && DeviceUniqueNo.IsEmpty() && Factory.IsEmpty())
|
||||
{
|
||||
yield return new ValidationResult("设备品牌和设备唯一号不能都为空", new[] { nameof(Brand), nameof(DeviceUniqueNo) });
|
||||
yield return new ValidationResult("设备品牌,设备号和厂区不能都为空", new[] { nameof(Brand), nameof(DeviceUniqueNo), nameof(Factory) });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user