using Hotline.Share.Dtos.File;
using SqlSugar;
using System.ComponentModel;
using XF.Domain.Repository;

namespace Hotline.Orders
{
    [Description("督办")]
    public class OrderSupervise : FullStateEntity
    {
        /// <summary>
        /// 工单ID
        /// </summary>
        [SugarColumn(ColumnDescription = "工单ID")]
        public string OrderId { get; set; }

        /// <summary>
        /// 督办回复时限
        /// </summary>
        [SugarColumn(ColumnDescription = "督办回复时限")]
        public DateTime ReplyLimitTime { get; set; }

        /// <summary>
        /// 被督办部门ID
        /// </summary>
        [SugarColumn(ColumnDescription = "被督办部门ID")]
        public string? OrgId { get; set; }

        /// <summary>
        /// 被督办部门名称
        /// </summary>
        [SugarColumn(ColumnDescription = "被督办部门名称")]
        public string OrgName { get; set; }

        /// <summary>
        /// 发起部门名称
        /// </summary>
        [SugarColumn(ColumnDescription = "发起部门名称")]
        public string? LaunchOrgName { get; set; }

        /// <summary>
        /// 督办状态
        /// </summary>
        [SugarColumn(ColumnDescription = "督办状态   0 待回复  1 已回复")]
        public int State { get; set; }

        /// <summary>
        /// 督办签收时间
        /// </summary>
        [SugarColumn(ColumnDescription = "督办签收时间")]
        public DateTime? SignTime { get; set; }

        /// <summary>
        /// 督办回复时间
        /// </summary>
        [SugarColumn(ColumnDescription = "督办回复时间")]
        public DateTime? ReplyTime { get; set; }

        /// <summary>
        /// 督办申请内容
        /// </summary>
        [SugarColumn(ColumnDescription = "督办申请内容", ColumnDataType = "text")]
        public string? ApplyContent { get; set; }

        /// <summary>
        /// 督办回复内容
        /// </summary>
        [SugarColumn(ColumnDescription = "督办回复内容", ColumnDataType = "text")]
        public string? ReplyContent { get; set; }

        /// <summary>
        /// 回复人
        /// </summary>
        [SugarColumn(ColumnDescription = "回复人")]
        public string? ReplyId { get; set; }


        /// <summary>
        /// 是否省督办
        /// </summary>
        [SugarColumn(ColumnDescription = "是否省督办")]
        public bool? Province { get; set; }


        /// <summary>
        /// 
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(OrderId))]
        public Order Order { get; set; }

        [SugarColumn(ColumnDescription = "回复人")]
        public string? ReUser { get; set; }

        [SugarColumn(ColumnDescription = "申请人")]
        public string? CrUser { get; set; }

        [SugarColumn(ColumnDescription = "签收人")]
        public string? SignUser { get; set; }

        /// <summary>
        /// 督办省编号
        /// </summary>
        [SugarColumn(ColumnDescription = "省督办编号")]
        public string? SuperviseSerial { get; set; }


        [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
        public List<FileJson>? FileJson { get; set; }

        [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
        public List<FileJson>? ReplyFileJson { get; set; }

        /// <summary>
        /// 督办标题
        /// </summary>
        public string? SuperviseTitle { get; set; }

        /// <summary>
        /// 督办发起时间
        /// </summary>
        public DateTime? SuperviseTime { get; set; }

        /// <summary>
        /// 督办类型
        /// </summary>
        public string? SuperviseType { get; set; }
    }
}