using APT.BaseData.Domain.Entities.FM;
using APT.BaseData.Domain.Enums.PF;
using APT.Infrastructure.Core;
using APT.MS.Domain.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace APT.MS.Domain.Entities.DM
{
    /// <summary>
    /// 设备设施故障报修
    /// </summary>
    [Description("设备设施故障报修")]
    [DataRuleField("DEPARTMENT_ID")]
    public class T_DM_DEVICE_REPAIR : MesEntityBase
    {
        /// <summary>
        /// 编码
        /// </summary>
        [Description("编码")]
        [FormFieldTable]
        [FormFieldQuery]
        [DataFieldLength(50)] 
        public string CODE { get; set; }
        /// <summary>
        /// 报修时间
        /// </summary>
        [Description("报修时间")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public DateTime REPAIR_TIME { get; set; }
        /// <summary>
        /// 报修人员
        /// </summary>
        [Description("报修人员")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [DataFieldForeignKey("Nav_User")]
        public Guid? USER_ID { get; set; }
        /// <summary>
        /// 导航_报修人员
        /// </summary>
        [Description("导航_报修人员")]
        public T_FM_USER Nav_User { get; set; }
        /// <summary>
        /// 设备设施名称
        /// </summary>
        [Description("设备设施名称")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [DataFieldForeignKey("Nav_Device")]
        public Guid? DEVICE_BASE_ID { get; set; }
        /// <summary>
        /// 导航_设备设施名称
        /// </summary>
        [Description("导航_设备设施名称")]
        public T_DM_DEVICE_BASE Nav_Device { get; set; }
        /// <summary>
        /// 设备名称
        /// </summary>
        [Description("设备名称")]
        public string MACHINE_NAME { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        [Description("规格")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string SPEC { get; set; }
        /// <summary>
        /// 设备编号
        /// </summary>
        [Description("设备编号")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string MACHINE_CODE { get; set; }
        /// <summary>
        /// 设备位置
        /// </summary>
        [Description("设备位置")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string POSITION { get; set; }
        /// <summary>
        /// 故障描述
        /// </summary>
        [Description("故障描述")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string DESCRPTION { get; set; }
        /// <summary>
        /// 维修紧迫性
        /// </summary>
        [Description("维修紧迫性")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [EnumName("DMRepairStatusEnum")]
        public DMRepairStatusEnum EMERGENCY_LEVEL_NAME { get; set; }
        /// <summary>
        /// 状态：故障记录，检修中，完成
        /// </summary> 
        [Description("状态")]
        [FormFieldTable]
        [FormFieldQuery]
        [EnumName("PFStandardStatus")]
        public PFStandardStatus STATUS { get; set; }
        /// <summary>
        /// 维修负责人
        /// </summary>
        [Description("维修负责人")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [DataFieldForeignKey("Nav_Repair_Charge_User")]
        public Guid? REPAIR_CHARGE_USER_ID { get; set; }
        /// <summary>
        /// 导航_维修负责人
        /// </summary>
        [Description("导航_维修负责人")]
        public T_FM_USER Nav_Repair_Charge_User { get; set; }
        /// <summary>
        /// 是否申请外部援助
        /// </summary> 
        [Description("是否申请外部援助")]
        public bool IS_HELP { get; set; }
        /// <summary>
        /// 维修人员
        /// </summary>
        [Description("维修人员")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [DataFieldForeignKey("Nav_Repair_User")]
        public Guid? REPAIR_USER_ID { get; set; }
        /// <summary>
        /// 导航_维修人员
        /// </summary>
        [Description("导航_维修人员")]
        public T_FM_USER Nav_Repair_User { get; set; }
        /// <summary>
        /// 附件
        /// </summary>
        [Description("附件")]
        public List<T_DM_DEVICE_REPAIR_FILE> Nav_Files { get; set; }

        [Description("是否发布")]
        [DataFieldIngore]
        public string PUBLISH { get; set; }

        /// <summary>
        /// 生产单元
        /// </summary>
        [Description("生产单元")]
        [EnumName("FMProductionUnit")]
        public int? MineType { get; set; }

        [Description("维修部门")]
        [DataFieldForeignKey("Nav_Department")]
        public Guid? DEPARTMENT_ID { get; set; }
        [Description("维修部门")]
        public T_FM_DEPARTMENT Nav_Department { get; set; }

        [Description("驳回意见")]
        [DataFieldIngore]
        public string CONTEXT { get; set; }
    }
}