54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using Dlhis.Entity.Device.Enums;
|
|
using Kurisu.AspNetCore.CustomClass;
|
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
|
|
|
namespace Dlhis.ScheduledTask.TaskAssignment.Request;
|
|
|
|
public class DeviceTaskAssignmentRequest : PageDto, IValidatableObject
|
|
{
|
|
/// <summary>
|
|
/// 设备类型 DeviceTypeEnumType
|
|
/// </summary>
|
|
[EnumDataType(typeof(DeviceTypeEnumType))]
|
|
public DeviceTypeEnumType? Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// 任务类型
|
|
/// </summary>
|
|
public List<DeviceTaskEnumType> TaskTypes { get; set; }
|
|
|
|
/// <summary>
|
|
/// 任务下发状态 DeviceTaskStatusEnumType
|
|
/// </summary>
|
|
public List<DeviceTaskStatusEnumType> Status { get; set; }
|
|
|
|
public string UserNo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 厂区
|
|
/// </summary>
|
|
[Required(ErrorMessage = "厂区不可为空")]
|
|
public string Factory { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 是否离线
|
|
/// </summary>
|
|
public bool? IsOffline { get; set; }
|
|
|
|
/// <summary>
|
|
/// 搜索范围
|
|
/// </summary>
|
|
public DateTimePeriod SearchDateTimePeriod { get; set; }
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
{
|
|
if (SearchDateTimePeriod is { End: not null })
|
|
{
|
|
SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1);
|
|
}
|
|
|
|
yield break;
|
|
}
|
|
} |