You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
3.4 KiB

3 years ago
2 years ago
1 year ago
3 years ago
3 years ago
3 years ago
2 years ago
1 year ago
3 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. using Microsoft.EntityFrameworkCore;
  6. using Volo.Abp.Domain.Entities;
  7. using Volo.Abp.Domain.Entities.Auditing;
  8. namespace Shentun.Peis.Models
  9. {
  10. /// <summary>
  11. /// 部门,已经废弃
  12. /// </summary>
  13. [Table("department")]
  14. [Index(nameof(DisplayName), nameof(ParentId), Name = "ix_department", IsUnique = true)]
  15. public class Department : AuditedEntity<Guid>, IHasConcurrencyStamp
  16. {
  17. public Department()
  18. {
  19. // CardRegisters = new HashSet<CardRegister>();
  20. OrganizationUnitsCustomerOrgs = new HashSet<OrganizationUnitsCustomerOrg>();
  21. //Rooms = new HashSet<Room>();
  22. ServiceTrades = new HashSet<ServiceTrade>();
  23. UserDepartments = new HashSet<UserDepartment>();
  24. Users = new HashSet<User>();
  25. }
  26. [Column("display_name")]
  27. [StringLength(20)]
  28. public string DisplayName { get; set; } = null!;
  29. [Column("parent_id")]
  30. [StringLength(4)]
  31. public Guid ParentId { get; set; }
  32. [Column("path_code")]
  33. [StringLength(50)]
  34. public string PathCode { get; set; } = null!;
  35. [Column("department_type_flag")]
  36. [MaxLength(1)]
  37. public char DepartmentTypeFlag { get; set; }
  38. [Column("code_prefix")]
  39. [StringLength(2)]
  40. public string? CodePrefix { get; set; }
  41. [Column("is_active")]
  42. [MaxLength(1)]
  43. public char IsActive { get; set; }
  44. [Column("simple_code")]
  45. [StringLength(20)]
  46. public string SimpleCode { get; set; } = null!;
  47. [Column("display_order")]
  48. public int DisplayOrder { get; set; }
  49. [Column("concurrency_stamp")]
  50. public string ConcurrencyStamp { get; set; }
  51. //[Column("last_modifier_id")]
  52. //public Guid LastModifierId { get; set; }
  53. //[Column("last_modification_time", TypeName = "timestamp without time zone")]
  54. //public DateTime LastModificationTime { get; set; }
  55. //[Column("creator_id")]
  56. //public Guid CreatorId { get; set; }
  57. //[Column("creation_time", TypeName = "timestamp without time zone")]
  58. //public DateTime CreationTime { get; set; }
  59. //[Column("concurrency_stamp")]
  60. //[StringLength(40)]
  61. //public string ConcurrencyStamp { get; set; } = null!;
  62. //[InverseProperty(nameof(CardRegister.OrganizationUnit))]
  63. //public virtual ICollection<CardRegister> CardRegisters { get; set; }
  64. [InverseProperty(nameof(OrganizationUnitsCustomerOrg.OrganizationUnit))]
  65. public virtual ICollection<OrganizationUnitsCustomerOrg> OrganizationUnitsCustomerOrgs { get; set; }
  66. //[InverseProperty(nameof(Room.Department))]
  67. //public virtual ICollection<Room> Rooms { get; set; }
  68. [InverseProperty(nameof(ServiceTrade.Department))]
  69. public virtual ICollection<ServiceTrade> ServiceTrades { get; set; }
  70. [InverseProperty(nameof(UserDepartment.Department))]
  71. public virtual ICollection<UserDepartment> UserDepartments { get; set; }
  72. [InverseProperty(nameof(User.Department))]
  73. public virtual ICollection<User> Users { get; set; }
  74. //public override object[] GetKeys()
  75. //{
  76. // return new object[] { DepartmentId };
  77. //}
  78. }
  79. }