using APT.BaseData.Domain.Entities;
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("安全检查")]
    [DataRuleField("DEPARTMENTID")]
    public class T_BS_SAFE_CHECK : MesEntityBase
    {

        /// <summary>
        /// 制定任务 通过这个判断跑批是否执行
        /// </summary>
        [Description("制定任务")]
        [DataFieldForeignKey("Nav_PlanSet")]
        [FormFieldEdit]
        public Guid? PLAN_SET_ID { get; set; }

        /// <summary>
        /// 导航：制定任务
        /// </summary>
        [Description("导航：制定任务")]
        public virtual T_BS_PLAN_SET Nav_PlanSet { get; set; }

        /// <summary>
        /// 安全检查名称
        /// </summary>
        [Description("安全检查名称")]
        [FormFieldTable]
        [FormFieldEdit]
        [FormFieldQuery]
        [DataFieldLength(200)]
        public string NAME { get; set; }

        /// <summary>
        /// 安全检查编号
        /// </summary>
        [Description("安全检查编号")]
        [FormFieldTable]
        [FormFieldEdit]
        [FormFieldQuery]
        [DataFieldLength(30)]
        public string CODE { get; set; }

        /// <summary>
        /// 检查类型
        /// </summary>
        [Description("检查类型")]
        [DataFieldForeignKey("Nav_CheckType")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public Guid? CHECK_TYPE_ID { get; set; }

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

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


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

        /// <summary>
        /// 检查层级
        /// </summary>
        [Description("检查层级")]
        [DataFieldForeignKey("Nav_CheckTypeLevel")]
        [FormFieldTable]
        [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("检查时间")]
        [FormFieldEdit]
        [FormFieldTable]
        public DateTime? CHECKTIME { get; set; }

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


        /// <summary>
        /// 检查签名
        /// </summary>
        [Description("导航：检查签名")]
        public virtual ICollection<T_BS_SAFE_CHECK_USERSIGN> Nav_ListCheckUserSign { get; set; }


        /// <summary>
        /// 检查项目
        /// </summary>
        [Description("检查项目")]
        public virtual ICollection<T_BS_SAFE_CHECK_PROJECT> Nav_ListCheckProject { get; set; }

        /// <summary>
        /// 检查项目分类
        /// </summary>
        [Description("检查项目分类")]
        public virtual ICollection<T_BS_SAFE_CHECK_PROJECT_CATEGORY> Nav_ListCheckProjectCategory { get; set; }

        /// <summary>
        /// 检查人员
        /// </summary>
        [Description("检查人员")]
        public string CheckUsers { get; set; }

        /// <summary>
        /// 检查明细 包含检查项目库信息
        /// </summary>
        [Description("导航：检查明细")]
        [FormFieldEdit]
        public virtual ICollection<T_BS_SAFE_CHECK_DETAIL> Nav_ListSafeCheckDetail { get; set; }

        /// <summary>
        /// 导航属性：附件
        /// </summary>
        [Description("导航：附件")]
        public virtual ICollection<T_BS_SAFE_CHECK_FILE> Nav_Files { get; set; }

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

        /// <summary>
        /// 生成方式
        /// </summary>
        [Description("生成方式")]
        [EnumName("CREACTTYPEEnum")]
        public CREACTTYPEEnum CREACTTYPE { get; set; } = 0;

        /// <summary>
        /// 制定任务审批状态
        /// </summary>
        [Description("制定任务审批状态")]
        [FormFieldTable]
        [FormFieldQuery]
        //[FormFieldEdit]
        [EnumName("HMAuditStatusEnmu")]
        public int STATUSPLAN { get; set; }


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

        public T_PF_APPROVE Nav_Approve { get; set; }

        /// <summary>
        /// 审批
        /// </summary>
        [Description("导航属性：审批")]
        [DataFieldIngore]
        public virtual ICollection<T_PF_APPROVE_DETAIL> Nav_ApproveDetails { get; set; }







        /// <summary>
        /// 安全检查审批流模板（目的是只能让一个人添加）
        /// </summary>
        [Description("安全检查审批流模板ID")]
        [DataFieldForeignKey("Nav_ApproveTemp")]
        public Guid? APPROVE_TEMP_ID { get; set; }

        /// <summary>
        /// 安全检查审批流模板
        /// </summary>
        [Description("安全检查审批流模板")]
        public T_PF_APPROVE_TEMP Nav_ApproveTemp { get; set; }

        /// <summary>
        /// 检查审批流编号
        /// </summary>
        [Description("安全检查审批流")]
        [DataFieldForeignKey("Nav_ApproveCheckAudit")]
        public Guid? APPROVE_CHECKAUDIT_ID { get; set; }

        /// <summary>
        /// 安全检查审批流
        /// </summary>
        [Description("安全检查审批流")]
        public T_PF_APPROVE Nav_ApproveCheckAudit { get; set; }

        /// <summary>
        /// 审批
        /// </summary>
        [Description("导航属性：安全检查审批流明细")]
        [DataFieldIngore]
        public virtual ICollection<T_PF_APPROVE_DETAIL> Nav_ApproveCheckAuditDetails { get; set; }



        /// <summary>
        /// 检查完审批流状态
        /// </summary>
        [Description("检查完审批流状态")]
        [FormFieldTable]
        [FormFieldQuery]
        [EnumName("HMAuditStatusEnmu")]
        public int STATUCHECK { get; set; }








        /// <summary>
        /// 制定检查表的人（比如 跑批的：某些的班长 或者安全员负责人  自定义添加就是操作人）
        /// </summary>
        [Description("制定检查表的人")]
        [DataFieldForeignKey("Nav_User")]
        public Guid? USERID_DOPLAN { get; set; }

        /// <summary>
        /// 制定检查表的人
        /// </summary>
        [Description("导航：制定检查表的人")]
        public T_FM_USER Nav_User { get; set; }


        /// <summary>
        /// 检查部门
        /// </summary>
        [Description("检查部门")]
        [DataFieldForeignKey("Nav_Department")]
        public Guid? DEPARTMENTID { get; set; }

        /// <summary>
        /// 检查部门（部门级 就保存部门ID 班组级就保存班组ID 应该是同一个表）
        /// </summary>
        [Description("导航：检查部门")]
        public T_FM_DEPARTMENT Nav_Department { get; set; }

        /// <summary>
        /// 审批流表单编码参数
        /// </summary>
        [Description("审批流表单编码参数")]
        [DataFieldIngore]
        public string FORM_CODE { get; set; }

        /// <summary>
        /// 隐患上报状态 0 检查正常 无需隐患上报
        /// </summary>
        [Description("隐患上报状态")]
        [EnumName("RISKSTATE")]
        public int RISKSTATE { get; set; } = 0;

        /// <summary>
        /// 制表完成时间
        /// </summary>
        [Description("制表完成时间")]
        public DateTime? CHECKFINISHINTTIME { get; set; }

        /// <summary>
        /// 是否制表按时完成(制表审批流)
        /// </summary>
        [Description("是否制表按时完成")]
        public bool? ISCHECKFINISHINTTIME { get; set; }

        /// <summary>
        /// 是否按时完成
        /// 检查记录审批完成 算完成时间
        /// </summary>
        [Description("是否按时完成")]
        public bool ISFINISHINTTIME { get; set; }

        [DataFieldIngore]
        public int IS_OVERTIME { get; set; }



        /// <summary>
        /// 检查记录状态
        /// </summary>
        [Description("检查记录状态")]
        [FormFieldTable]
        [FormFieldQuery]
        [EnumName("STATECHECK")]
        public STATECHECK STATECHECK { get; set; }

        /// <summary>
        /// 时间限制
        /// </summary>
        [Description("时间限制")]
        public DateTime? LIMITDATETIME { get; set; }

        /// <summary>
        /// 是否需要上报 报表用
        /// </summary>
        [Description("是否需要上报")]
        public bool? ISNEEDTOUP { get; set; }
    }
}