using APT.BaseData.Domain.Entities;
using APT.BaseData.Domain.Entities.FM;
using APT.BaseData.Domain.Enums;
using APT.Infrastructure.Core;
using APT.MS.Domain.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace APT.MS.Domain.Entities.HM
{
    /// <summary>
    /// 风险记录表
    /// </summary>
    [Description("危险源/风险辨识记录表")]
    public class T_HM_RISK_RECORD : MesEntityBase
    {
        /// <summary>
        /// 编码
        /// </summary>
        [Description("编码")]
        [DataFieldLength(50)]
        [FormFieldTable]
        public string CODE { get; set; }
        /// <summary>
        /// 开始时间
        /// </summary>
        [Description("开始时间")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public DateTime? START_TIME { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        [Description("结束时间")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public DateTime? END_TIME { get; set; }
        /// <summary>
        /// 状态 1记录 2部分签到 3全部签到 4审核中 5归档
        /// </summary>
        [Description("状态")]
        [EnumName("FOPreMeetingStatusEnum")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public FOPreMeetingStatusEnum STATUS { get; set; }

        /// <summary>
        /// 层级 3公司级 0部门级 1车间级 2班组级
        /// </summary>
        [Description("层级")]
        [EnumName("FMDepartmentType")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public FMDepartmentType LEVEL { get; set; }
        /// <summary>
        /// 要求ID
        /// </summary>
        [Description("辨识要求")]
        [DataFieldForeignKey("Nav_Request")]
        [FormFieldEdit]
        public Guid REQUEST_ID { get; set; }
        /// <summary>
        /// 导航属性：辨识要求
        /// </summary>
        [Description("辨识要求")]
        public T_HM_REQUEST Nav_Request { get; set; }

        /// <summary>
        /// 导航属性：辨识人员
        /// </summary>
        [Description("导航属性：辨识人员")]
        [FormFieldEdit]
        public ICollection<T_HM_RISK_RECORD_USER> Nav_Users { get; set; }

        /// <summary>
        /// 导航属性：辨识对象
        /// </summary>
        [Description("导航属性：辨识对象")]
        [FormFieldEdit]
        public ICollection<T_HM_RISK_RECORD_IDENTIFYING> Nav_Identifyings { get; set; }

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

        /// <summary>
        /// 导航属性：子表
        /// </summary>
        [Description("明细")]
        [FormFieldEdit]
        public ICollection<T_HM_RISK_RECORD_DETAIL> Nav_Details { get; set; }

        /// <summary>
        /// 风险表ID
        /// </summary>
        [Description("风险表")]
        [DataFieldForeignKey("Nav_Task")]
        public Guid? TASK_ID { get; set; }
        /// <summary>
        /// 导航属性：风险表
        /// </summary>
        [Description("导航属性：风险表")]
        public T_HM_RISK_TASK Nav_Task { get; set; }

        /// <summary>
        /// 记录人ID
        /// </summary>
        [Description("记录人")]
        [DataFieldForeignKey("Nav_NoteTaker")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public Guid? NOTE_TAKER_ID { get; set; }
        /// <summary>
        /// 导航属性：记录人
        /// </summary>
        [Description("记录人")]
        public T_FM_USER Nav_NoteTaker { get; set; }

        /// <summary>
        /// 发起部门ID
        /// </summary>
        [Description("发起部门")]
        [DataFieldForeignKey("Nav_InitiatingDepartment")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public Guid? INITIATING_DEPARTMENT { get; set; }
        /// <summary>
        /// 导航属性：发起部门
        /// </summary>
        [Description("导航属性：发起部门")]
        public T_FM_DEPARTMENT Nav_InitiatingDepartment { get; set; }
        [Description("是否发布")]
        [DataFieldIngore]
        public string PUBLISH { get; set; }

        [Description("审批流编号")]
        [DataFieldLength(50)]
        public string APPROVECODE { get; set; }
        /// <summary>
        /// 任务责任人
        /// </summary>
        [Description("任务责任人")]
        [DataFieldForeignKey("Nav_LiableUser")]
        [FormFieldTable]
        [FormFieldEdit]
        public Guid? LIABLE_USER_ID { get; set; }
        /// <summary>
        /// 导航属性：任务责任人
        /// </summary>
        [Description("任务责任人")]
        public T_FM_USER Nav_LiableUser { get; set; }
        /// <summary>
        /// 关联ID
        /// </summary>
        [Description("关联ID")]
        [DataFieldForeignKey("Nav_Plan")]
        public Guid? PLAN_ID { get; set; }
        /// <summary>
        /// 导航属性：关联ID
        /// </summary>
        [Description("导航属性：关联ID")]
        [FormFieldEdit]
        public T_HM_EVALUATION_PLAN Nav_Plan { get; set; }
        [DataFieldIngore]
        public int IS_OVERTIME { get; set; }
    }

}
