using APT.BaseData.Domain.Enums;
using APT.Infrastructure.Core;
using APT.Infrastructure.Utility;
using APT.MS.Domain.Entities.PF;
using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace APT.BaseData.Domain.Entities.FM
{
    [Description("用户表")]
    /// <summary>
    /// 用户
    /// </summary> 
    [Redis("ID","ID","CODE")]
    [DataClassIndex(new string[] { "CODE", "ORG_ID" }, true)]
    [IgnoreT4] public partial class T_FM_USER : MesEntityBase
    {
        [Description("姓名")]
        /// <summary>
        /// 姓名
        /// </summary>
        [AcronymField("NAME_ACRONYM")]
        public string NAME { get; set; }

        /// <summary>
        /// 名称首字母缩写
        /// </summary>
        [Description("名称首字母缩写")]
        public string NAME_ACRONYM { get; set; }
        [Description("编码")]
        /// <summary>
        /// 编码，即为登入账号
        /// </summary>   
   
        public string CODE { get; set; }
        [Description("密码")]
        /// <summary>
        /// 密码
        /// </summary>
        public string PASSWORD { get; set; }
        [Description("手机")]

        /// <summary>手机号 </summary>
        public string PHONE { get; set; }

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


        /// <summary>
        /// FMEnableStatusEnum(0启用1停用)
        /// </summary>
        [Description("启用标志")]
		[EnumName("FMEnableStatusEnum")]
		public int ENABLE_STATUS { get; set; }


		[Description("备注")]
		public string REMARK { get; set; }

		/// <summary>
		/// 用于记录用户设置的打印机
		/// </summary>
		[Description("打印机ID")]
		public Guid? PRINTER_ID { get; set; }


        [Description("人员ID")]
        public Guid? PERSON_ID { get; set; }

        [Description("租户")]
        public string Tenant { get; set; }

        [Description("导航：人员")]
        /// <summary>
        /// 部门
        /// </summary>
        /// 
        public virtual T_FM_PERSON Nav_Person { get; set; }

   
        
        [Description("导航：部门")]
        /// <summary>
        /// 部门
        /// </summary>
        /// 
        public virtual T_FM_DEPARTMENT Nav_Department { get; set; }
        [Description("导航：角色列表")]
        public virtual ICollection<T_FM_USER_BELONG_ROLE> Nav_BelongRoles { get; set; }
        [Description("导航：角色组列表")]
        public virtual ICollection<T_FM_USER_BELONG_ROLE_GROUP> Nav_BelongRoleGroups { get; set; }
        [Description("导航：用户组列表")]
        public virtual ICollection<T_FM_USER_BELONG_USER_GROUP> Nav_BelongUserGroups { get; set; }

        /// <summary>
        /// 头像文件
        /// </summary>
        [Description("导航：头像文件")]
        public virtual List<T_FM_USER_PHOTO_FILE> Nav_UserPhotoFiles { get; set; }

        /// <summary>
        /// 头像文件
        /// </summary>
        [Description("导航：签名照片")]
        public virtual List<T_FM_USER_SIGN_FILE> Nav_UserSignFiles { get; set; }

        /// <summary>
        /// 头像文件
        /// </summary>
        [Description("班组ID")]
        [DataFieldIngore]
        public T_FM_TEAM Team { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Description("性别")]
        [FormFieldTable]
        [FormFieldEdit]
        [FormFieldQuery]
        [EnumName("FMSexEnum")]
        public int SEX { get; set; }
        /// <summary>
        /// 班组
        /// </summary>
        [Description("班组")]
        [FormFieldTable]
        [FormFieldQuery]
        [DataFieldIngore]
        public string TEAMNAME { get; set; }
        /// <summary>
        /// 班组ID
        /// </summary>
        [Description("班组ID")]
        [FormFieldTable]
        [FormFieldQuery]
        [DataFieldIngore]
        public Guid? TEAM_ID { get; set; }
        /// <summary>
        /// 班组
        /// </summary>
        [Description("身份证号")]
        [FormFieldTable]
        [FormFieldQuery]
        [DataFieldLength(50)]
        public string ID_CARD { get; set; }
        /// <summary>
        /// 班组
        /// </summary>
        [Description("入职时间")]
        [FormFieldTable]
        [FormFieldQuery]
        public DateTime ENTRYTIME { get; set; }
        /// <summary>
        /// 班组
        /// </summary>
        [Description("离职时间")]
        [FormFieldTable]
        [FormFieldQuery]
        public DateTime? DEPARTURETIME { get; set; }
        /// <summary>
        /// 班组
        /// </summary>
        [Description("工龄")]
        [FormFieldTable]
        [FormFieldQuery]
        public int WORKINGYEAR { get; set; }
        [Description("人员ID")]
        [DataFieldForeignKey("Nav_ApproveRole")]
        
        public Guid? APPROVE_ROLE_ID { get; set; }

        [Description("导航属性：审批角色")]
        public virtual T_PF_APPROVAL_ROLE Nav_ApproveRole { get; set; }
        
        [Description("生产单元")]
        public virtual ICollection<T_FM_USER_PRODUCTION_UNIT> Nav_ProdutionUnit { get; set; }

    }
}
