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

namespace APT.MS.Domain.Entities.BS
{
    /// <summary>
    /// 检查内容表
    /// </summary>
    [Description("安全检查库")]
    public class T_BS_CHECK_MAIN : MesEntityBase
    {
        //安全检查主表（检查对象、检查项目ID、检查内容、检查依据、问题描述ID、等级、隐患、
        //检查类型ID、检查分类ID、区域ID）

        //Excel 序号 检查项目    检查内容 检查依据    检查问题描述 检查问题等级  
        //重大隐患类别 整改建议与措施 检查类型 检查项目分类  检查层级 检查区域

        /// <summary>
        /// 检查对象
        /// </summary>
        [Description("检查对象")]
        [FormFieldTable]
        [FormFieldEdit]
        [EnumName("BSMineTypeEnum")]
        public int CHECKOBJECT { get; set; }

        /// <summary>
        /// 检查对象
        /// </summary>
        [Description("检查对象")]
        [DataFieldIngore]
        public string CHECKOBJECT_DESCRIPTION { get; set; }

        /// <summary>
        /// 检查项目ID
        /// </summary>
        [Description("检查项目")]
        [DataFieldForeignKey("Nav_CheckProject")]
        [FormFieldTable]
        [FormFieldEdit]
        public Guid? CHECK_PROJECT_ID { get; set; }

        /// <summary>
        /// 检查项目
        /// </summary>
        [Description("导航：检查项目")]
        public virtual T_BS_CHECK_PROJECT Nav_CheckProject { get; set; }

        /// <summary>
        /// 检查项目分类
        /// </summary>
        [Description("检查项目分类")]
        [DataFieldForeignKey("Nav_CheckProjectProjectCategory")]
        [FormFieldEdit]
        [FormFieldTable]
        public Guid? CHECK_PROJECT_PROJECT_CATEGORY_ID { get; set; }

        /// <summary>
        /// 检查项目分类
        /// </summary>
        [Description("导航：检查项目分类")]
        public virtual T_BS_CHECK_PROJECT_PROJECT_CATEGORY Nav_CheckProjectProjectCategory { get; set; }


        /// <summary>
        /// 检查项目分类
        /// </summary>
        [Description("检查项目分类")]
        [DataFieldForeignKey("Nav_CheckProjectCategory")]
        [FormFieldEdit]
        [FormFieldTable]
        public Guid? CHECK_PROJECT_CATEGORY_ID { get; set; }

        /// <summary>
        /// 检查项目分类
        /// </summary>
        [Description("导航：检查项目分类")]
        public virtual T_BS_CHECK_PROJECT_CATEGORY Nav_CheckProjectCategory { get; set; }

        /// <summary>
        /// 检查问题ID
        /// </summary>
        [Description("检查问题")]
        [DataFieldForeignKey("Nav_CheckQuestion")]
        [FormFieldEdit]
        public Guid? CHECK_QUESTION_ID { get; set; }

        /// <summary>
        /// 检查项目
        /// </summary>
        [Description("导航：检查问题")]
        public virtual T_BS_CHECK_QUESTION Nav_CheckQuestion { get; set; }

        /// <summary>
        /// 检查内容
        /// </summary>
        [Description("检查内容")]
        [FormFieldTable]
        [FormFieldEdit]
        [DataFieldLength(500)]
        public string CHECKCONTENT { get; set; }

        /// <summary>
        /// 检查依据
        /// 与法律法规相关 做数据冗余 （法律法规修改后 此处也要修改） 
        /// </summary>
        [Description("检查依据")]
        [FormFieldTable]
        [FormFieldEdit]
        [DataFieldLength(500)]
        public string CHECKPROOF { get; set; }

        /// <summary>
        /// 检查依据
        /// </summary>
        [Description("检查依据")]
        [FormFieldEdit]
        public ICollection<T_BS_CHECK_MAIN_LAW> Nav_ListLaw { get; set; }

        /// <summary>
        /// 问题等级  重大 = 10,A = 20,B = 30,C = 40,D = 50,
        /// </summary>
        [Description("问题等级")]
        [EnumName("BSQuestionLevelEnum")]
        [FormFieldEdit]
        [FormFieldTable]
        public int QUESTION_LEVEL { get; set; }

        /// <summary>
        /// 问题等级
        /// </summary>
        [Description("问题等级")]
        [DataFieldIngore]
        public string QUESTION_LEVE_DESCRIPTION { get; set; }

        /// <summary>
        /// 是否重大隐患 否 = 0,是 = 1,
        /// </summary>
        [Description("是否重大隐患")]
        [EnumName("BSSeriousRiskEnum")]
        [FormFieldEdit]
        [FormFieldTable]
        public int SERIOUS_RISK { get; set; }

        /// <summary>
        /// 是否重大隐患
        /// </summary>
        [Description("是否重大隐患")]
        [DataFieldIngore]
        public string SERIOUS_RISK_DESCRIPTION { get; set; }
        /// <summary>
        /// 检查类型ID
        /// </summary>
        [Description("检查类型")]
        [DataFieldForeignKey("Nav_CheckType")]
        [FormFieldEdit]
        [FormFieldTable]
        public Guid? CHECK_TYPE_ID { get; set; }

        /// <summary>
        /// 检查类型
        /// </summary>
        [Description("导航：检查类型")]
        public virtual T_BS_CHECK_TYPE Nav_CheckType { get; set; }


        /// <summary>
        /// 检查层级
        /// </summary>
        [Description("检查层级")]
        [DataFieldForeignKey("Nav_CheckTypeLevel")]
        [FormFieldEdit]
        public Guid? CHECK_TYPE_LEVEL_ID { get; set; }

        /// <summary>
        /// 检查层级
        /// </summary>
        [Description("导航：检查层级")]
        public virtual T_BS_CHECK_TYPE_LEVEL Nav_CheckTypeLevel { get; set; }

        /// <summary>
        /// 检查层级
        /// </summary>
        [Description("检查层级")]
        [DataFieldIngore]
        public string CheckLevelDescription { get; set; }

        /// <summary>
        /// 检查区域
        /// </summary>
        [Description("检查区域")]
        [DataFieldForeignKey("Nav_RiskArea")]
        [FormFieldEdit]
        [FormFieldTable]
        public Guid? RISK_AREA_ID { get; set; }

        /// <summary>
        /// 检查区域
        /// </summary>
        [Description("导航：检查区域")]
        public virtual T_HM_RISK_AREA Nav_RiskArea { get; set; }


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

        /// <summary>
        /// 排序号
        /// </summary>
        [Description("排序号")]
        [FormFieldEdit]
        public int NUM { get; set; }

        /// <summary>
        /// 是否隐患库    false：安全库     true：隐患库（安全检查时发现问题，每个使用系统的人不一样）
        /// 安全检查 发现问题 更新检查库
        /// </summary>
        [Description("是否隐患库")]
        public bool ISRISK { get; set; } = false;


        /// <summary>
        /// 责任部门
        /// </summary>
        [Description("是否隐患库")]
        public virtual ICollection<T_BS_CHECK_CONTENT_MAIN_DEPARTMENT> Nav_ListMainDep { get; set; }

        /// <summary>
        /// 检查内容
        /// </summary>
        [Description("检查内容")]
        [DataFieldForeignKey("Nav_Contents")]
        public Guid? CHECK_CONTENTS_ID { get; set; }

        /// <summary>
        /// 检查内容
        /// </summary>
        [Description("检查内容")]
        public virtual T_BS_CHECK_CONTENTS Nav_Contents { get; set; }
    }
}
