using APT.BaseData.Domain.Entities.FM;
using APT.Infrastructure.Core;
using APT.MS.Domain.Enums;
using APT.MS.Domain.Enums.SK;
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_OPERATION_LINK : MesEntityBase
    {
        /// <summary>
        /// 编码
        /// </summary>
        [Description("编码")]
        [DataFieldLength(50)]
        public string CODE { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [Description("名称")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        [DataFieldLength(50)]
        public string NAME { 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>
        [EnumName("HMTaskLevelEnum")]
        [Description("任务类型")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public int TASK_LEVEL { get; set; }


        /// <summary>
        /// 是否关键任务
        /// </summary> 
        [Description("是否关键任务")]
        [EnumName("ISImportantEnum")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public int IS_IMPORTANT { get; set; }

        /// <summary>
        /// 许可作业审批层级
        /// </summary>
        [EnumName("HMOperationTaskAuditEnum")]
        [Description("许可作业审批层级")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public int AUDIT_LEVEL { get; set; }

        [Description("作业许可类别")]
        [DataFieldForeignKey("Nav_WorkPermitType")]
        [FormFieldEdit]
        public Guid? WORK_PERMIT_TYPE_ID { get; set; }
        [Description("作业许可类别")]
        public virtual T_HM_WORK_PERMIT_TYPE Nav_WorkPermitType { get; set; }
        /// <summary>
        /// 作业前安全确认
        /// </summary>
        [Description("作业前安全确认")]
        [FormFieldEdit]
        [DataFieldLength(2000)]
        public string SafeConfirmsStr { get; set; }

        /// <summary>
        /// 作业流程及安全措施
        /// </summary>
        [Description("作业流程及安全措施")]
        [FormFieldEdit]
        [DataFieldLength(2000)]
        public string SafeMeasuresStr { get; set; }

        /// <summary>
        /// 作业后处理措施
        /// </summary>
        [Description("作业后处理措施")]
        [FormFieldEdit]
        [DataFieldLength(2000)]
        public string DealMeasuresStr { get; set; }
        /// <summary>
        /// 状态 作废 = 1,有效 = 0,
        /// </summary>
        [Description("状态")]
        [EnumName("STATUSEnum")]
        [FormFieldTable]
        [FormFieldQuery]
        [FormFieldEdit]
        public int STATUS { get; set; }
        /// <summary>
        /// 导航属性：风险库
        /// </summary>
        [Description("导航属性：风险库")]
        public List<T_HM_OPERATION_LINK_EVALUATE_RISK> Nav_OperationLinkEvaluateRisk { get; set; }
        /// <summary>
        /// 导航属性：作业前安全确认
        /// </summary>
        [Description("导航属性：作业前安全确认")]
        public List<T_HM_OPERATION_TASK_SAFE_CONFIRM> Nav_SafeConfirms { get; set; }

        /// <summary>
        /// 导航属性：作业流程及安全措施
        /// </summary>
        [Description("导航属性：作业流程及安全措施")]
        public List<T_HM_OPERATION_TASK_SAFE_MEASURE> Nav_SafeMeasures { get; set; }

        /// <summary>
        /// 导航属性：作业后处理措施
        /// </summary>
        [Description("导航属性：作业后处理措施")]
        public List<T_HM_OPERATION_TASK_DEAL_MEASURE> Nav_DealMeasures { get; set; }
        /// <summary>
        /// 导航属性：作业指导书
        /// </summary>
        [Description("导航属性：作业指导书")]
        public List<T_HM_OPERATION_INSTRUCTION_FILE> Nav_Files { get; set; }

        /// <summary>
        /// 来源ID
        /// </summary>
        [Description("来源ID")]
        [FormFieldEdit]
        public Guid? PARENT_ID { get; set; }

        /// <summary>
        /// 修改状态 数据库 = 0,修改=1,新增=2，导入=3
        /// </summary>
        [Description("修改状态")]
        [EnumName("HMModifyEnum")]
        [FormFieldEdit]
        public HMModifyEnum MODIFY_TYPE { get; set; }

        /// <summary>
        /// 导航属性：辨识区域
        /// </summary>
        [Description("辨识区域")]
        [FormFieldEdit]
        public ICollection<T_HM_OPERATION_LINK_AREA> Nav_LinkArea { get; set; }

        [Description("岗位")]
        public string POST { get; set; }

        /// <summary>
        /// 导航属性：相关岗位
        /// </summary>
        [Description("相关岗位")]
        [FormFieldEdit]
        public ICollection<T_HM_OPERATION_LINK_POST> Nav_LinkPost { get; set; }
        /// <summary>
        /// 周期
        /// </summary>
        [Description("周期")]
        [EnumName("HMCycleTypeEnum")]
        [FormFieldEdit]
        public HMCycleTypeEnum CYCLE_TYPE { get; set; }

        [Description("是否跑批")]
        public DisableStatusEnum IS_RUN { get; set; }

        [Description("生产单元表")]
        [DataFieldForeignKey("Nav_Unit")]
        public Guid? UNIT_ID { get; set; }
        [Description("导航：生产单元表")]
        public virtual T_FM_USER_PRODUCTION_UNIT_SET Nav_Unit { get; set; }

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

        [Description("作业等级")]
        [EnumName("SKEvaluateLevelEnum")]
        public SKEvaluateLevelEnum? EVALUATE_LEVEL { get; set; }
    }
}











