using Hotline.Share.Dtos.File;
using Hotline.Share.Enums.Order;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XF.Domain.Repository;

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


        /// <summary>
        /// 回访id
        /// </summary>
        [SugarColumn(ColumnDescription = "回访id")]
        public string VisitId { get; set; }

        /// <summary>
        /// 回访明细id
        /// </summary>
        [SugarColumn(ColumnDescription = "回访明细id")]
        public string VisitDetailId { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [SugarColumn(ColumnDescription = "状态")]
        public ESecondaryHandlingState? State { get; set; }

        /// <summary>
        /// 重提办理
        /// </summary>
        public int? SendBackNum { get; set; }

        /// <summary>
        /// 申请理由
        /// </summary>
        [SugarColumn(ColumnDescription = "申请理由", ColumnDataType = "text")]
        public string? Content { get; set; }

        /// <summary>
        /// 退回意见
        /// </summary>
        [SugarColumn(ColumnDescription = "退回意见", ColumnDataType = "text")]
        public string? SendBackContent { get; set; }

        /// <summary>
        /// 审批意见
        /// </summary>
        [SugarColumn(ColumnDescription = "审批意见", ColumnDataType = "text")]
        public string? AuditContent { get; set; }

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


        /// <summary>
        /// 回访
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(VisitDetailId))]
        public OrderVisitDetail VisitDetail { get; set; }

        /// <summary>
        /// 回访
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(VisitId))]
        public OrderVisit Visit { get; set; }

        /// <summary>
        /// 审批人ID
        /// </summary>
        [SugarColumn(ColumnDescription = "审批人ID")]
        public string? AuditId { get; set; }

        [SugarColumn(ColumnDescription = "审批人")]
        public string? AuditUser { get; set; }

        /// <summary>
        /// 审批时间
        /// </summary>
        public DateTime? AuditTime { get; set; }

        /// <summary>
        /// 申请部门ID
        /// </summary>
        [SugarColumn(ColumnDescription = "申请部门ID")]
        public string ApplyOrgId { get; set; }

        /// <summary>
        /// 申请部门名称
        /// </summary>
        [SugarColumn(ColumnDescription = "申请部门名称")]
        public string ApplyOrgName { get; set; }

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

        /// <summary>
        /// 回访状态
        /// </summary>
        public EVisitState VisitState { get; set; }

        /// <summary>
        /// 是否办理完成
        /// </summary>
        public bool? IsHandel { get; set; }
    }
}
