using APT.BaseData.Domain.Entities.FM;
using APT.Infrastructure.Core;
using APT.MS.Domain.Entities.SC.DM;
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_BASE : MesEntityBase
    {
        /// <summary>
        /// 编码
        /// </summary>
        [Description("编码")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string CODE { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [Description("名称")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string NAME { get; set; }
        /// <summary>
        /// 内部编码
        /// </summary>
        [Description("内部编码")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string MACHINE_CODE { get; set; }
        /// <summary>
        /// TPMID
        /// </summary>
        [Description("TPMID")]
        public Guid? TPM_ID { get; set; }
        /// <summary>
        /// 系统分类
        /// </summary>
        [Description("系统分类")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [DataFieldForeignKey("Nav_Category")]
        public Guid? CATEGORY_ID { get; set; }
        /// <summary>
        /// 系统分类
        /// </summary>
        [Description("系统分类")]
        public T_DM_CATEGORY Nav_Category { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        [Description("类型")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [DataFieldForeignKey("Nav_Type")]
        public Guid? TYPE_ID { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        [Description("类型")]
        public T_DM_TYPE Nav_Type { get; set; }
        /// <summary>
        ///是否应急物资
        /// </summary>
        [Description("是否应急物资")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public bool IS_EMERGENCY { get; set; }
        /// <summary>
        ///规格
        /// </summary>
        [Description("规格")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string SPEC { get; set; }
        /// <summary>
        ///购置日期
        /// </summary>
        [Description("购置日期")]
        [FormFieldEdit]
        public DateTime? PURCHASE_DATE { get; set; }

        /// <summary>
        ///验收日期
        /// </summary>
        [Description("验收日期")]
        [FormFieldEdit]
        public DateTime? ACCEPT_DATE { get; set; }
        /// <summary>
        ///数量
        /// </summary>
        [Description("数量")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public int QTY { get; set; }
        /// <summary>
        ///单位
        /// </summary>
        [Description("单位")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string UNIT { get; set; }
        /// <summary>
        ///用途
        /// </summary>
        [Description("用途")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string PURPOSE { get; set; }
        /// <summary>
        ///存放位置
        /// </summary>
        [Description("存放位置")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string POSITION { get; set; }
        /// <summary>
        ///使用部门
        /// </summary>
        [Description("使用部门")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [DataFieldForeignKey("Nav_UseDepartment")]
        public Guid? USE_DEPARTMENT_ID { get; set; }
        /// <summary>
        /// 使用部门
        /// </summary>
        [Description("使用部门")]
        public T_FM_DEPARTMENT Nav_UseDepartment { get; set; }
        /// <summary>
        ///使用人员
        /// </summary>
        [Description("使用人员")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [DataFieldForeignKey("Nav_UseUser")]
        public Guid? USE_USER_ID { get; set; }
        /// <summary>
        /// 使用人员
        /// </summary>
        [Description("使用人员")]
        public T_FM_USER Nav_UseUser { get; set; }
        /// <summary>
        /// 使用岗位
        /// </summary>
        [Description("使用岗位")]
        [DataFieldForeignKey("Nav_UseUserPost")]
        public Guid? USE_USER_POST_ID { get; set; }
        /// <summary>
        /// 使用岗位
        /// </summary>
        [Description("使用岗位")]
        public T_FM_USER_POST Nav_UseUserPost { 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("管理岗位")]
        [DataFieldForeignKey("Nav_UserPost")]
        public Guid? USER_POST_ID { get; set; }
        /// <summary>
        /// 管理岗位
        /// </summary>
        [Description("管理岗位")]
        public T_FM_USER_POST Nav_UserPost{get; set;}
        /// <summary>
        ///主要技术参数
        /// </summary>
        [Description("主要技术参数")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public string PARAMETER { get; set; }
        /// <summary>
        /// 类别 :设备、设施、其他
        /// </summary>
        [Description("类别")]
        [EnumName("DMDeviceTypeEnum")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public DMDeviceTypeEnum DEVICE_TYPE { get; set; }
        /// <summary>
        /// 是否已发送
        /// </summary>
        [Description("是否已发送")]
        public int IS_SEND { get; set; }
        /// <summary>
        /// 附件
        /// </summary>
        [Description("附件")]
        public List<T_DM_DEVICE_BASE_FILE> Nav_Files { get; set; }
        /// <summary>
        /// 安全验收单
        /// </summary>
        [Description("安全验收单")]
        public List<T_DM_DEVICE_BASE_RECEIPT_FILE> Nav_ReceiptFiles { get; set; }
        /// <summary>
        /// 设备设施点检(有关联)
        /// </summary>
        [Description("设备设施点检")]
        public ICollection<T_DM_DEVICE_BASE_CHECK> Nav_ListCheck { get; set; }

        /// <summary>
        /// 设备设施巡检(没有关联)
        /// </summary>
        [Description("设备设施巡检")]
        public ICollection<T_DM_DEVICE_BASE_CHECK> Nav_ListCheckCircle { get; set; }
       
        /// <summary>
        /// 检修记录
        /// </summary>
        [Description("检修记录")]
        [FormFieldEdit]
        public ICollection<T_DM_DEVICE_BASE_OVERHAUL> Nav_Overhaul { get; set; }
        /// <summary>
        /// 检验检测
        /// </summary>
        [Description("检验检测")]
        [FormFieldEdit]
        public ICollection<T_DM_DEVICE_BASE_INSPECTION> Nav_Inspection { get; set; }

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

        [Description("采购表")]
        public Guid? DEVICE_PURCHASE_ID { get; set; }
        [Description("采购明细表")]
        public Guid? DEVICE_ID { get; set; }

        [Description("设施设备采购明细表")]
        [DataFieldIngore]
        public ICollection<T_DM_DEVICE_PURCHASE_DETAIL> Nav_PurchaseDetails { get; set; }

        [Description("设备设施点检")]
        [DataFieldIngore]
        public ICollection<T_DM_TIME_RUN_CONTENT> Nav_Check { get; set; }
        [Description("设备设施巡检")]
        [DataFieldIngore]
        public ICollection<T_DM_TIME_RUN_CONTENT> Nav_CheckCircuit { get; set; }
        [Description("设备设施维保")]
        [DataFieldIngore]
        public ICollection<T_DM_DEVICE_MAINTENANCE_PLAN_DETAIL> Nav_Maintenance { get; set; }
        [Description("设备设施检修")]
        [DataFieldIngore]
        public ICollection<T_DM_DEVICE_OVERHAUL> Nav_OverhaulNew { get; set; }
        [Description("设备设施检测检验")]
        [DataFieldIngore]
        public ICollection<T_DM_DETECTION_INSPECTION_RECORD> Nav_InspectionNew { get; set; }
        [Description("设备设施报废")]
        [DataFieldIngore]
        public ICollection<T_DM_DEVICE_SCRAP> Nav_Scrap { get; set; }

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

        /// <summary>
        /// 类别 :设备、设施、其他
        /// </summary>
        [Description("状态")]
        [EnumName("DMDeviceStatusEnum")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public DMDeviceStatusEnum? DEVICE_STATUS { get; set; }
    }
}