using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities.Auditing; namespace Shentun.Peis.Models { /// /// 部门,已经废弃 /// [Table("department")] [Index(nameof(DisplayName), nameof(ParentId), Name = "ix_department", IsUnique = true)] public class Department : AuditedEntity, IHasConcurrencyStamp { public Department() { // CardRegisters = new HashSet(); OrganizationUnitsCustomerOrgs = new HashSet(); //Rooms = new HashSet(); ServiceTrades = new HashSet(); UserDepartments = new HashSet(); Users = new HashSet(); } [Column("display_name")] [StringLength(20)] public string DisplayName { get; set; } = null!; [Column("parent_id")] [StringLength(4)] public Guid ParentId { get; set; } [Column("path_code")] [StringLength(50)] public string PathCode { get; set; } = null!; [Column("department_type_flag")] [MaxLength(1)] public char DepartmentTypeFlag { get; set; } [Column("code_prefix")] [StringLength(2)] public string? CodePrefix { get; set; } [Column("is_active")] [MaxLength(1)] public char IsActive { get; set; } [Column("simple_code")] [StringLength(20)] public string SimpleCode { get; set; } = null!; [Column("display_order")] public int DisplayOrder { get; set; } [Column("concurrency_stamp")] public string ConcurrencyStamp { get; set; } //[Column("last_modifier_id")] //public Guid LastModifierId { get; set; } //[Column("last_modification_time", TypeName = "timestamp without time zone")] //public DateTime LastModificationTime { get; set; } //[Column("creator_id")] //public Guid CreatorId { get; set; } //[Column("creation_time", TypeName = "timestamp without time zone")] //public DateTime CreationTime { get; set; } //[Column("concurrency_stamp")] //[StringLength(40)] //public string ConcurrencyStamp { get; set; } = null!; //[InverseProperty(nameof(CardRegister.OrganizationUnit))] //public virtual ICollection CardRegisters { get; set; } [InverseProperty(nameof(OrganizationUnitsCustomerOrg.OrganizationUnit))] public virtual ICollection OrganizationUnitsCustomerOrgs { get; set; } //[InverseProperty(nameof(Room.Department))] //public virtual ICollection Rooms { get; set; } [InverseProperty(nameof(ServiceTrade.Department))] public virtual ICollection ServiceTrades { get; set; } [InverseProperty(nameof(UserDepartment.Department))] public virtual ICollection UserDepartments { get; set; } [InverseProperty(nameof(User.Department))] public virtual ICollection Users { get; set; } //public override object[] GetKeys() //{ // return new object[] { DepartmentId }; //} } }