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;

namespace APT.MS.Domain.Entities.BS
{
    /// <summary>
    /// 隐患上报表
    /// </summary>
    [Description("隐患上报表")]
    [DataRuleField("DEPARTMENT_ID")]
    public class T_BS_RISK_SUBMIT : MesEntityBase
    {


        /// <summary>
        /// 编码
        /// </summary>
        [Description("编码")]
        [CUnique]
        [CodeRule((int)PFCodeRuleType.RiskSubmit)]
        [DataFieldLength(30)]
        [FormFieldTable]
        [FormFieldEdit]
        [FormFieldQuery]
        public string CODE { get; set; }

        /// <summary>
        /// 隐患上报名称
        /// </summary>
        [Description("隐患上报名称")]
        [DataFieldLength(100)]
        [FormFieldTable]
        [FormFieldEdit]
        [FormFieldQuery]
        public string NAME { get; set; }


        /// <summary>
        /// 上报类型
        /// </summary>
        [Description("上报类型")]
        [EnumName("SUBMIT_TYPE")]
        [FormFieldEdit]
        public int SUBMIT_TYPE { get; set; } = (int)APT.MS.Domain.Enums.SUBMIT_TYPE.Check;


        /// <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("检查层级")]
        [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("检查任务")]
        [DataFieldForeignKey("Nav_Check")]
        [FormFieldTable]
        [FormFieldEdit]
        [FormFieldQuery]
        public Guid? CHECK_ID { get; set; }

        /// <summary>
        /// 导航：安全检查任务表
        ///// </summary>
        [Description("导航：安全检查任务表")]
        public virtual T_BS_SAFE_CHECK Nav_Check { get; set; }
        /// <summary>
        /// 检查时间
        /// </summary>
        [Description("检查时间")]
        [FormFieldTable]
        [FormFieldEdit]
        public DateTime? CHECKTIME { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [Description("状态")]
        [EnumName("BSSubmitStatusEnum")]
        [FormFieldEdit]
        public int? SUBMIT_STATUS { get; set; } = 10;

        /// <summary>
        /// 导航：隐患上报附件表
        /// </summary>
        [Description("导航：隐患上报附件表")]
        public virtual List<T_BS_RISK_SUBMIT_FILE> Nav_Files { get; set; }

        /// <summary>
        /// 导航：隐患上报子表
        /// </summary>
        [Description("导航：隐患上报子表")]
        [FormFieldEdit]
        public virtual List<T_BS_RISK_SUBMIT_CONTENT> Nav_ListRiskSubmitContent { get; set; }

        /// <summary>
        /// 提交人
        /// </summary>
        [Description("提交人")]
        [DataFieldForeignKey("Nav_User")]
        public Guid? USER_ID { get; set; }

        /// <summary>
        /// 导航：提交人表
        /// </summary>
        [Description("导航：提交人表")]
        public virtual T_FM_USER Nav_User { get; set; }

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

        /// <summary>
        /// 导航：部门
        /// </summary>
        [Description("导航：部门")]
        public virtual T_FM_DEPARTMENT Nav_Department { get; set; }



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

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


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

        /// <summary>
        /// 明细中每个都完成 回调 整单完成
        /// </summary>
        [Description("是否整单完成")]
        public bool ISORDEREND { get; set; } = false;


        /// <summary>
        /// 任务传达时间
        /// 取隐患待上报 任务传达时间
        /// </summary>
        [Description("开始时间")]
        public DateTime? STARTTIME { get; set; }

        /// <summary>
        /// 上报完成时间
        /// </summary>
        [Description("上报完成时间")]
        public DateTime? SUBMITFINISHTIME { get; set; }

        /// <summary>
        /// 是否上报按时完成
        /// </summary>
        [Description("是否上报按时完成")]
        public bool? ISSUBMITFINISHINTTIME { get; set; }

        /// <summary>
        /// 是否按时完成
        /// </summary>
        [Description("是否按时完成")]
        public bool? ISFINISHINTTIME { get; set; }
        [DataFieldIngore]
        public int IS_OVERTIME { get; set; }


        /// <summary>
        /// 外界ID（TPM）
        /// </summary>
        public Guid? DATAID { get; set; }

        /// <summary>
        /// 完善人
        /// </summary>
        [Description("完善人")]
        [DataFieldIngore]
        public string CREATE_NAME { get; set; }

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

        /// <summary>
        /// 是否取消
        /// </summary>
        [Description("是否取消")]
        public bool IS_CANCEL { get; set; } = false;

        /// <summary>
        /// 取消人
        /// </summary>
        [Description("取消人")]
        public Guid? USER_ID_CANCEL { get; set; }

        /// <summary>
        /// 取消备注
        /// </summary>
        [Description("取消备注")]
        public string REMARK_CANCEL { get; set; }
    }
}