using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.Identity; namespace Shentun.Peis.Models { /// /// 团检单位设置 /// [Table("customer_org")] [Index(nameof(MedicalCenterId), Name = "fki_fk_customer_org_organization_units")] [Index(nameof(ParentId), nameof(DisplayName), Name = "ix_org", IsUnique = true)] public class CustomerOrg : AuditedEntity, IDisplayName, IDisplayOrder, IHasConcurrencyStamp { public CustomerOrg() { ContactPeople = new HashSet(); CustomerOrgRegisters = new HashSet(); OrganizationUnitsCustomerOrgs = new HashSet(); } public CustomerOrg(Guid id):base(id) { ContactPeople = new HashSet(); CustomerOrgRegisters = new HashSet(); OrganizationUnitsCustomerOrgs = new HashSet(); } /// /// 单位名称 /// [Column("display_name")] [StringLength(50)] public string DisplayName { get; set; } = null!; /// /// 简称 /// [Column("short_name")] [StringLength(50)] public string? ShortName { get; set; } /// /// 开票名称 /// [Column("invoice_name")] [StringLength(50)] public string? InvoiceName { get; set; } /// /// 父编号 /// [Column("parent_id")] //[StringLength(8)] public Guid? ParentId { get; set; } /// /// 路径编码 /// [Column("path_code")] [StringLength(60)] public string PathCode { get; set; } = null!; /// /// 联系电话 /// [Column("telephone")] [StringLength(50)] public string? Telephone { get; set; } /// /// 传真 /// [Column("fax")] [StringLength(30)] public string? Fax { get; set; } /// /// 邮政编码 /// [Column("postal_code")] [StringLength(30)] public string? PostalCode { get; set; } /// /// 联系地址 /// [Column("address")] [StringLength(100)] public string? Address { get; set; } /// /// 业务银行 /// [Column("bank")] [StringLength(100)] public string? Bank { get; set; } /// /// 银行帐号 /// [Column("accounts")] [StringLength(100)] public string? Accounts { get; set; } /// /// 单位性质 /// [Column("org_type_id")] public Guid OrgTypeId { get; set; } /// /// 拼音简码 /// [Column("simple_code")] [StringLength(50)] public string SimpleCode { get; set; } = null!; /// /// 备注 /// [Column("remark")] [StringLength(100)] public string? Remark { get; set; } /// /// 锁住 /// [Column("is_lock")] [MaxLength(1)] public char IsLock { get; set; } /// /// 状态 /// [Column("is_active")] [MaxLength(1)] public char IsActive { get; set; } /// /// 显示顺序 /// [Column("display_order")] public int DisplayOrder { get; set; } [Column("concurrency_stamp")] public string ConcurrencyStamp { get; set; } /// /// 国家组织机构代码 /// [Column("country_org_code")] [StringLength(20)] public string CountryOrgCode { get; set; } /// /// 销售员 /// [Column("sales_person")] [StringLength(50)] public string SalesPerson { get; set; } /// /// 销售员电话 /// [Column("sales_person_phone")] [StringLength(20)] public string SalesPersonPhone { get; set; } /// /// 单位编码 兼容老系统 /// [Column("customer_org_code")] [StringLength(50)] public string CustomerOrgCode { get; set; } //[Column("creator_id")] //public Guid CreatorId { get; set; } //[Column("creation_time", TypeName = "timestamp without time zone")] //public DateTime CreationTime { 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("medical_center_id")] public Guid MedicalCenterId { get; set; } /// /// 体检类别id /// [Column("medical_type_id")] public Guid? MedicalTypeId { get; set; } //[Column("concurrency_stamp")] //[StringLength(40)] //public string ConcurrencyStamp { get; set; } = null!; //[ForeignKey(nameof(OrganizationUnitId))] //[InverseProperty(nameof(OrganizationUnit.CustomerOrgs))] //public virtual OrganizationUnit OrganizationUnit { get; set; } = null!; [InverseProperty(nameof(ContactPerson.CustomerOrg))] public virtual ICollection ContactPeople { get; set; } [InverseProperty(nameof(CustomerOrgRegister.CustomerOrg))] public virtual ICollection CustomerOrgRegisters { get; set; } [InverseProperty(nameof(OrganizationUnitsCustomerOrg.CustomerOrg))] public virtual ICollection OrganizationUnitsCustomerOrgs { get; set; } //public override object[] GetKeys() //{ // return new object[] { CustomerOrgId }; //} } }