using APT.BaseData.Domain.Entities;
using APT.BaseData.Domain.Entities.FM;
using APT.Infrastructure.Core;
using APT.MS.Domain.Entities.HM;
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_CONTENT : MesEntityBase
    {
        /// <summary>
        /// 隐患上报
        /// </summary>
        [Description("隐患上报")]
        [DataFieldForeignKey("Nav_Submit", "Nav_ListRiskSubmitContent")]
        public Guid? RISK_SUBMIT_ID { get; set; }

        /// <summary>
        /// 导航：隐患上报
        ///// </summary>
        [Description("导航：隐患上报")]
        public virtual T_BS_RISK_SUBMIT Nav_Submit { get; set; }


        /// <summary>
        /// 隐患通知
        /// </summary>
        [Description("隐患通知")]
        [DataFieldForeignKey("Nav_SubmitNotice", "Nav_ListRiskSubmitContent")]
        public Guid? RISK_SUBMIT_NOTICE_ID { get; set; }

        /// <summary>
        /// 导航：隐患通知
        ///// </summary>
        [Description("导航：隐患通知")]
        public virtual T_BS_RISK_SUBMIT_NOTICE Nav_SubmitNotice { get; set; }


        /// <summary>
        /// 隐患通知
        /// </summary>
        [Description("隐患通知")]
        [DataFieldForeignKey("Nav_SubmitNoticePerson", "Nav_ListRiskSubmitContent")]
        public Guid? RISK_SUBMIT_NOTICE_PERSON_ID { get; set; }

        /// <summary>
        /// 导航：隐患通知
        ///// </summary>
        [Description("导航：隐患通知")]
        public virtual T_BS_RISK_SUBMIT_NOTICE_PERSON Nav_SubmitNoticePerson { get; set; }



        /// <summary>
        /// 编号
        /// </summary>
        [Description("编号")]
        [DataFieldLength(30)]
        public string CODE { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [Description("名称")]
        [DataFieldLength(100)]
        public string NAME { get; set; }






        /// <summary>
        /// 检查内容
        /// </summary>
        [Description("检查内容")]
        [DataFieldForeignKey("Nav_CheckMain")]
        [FormFieldEdit]
        public Guid? CHECK_MAIN_ID { get; set; }

        /// <summary>
        /// 检查内容
        /// </summary>
        [Description("检查内容")]
        public virtual T_BS_CHECK_MAIN Nav_CheckMain { get; set; }

        /// <summary>
        /// 检查问题
        /// </summary>
        [Description("检查问题")]
        [DataFieldForeignKey("Nav_Question")]
        [FormFieldEdit]
        public Guid? CHECK_QUESTION_ID { get; set; }

        /// <summary>
        /// 导航：检查问题
        /// </summary>
        [Description("导航：检查问题")]
        public virtual T_BS_CHECK_QUESTION Nav_Question { get; set; }

        /// <summary>
        /// 问题描述  上报问题为其他的时候 这个是备注 
        /// </summary>
        [Description("检查问题描述")]
        [FormFieldTable]
        [FormFieldEdit]
        [DataFieldLength(500)]
        public string DESCREPTION { get; set; }

        /// <summary>
        /// 整改建议与措施 (系统没匹配到 要手动输入)
        /// </summary>
        [Description("整改建议与措施")]
        [FormFieldTable]
        [FormFieldEdit]
        [DataFieldLength(500)]
        public string DEMAND { get; set; }


        /// <summary>
        /// 检查依据
        /// </summary>
        [Description("检查依据")]
        [FormFieldTable]
        [FormFieldEdit]
        [DataFieldLength(500)]
        public string PROOF { get; set; }

        /// <summary>
        /// 问题等级  重大 = 10,A = 20,B = 30,C = 40,D = 50,
        /// T_BS_CHECK_MAIN 中 有 这边冗余
        /// </summary>
        [Description("问题等级")]
        [EnumName("BSQuestionLevelEnum")]
        public int QUESTION_LEVEL { get; set; }

        /// <summary>
        /// 问题等级  重大 = 10,A = 20,B = 30,C = 40,D = 50,
        /// </summary>
        [Description("问题等级")]
        [DataFieldIngore]
        public string QUESTION_LEVEL_SHOW { get; set; }

        /// <summary>
        /// 导航：隐患原因
        /// </summary>
        [Description("导航：隐患原因")]
        public virtual List<T_BS_RISK_SUBMIT_CONTENT_REASON> Nav_ListRiskQuestionReason { get; set; }

        /// <summary>
        /// 隐患地点
        /// </summary>
        [Description("隐患地点")]
        [FormFieldEdit]
        [DataFieldLength(100)]
        public string ADDRESS { get; set; }

        /// <summary>
        /// 隐患通知责任人
        /// </summary> 
        [Description("隐患通知责任人")]
        [DataFieldForeignKey("Nav_User")]
        [FormFieldEdit]
        public Guid? USER_ID { get; set; }

        /// <summary>
        /// 隐患通知责任人
        /// </summary>
        [Description("导航:隐患通知责任人")]
        public virtual T_FM_USER Nav_User { get; set; }

        /// <summary>
        /// 责任单位
        /// </summary>
        [Description("责任单位")]
        [DataFieldForeignKey("Nav_Department")]
        [FormFieldEdit]
        public Guid? DEPARTMENT_ID { get; set; }

        /// <summary>
        /// 责任单位
        /// </summary>
        [Description("导航:部门")]
        public virtual T_FM_DEPARTMENT Nav_Department { get; set; }



        /// <summary>
        /// 状态 10 已上报
        /// </summary>
        [Description("状态")]
        [EnumName("RiskContentState")]
        public int? RiskContentState { get; set; } = 10;






        /// <summary>
        /// 整改期限（根据问题等级、等级最多延期天数 系统匹配）
        /// </summary>
        [Description("系统整改期限")]
        [FormFieldEdit]
        public DateTime? LastDateSystem { get; set; }

        /// <summary>
        /// 整改期限
        /// </summary>
        [Description("整改期限")]
        [FormFieldEdit]
        public DateTime? LastDateUser { get; set; }






        /// <summary>
        /// 整改实施单位
        /// </summary>
        [Description("整改实施单位")]
        [DataFieldForeignKey("Nav_DepartmentDeal")]
        [FormFieldEdit]
        public Guid? DEAL_DEPARTMENT_ID { get; set; }

        /// <summary>
        /// 整改实施单位
        /// </summary>
        [Description("导航:整改实施单位")]
        public virtual T_FM_DEPARTMENT Nav_DepartmentDeal { get; set; }

        /// <summary>
        /// 整改责任人
        /// </summary> 
        [Description("整改责任人")]
        [DataFieldForeignKey("Nav_UserDeal")]
        [FormFieldEdit]
        public Guid? DEAL_USER_ID { get; set; }

        /// <summary>
        /// 整改责任人是否确定
        /// </summary>
        [Description("整改责任人是否确定")]
        public bool ISDEALUSERCHECK { get; set; } = false;

        /// <summary>
        /// 验收人是否确定
        /// </summary>
        [Description("验收人是否确定")]
        public bool ISCHECKERCHECK { get; set; } = false;

        /// <summary>
        /// 整改责任人
        /// </summary>
        [Description("导航:整改责任人")]
        public virtual T_FM_USER Nav_UserDeal { get; set; }

        /// <summary>
        /// 整改落实人
        /// </summary> 
        [Description("整改落实人")]
        [DataFieldForeignKey("Nav_UserActualDeal")]
        [FormFieldEdit]
        public Guid? ACTUAL_DEAL_USER_ID { get; set; }

        /// <summary>
        /// 整改落实人
        /// </summary>
        [Description("导航:整改落实人")]
        public virtual T_FM_USER Nav_UserActualDeal { get; set; }

        /// <summary>
        /// 验收人
        /// </summary> 
        [Description("验收人")]
        [DataFieldForeignKey("Nav_UserCheck")]
        [FormFieldEdit]
        public Guid? CHECK_USER_ID { get; set; }

        /// <summary>
        /// 验收人
        /// </summary>
        [Description("导航:验收人")]
        public virtual T_FM_USER Nav_UserCheck { get; set; }


        /// <summary>
        /// 验收人拒绝理由
        /// </summary> 
        [Description("验收人拒绝理由")]
        [DataFieldLength(200)]
        public string CHECK_USER_REFUSED_REASON { get; set; }

        /// <summary>
        /// 整改责任人拒绝理由
        /// </summary> 
        [Description("整改责任人拒绝理由")]
        [DataFieldLength(200)]
        public string DEAL_USER_REFUSED_REASON { get; set; }

        /// <summary>
        /// 上报时间 创建时间
        /// </summary>
        [Description("上报时间")]
        public DateTime? REPORTDATE { get; set; }

        /// <summary>
        /// 通知时间
        /// </summary>
        [Description("通知时间")]
        public DateTime? NOTICEDATE { get; set; }

        /// <summary>
        /// 隐患填写时间
        /// </summary>
        [Description("隐患填写时间")]
        public DateTime? DEALDATE { get; set; }

        /// <summary>
        /// 验收时间
        /// </summary>
        [Description("验收时间")]
        public DateTime? CHECKDATE { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        [Description("结束时间")]
        public DateTime? OKDATE { 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 virtual List<T_BS_RISK_SUBMIT_CONTENT_FILE> Nav_Files { get; set; }


        /// <summary>
        /// 安全检查
        /// </summary>
        [Description("安全检查")]
        [DataFieldForeignKey("Nav_SafeCheck")]
        public Guid? SAFE_CHECK_ID { get; set; }

        /// <summary>
        /// 导航：安全检查
        /// </summary>
        [Description("导航：安全检查")]
        public virtual T_BS_SAFE_CHECK Nav_SafeCheck { get; set; }


        /// <summary>
        /// 检查明细
        /// </summary>
        [Description("检查明细")]
        [DataFieldForeignKey("Nav_SafeCheckDetail")]
        public Guid? SAFE_CHECK_DETAIL_ID { get; set; }

        /// <summary>
        /// 导航：检查明细
        /// </summary>
        [Description("导航：检查明细")]
        public virtual T_BS_SAFE_CHECK_DETAIL Nav_SafeCheckDetail { get; set; }


        /// <summary>
        /// 是否退回自动新增的
        /// </summary>
        [Description("是否退回自动新增的")]
        public bool? ISBACK { get; set; } = false;

        /// <summary>
        /// 退回原来明细ID 
        /// ISBACK 为true 才有值
        /// </summary>
        [Description("退回原来明细ID")]
        public Guid? PARENTID { get; set; }

        /// <summary>
        /// 序号
        /// </summary>
        [Description("序号")]
        [FormFieldEdit]
        public int ROW_NO { get; set; }


        /// <summary>
        /// 检查区域
        /// </summary>
        [Description("导航：检查区域")]
        public virtual T_HM_RISK_AREA Nav_RiskArea { get; set; }

        /// <summary>
        /// 隐患上报检查区域ID
        /// </summary>
        [Description("隐患上报检查区域ID")]
        [DataFieldForeignKey("Nav_RiskArea")]
        public Guid? RISK_AREA_ID { get; set; }



        /// <summary>
        /// 检查项目
        /// </summary>
        [Description("检查项目")]
        [DataFieldForeignKey("Nav_CheckProject")]
        public Guid? CHECK_PROJECT_ID { get; set; }
        /// <summary>
        /// 检查项目
        /// </summary>
        [Description("导航：检查项目")]
        public virtual T_BS_CHECK_PROJECT Nav_CheckProject { get; set; }

        /// <summary>
        /// 检查项目分类 关联表
        /// </summary>
        [Description("检查项目分类")]
        [DataFieldForeignKey("Nav_CheckProjectProjectCategory")]
        [FormFieldEdit]
        [FormFieldTable]
        public Guid? CHECK_PROJECT_PROJECT_CATEGORY_ID { get; set; }

        /// <summary>
        /// 检查项目分类 关联表
        /// </summary>
        [Description("导航：检查项目分类")]
        public virtual T_BS_CHECK_PROJECT_PROJECT_CATEGORY Nav_CheckProjectProjectCategory { get; set; }

        /// <summary>
        /// 检查项目分类 关联表
        /// </summary>
        [Description("检查项目分类")]
        [DataFieldForeignKey("Nav_CheckProjectCategory")]
        [FormFieldEdit]
        [FormFieldTable]
        public Guid? CHECK_PROJECT_CATEGORY_ID { get; set; }

        /// <summary>
        /// 检查项目分类 关联表
        /// </summary>
        [Description("导航：检查项目分类")]
        public virtual T_BS_CHECK_PROJECT_CATEGORY Nav_CheckProjectCategory { get; set; }

        /// <summary>
        /// 是否重大隐患 否 = 0,是 = 1,
        /// </summary>
        [Description("是否重大隐患")]
        [FormFieldEdit]
        [FormFieldTable]
        public BSSeriousRiskEnum? SERIOUS_RISK { get; set; }

        /// <summary>
        /// 检查内容
        /// </summary>
        [Description("检查内容")]
        [FormFieldTable]
        [FormFieldEdit]
        [DataFieldLength(500)]
        public string CHECKCONTENT { get; set; }

        /// <summary>
        /// 检查内容
        /// </summary>
        [Description("检查内容")]
        [DataFieldForeignKey("Nav_Contents")]
        public Guid? CHECK_CONTENTS_ID { get; set; }

        /// <summary>
        /// 检查内容
        /// </summary>
        [Description("检查内容")]
        public virtual T_BS_CHECK_CONTENTS Nav_Contents { 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; }

        /// <summary>
        /// 上报描述（手动隐患上报输入文本）
        /// </summary>
        [Description("上报描述")]
        [DataFieldLength(500)]
        [FormFieldTable]
        [FormFieldEdit]
        [FormFieldQuery]
        public string DESCRIBE { get; set; }


        /// <summary>
        /// 检查类型 BS073
        /// </summary>
        [Description("检查类型")]
        [DataFieldIngore]
        public Guid? CHECK_TYPE_ID { get; set; }

        /// <summary>
        /// 检查层级 BS073
        /// </summary>
        [Description("检查层级")]
        [DataFieldIngore]
        public Guid? CHECK_TYPE_LEVEL_ID { get; set; }

        /// <summary>
        /// 状态 BS073
        /// </summary>
        [Description("状态")]
        [DataFieldIngore]
        public int? SUBMIT_STATUS { get; set; }


        /// <summary>
        /// 状态 BS073
        /// </summary>
        [Description("状态")]
        [DataFieldIngore]
        public string CREATE_NAME { get; set; }
    }
}