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.Entities.BS;
using APT.MS.Domain.Enums;
using APT.MS.Domain.Enums.SK;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace APT.MS.Domain.Entities.SK
{
    [Description("安全检查记录")]
    [DataRuleField("APPLY_DEPARTMENT_ID")]
    public class T_SK_SECURITY_INSPECTION_RECORD : MesEntityBase
    {
        [Description("检查通知")]
        public Guid? SECURITY_INSPECTION_NOTICE_ID { get; set; }

        [Description("发起人")]
        [DataFieldForeignKey("Nav_ApplyUser")]
        public Guid? APPLY_USER_ID { get; set; }

        [Description("导航属性：发起人")]
        public virtual T_FM_USER Nav_ApplyUser { get; set; }

        [Description("发起部门")]
        [DataFieldForeignKey("Nav_ApplyDepartment")]
        public Guid? APPLY_DEPARTMENT_ID { get; set; }

        [Description("导航属性：发起部门")]
        public virtual T_FM_DEPARTMENT Nav_ApplyDepartment { get; set; }

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

        [Description("生产单元")]
        [DataFieldForeignKey("Nav_ProductionUnit")]
        public Guid? PRODUCTION_UNIT_ID { get; set; }
        [Description("导航属性：生产单元")]
        public T_FM_USER_PRODUCTION_UNIT_SET Nav_ProductionUnit { get; set; }
        /// <summary>
        /// 检查类型
        /// </summary>
        [Description("检查类型")]
        [DataFieldForeignKey("Nav_CheckType")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public Guid? CHECK_TYPE_ID { get; set; }

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

        /// <summary>
        /// 检查周期
        /// </summary>
        [Description("检查周期")]
        [EnumName("SKPLANCHECKFREQUENCYEnum")]
        public SKPLANCHECKFREQUENCYEnum PLANCHECKFREQUENCY { get; set; }

        [Description("检查层级")]
        [EnumName("SKDepartmentTypeEnum")]
        public SKDepartmentTypeEnum DEPARTMENT_TYPE { get; set; }

        [Description("检查时间")]
        public DateTime? CHECK_TIME { get; set; }

        /// <summary>
        /// 检查明细表
        /// </summary>
        [Description("导航：检查明细表")]
        public virtual ICollection<T_SK_SECURITY_INSPECTION_RECORD_DETAIL> Nav_CheckRecordDetails { get; set; }
        /// <summary>
        /// 检查附件表
        /// </summary>
        [Description("导航：检查附件表")]
        public virtual ICollection<T_SK_SECURITY_INSPECTION_RECORD_FILE> Nav_CheckRecordFiles { get; set; }

        [Description("检查人员")]
        public string CHECK_PERSON { get; set; }

        [Description("状态")]
        [FormFieldTable]
        [FormFieldQuery]
        [EnumName("PFStandardStatus")]
        public PFStandardStatus STATUS { get; set; }

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

        /// <summary>
        /// 是否自动触发
        /// </summary>
        [Description("是否自动触发")]
        public bool ISAUTO { get; set; } = false;

        /// <summary>
        /// 风险类别
        /// </summary>
        [Description("风险类别")]
        [DataFieldForeignKey("Nav_Type")]

        public Guid? TYPE_ID { get; set; }

        /// <summary>
        /// 导航属性：风险类别
        /// </summary>
        [Description("导航属性：风险类别")]
        public T_SK_RISK_TYPE Nav_Type { get; set; }

        [Description("记录人")]
        [DataFieldForeignKey("Nav_RecordUser")]
        public Guid? RECORD_USER_ID { get; set; }

        [Description("导航属性：记录人")]
        public virtual T_FM_USER Nav_RecordUser { get; set; }

        [Description("发起人部门")]
        [DataFieldLength(50)]
        public string ApplyDepartmentName { get; set; }
        [DataFieldLength(50)]
        [Description("发起人岗位")]
        public string ApplyPostName { get; set; }
        [Description("检查通知编号")]
        [DataFieldLength(50)]
        public string NOTICE_CODE { get; set; }
    }
}
