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

namespace APT.MS.Domain.Entities.FO
{
    [Description("作业活动记录表(关键/许可)")]
    [DataRuleField("DEPARTMENT_ID")]
    public class T_FO_JOB_ACTIVITY_RECORD : MesEntityBase
    {
        [Description("编号")]
        [DataFieldLength(100)]
        [FormFieldTable]
        [FormFieldQuery]
        public string CODE { get; set; }

        /// <summary>
        /// 作业名称
        /// </summary>
        [Description("作业名称")]
        [DataFieldForeignKey("Nav_OperationStep")]
        [FormFieldEdit]
        public Guid? OPERATION_STEP_ID { get; set; }

        /// <summary>
        /// 导航属性：作业名称
        /// </summary>
        [Description("导航属性：作业名称")]
        public T_HM_OPERATION_STEP Nav_OperationStep { get; set; }
        /// <summary>
        /// 技术交底表
        /// </summary>
        [Description("技术交底表")]
        [DataFieldForeignKey("Nav_TechDisclosure")]
        [FormFieldEdit]
        public Guid? TECH_DISCLOSURE_ID { get; set; }

        /// <summary>
        /// 导航属性：作业名称
        /// </summary>
        [Description("导航属性：技术交底表")]
        public T_FO_TECH_DISCLOSURE_FROM Nav_TechDisclosure { get; set; }

        /// <summary>
        /// 关键许可工作票
        /// </summary>
        [Description("关键许可工作票")]
        [DataFieldForeignKey("Nav_JobName")]
        [FormFieldEdit]
        public Guid? JOB_NAME_ID { get; set; }

        /// <summary>
        /// 导航属性：作业环节
        /// </summary>
        [Description("导航属性：关键许可工作票")]
        public T_FO_CRUCIAL_LICENSE_JOB Nav_JobName { get; set; }

        [Description("导航属性：作业活动记录(关键/许可)人员表")]
        [FormFieldEdit]
        public ICollection<T_FO_JOB_ACTIVITY_PERSON> Nav_JobActivityPerson { get; set; }

        /// <summary>
        /// 关键许可工作票
        /// </summary>
        [Description("关键许可工作票(外包)")]
        [DataFieldForeignKey("Nav_JobNameOut")]
        [FormFieldEdit]
        public Guid? JOB_NAME_OUTSOURCE_ID { get; set; }

        /// <summary>
        /// 导航属性：关键许可工作票
        /// </summary>
        [Description("导航属性：关键许可工作票(外包)")]
        public T_FO_CRUCIAL_LICENSE_JOB_OUTSOURCE Nav_JobNameOut { get; set; }

        [Description("作业开始时间")]
        [FormFieldTable]
        [FormFieldQuery]
        public DateTime? JOB_DATE { get; set; }

        [Description("作业结束时间")]
        [FormFieldTable]
        [FormFieldQuery]
        public DateTime? JOB_END_DATE { get; set; }

        [Description("作业地点")]
        [FormFieldTable]
        [FormFieldQuery]
        public String JOB_LOCATION { get; set; }

        [Description("导航属性：作业前安全确认")]
        [FormFieldEdit]
        public ICollection<T_FO_JOB_ACTIVITY_DETAIL> Nav_Details { get; set; }
        [Description("导航属性：流程及安全措施")]
        [FormFieldEdit]
        public ICollection<T_FO_JOB_ACTIVITY_FLOW> Nav_Flow { get; set; }
        [Description("导航属性：作业后处理措施")]
        [FormFieldEdit]
        public ICollection<T_FO_JOB_ACTIVITY_MEASURE> Nav_Measure { get; set; }

        [Description("措施是否有效")]
        public string EFFECTIVE { get; set; }
        [Description("是否有效")]
        [EnumName("ISImportantEnum")]
        public int IS_EFFECTIVE { get; set; }

        [Description("行为是否存在")]
        public string EXIST { get; set; }
        [Description("是否存在")]
        [EnumName("ISImportantEnum")]
        public int IS_EXIST { get; set; }

        [Description("习惯是否合适")]
        public string SUITABLE { get; set; }
        [Description("是否合适")]
        [EnumName("ISImportantEnum")]
        public int IS_SUITABLE { get; set; }

        [Description("培训是否需要")]
        public string NEED { get; set; }
        [Description("是否需要")]
        [EnumName("ISImportantEnum")]
        public int IS_NEED { get; set; }

        [Description("改进是否需要")]
        public string REQUIRES { get; set; }
        [Description("是否需要")]
        [EnumName("ISImportantEnum")]
        public int IS_REQUIRES { get; set; }

        /// <summary>
        /// 表单状态
        /// </summary>
        [EnumName("FOTeamActivityState")]
        [Description("表单状态")]
        [FormFieldTable]
        [FormFieldQuery]
        public int FORM_STATUS { get; set; }

        [Description("提交并通知")]
        [DataFieldIngore]
        public string PUBLISH { get; set; }

        [Description("导航属性：创建人")]
        public virtual T_FM_USER Nav_CreateUser { get; set; }
        [DataFieldIngore]
        public int IS_OVERTIME { get; set; }
        [Description("部门ID")]
        public Guid? DEPARTMENT_ID { get; set; }

        [Description("部门名称")]
        public string PARENT_NAME { get; set; }

        [Description("是否外包")]
        public bool IS_OUTSOURCE { get; set; }

        /// <summary>
        /// 相关方
        /// </summary>
        [Description("相关方")]
        public Guid? RELATED_ID { get; set; }
    }
}
