using System.ComponentModel.DataAnnotations; using Dlhis.Visitor.Appointment.Dto; namespace Dlhis.Visitor.Appointment.Request; public class AppointmentReceiveRequest : IValidatableObject { /// /// 流水号 /// [Required(ErrorMessage = "流水号必填")] public string FlowId { get; set; } /// /// 标题 /// [Required(ErrorMessage = "标题必填")] public string Title { get; set; } /// /// 对接人工号 /// [Required(ErrorMessage = "对接人工号必填")] public string Code { get; set; } /// /// 对接人姓名 /// [Required(ErrorMessage = "对接人姓名必填")] public string Name { get; set; } /// /// 申请时间 /// [Required(ErrorMessage = "申请时间必填")] public DateTime ApplyTime { get; set; } /// /// 预约区域 /// [Required(ErrorMessage = "申请预约区域必填")] public string ApplyArea { get; set; } /// /// 来源公司 /// [Required(ErrorMessage = "来源公司")] public string Company { get; set; } /// /// 来访时间 /// public DateTime Start { get; set; } /// /// 离开时间 /// public DateTime End { get; set; } /// /// 描述 /// public string Description { get; set; } /// /// 厂区 /// public string Factory { get; set; } /// /// 明细 /// [MinLength(1, ErrorMessage = "明细必填")] public List Items { get; set; } public IEnumerable Validate(ValidationContext validationContext) { if (Start >= End) { yield return new ValidationResult("来访时间不能大于等于离开时间", new[] { nameof(Start), nameof(End) }); } } }