using APT.BaseData.Domain.Entities;
using APT.BaseData.Domain.Entities.FM;
using APT.BaseData.Domain.Enums;
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_MAINTENANCE_PLAN : MesEntityBase
    {
        /// <summary>
        /// 跑批ID
        /// </summary>
        [Description("跑批ID")]
        public Guid? SYNC_ID { get; set; }
        /// <summary>
        /// 编码
        /// </summary>
        [Description("编码")]
        [CodeRule((int)PFCodeRuleType.机电管理)]
        [CUnique]
        [DataFieldLength(50)]
        public string CODE { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [Description("名称")]
        [DataFieldLength(200)]
        public string NAME { get; set; }

        /// <summary>
        /// 年度
        /// </summary>
        [Description("年度")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public int YEARPLAN { get; set; }

        /// <summary>
        /// 设备明细
        /// </summary>
        [Description("设备明细")]
        public virtual ICollection<T_DM_DEVICE_MAINTENANCE_PLAN_DETAIL> Nav_PlanDetails { get; set; }

        /// <summary>
        /// 维保工作方案
        /// </summary>
        [Description("维保工作方案")]
        public virtual ICollection<T_DM_DEVICE_MAINTENANCE_PLAN_FILE> Nav_Files { get; set; }

        /// <summary>
        /// 启用标志
        /// </summary>
        [Description("启用标志")]
        [FormFieldTable]
        [FormFieldEdit]
        public FMEnableStatusEnum ENABLE_STATUS { get; set; }

        /// <summary>
        /// 审批状态
        /// </summary>
        [Description("审批状态")]
        [FormFieldTable]
        [FormFieldQuery]
        public PFStandardStatus STATUS_APPROVE { get; set; }

        /// <summary>
        /// 审批流
        /// </summary>
        [Description("审批流")]
        [DataFieldForeignKey("Nav_Approve")]
        public Guid? APPROVE_ID { get; set; }

        /// <summary>
        /// 审批流
        /// </summary>
        [Description("审批流")]
        public T_PF_APPROVE Nav_Approve { get; set; }

        /// <summary>
        ///制定部门
        /// </summary>
        [Description("制定部门")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [DataFieldForeignKey("Nav_Department")]
        public Guid? DEPARTMENT_ID { get; set; }
        /// <summary>
        /// 制定部门
        /// </summary>
        [Description("制定部门")]
        public T_FM_DEPARTMENT Nav_Department { 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("生产单元")]
        [EnumName("FMProductionUnit")]
        public int? MineType { get; set; }

        [Description("是否跑批")]
        public int IS_RUN { get; set; }
    }
}