From 166190b2b66d5e23c066a5239c7044812bb77941 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Mon, 15 Jul 2024 11:35:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Departments/Department.cs | 6 +-- .../QueueRegisters/QueueRegister.cs | 2 +- src/Shentun.Peis.Domain/Rooms/Room.cs | 43 ++++++++----------- .../DbMapping/Rooms/RoomDbMapping.cs | 9 ++-- 4 files changed, 26 insertions(+), 34 deletions(-) diff --git a/src/Shentun.Peis.Domain/Departments/Department.cs b/src/Shentun.Peis.Domain/Departments/Department.cs index 4b6c6a2..38ec666 100644 --- a/src/Shentun.Peis.Domain/Departments/Department.cs +++ b/src/Shentun.Peis.Domain/Departments/Department.cs @@ -19,7 +19,7 @@ namespace Shentun.Peis.Models { // CardRegisters = new HashSet(); OrganizationUnitsCustomerOrgs = new HashSet(); - Rooms = new HashSet(); + //Rooms = new HashSet(); ServiceTrades = new HashSet(); UserDepartments = new HashSet(); Users = new HashSet(); @@ -69,8 +69,8 @@ namespace Shentun.Peis.Models //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(Room.Department))] + //public virtual ICollection Rooms { get; set; } [InverseProperty(nameof(ServiceTrade.Department))] public virtual ICollection ServiceTrades { get; set; } [InverseProperty(nameof(UserDepartment.Department))] diff --git a/src/Shentun.Peis.Domain/QueueRegisters/QueueRegister.cs b/src/Shentun.Peis.Domain/QueueRegisters/QueueRegister.cs index 9eefe47..7592443 100644 --- a/src/Shentun.Peis.Domain/QueueRegisters/QueueRegister.cs +++ b/src/Shentun.Peis.Domain/QueueRegisters/QueueRegister.cs @@ -26,7 +26,7 @@ namespace Shentun.Peis.Models //[StringLength(5)] public Guid RoomId { get; set; } /// - /// 完成标志 + /// 完成标志 (o=候诊 1=已呼 2=过号) /// [Column("complete_flag")] [MaxLength(1)] diff --git a/src/Shentun.Peis.Domain/Rooms/Room.cs b/src/Shentun.Peis.Domain/Rooms/Room.cs index 3be97b7..3973f36 100644 --- a/src/Shentun.Peis.Domain/Rooms/Room.cs +++ b/src/Shentun.Peis.Domain/Rooms/Room.cs @@ -27,20 +27,33 @@ namespace Shentun.Peis.Models /// 项目类别编号 /// [Column("item_type_id")] - //[StringLength(4)] public Guid ItemTypeId { get; set; } + /// - /// + /// 体检中心ID /// - [Column("department_id")] - //[StringLength(4)] - public Guid OrganizationUnitId { get; set; } + [Column("medical_center_id")] + public Guid MedicalCenterId { get; set; } + [Column("for_sex_id")] [MaxLength(1)] public char ForSexId { get; set; } + + /// + /// 0-普通,1-抽血室 + /// [Column("room_type_flag")] [MaxLength(1)] public char RoomTypeFlag { get; set; } + + + /// + /// 候诊时间 + /// + [Column("queue_time")] + [Precision(3, 1)] + public decimal QueueTime { get; set; } + [Column("is_active")] [MaxLength(1)] public char IsActive { get; set; } @@ -53,21 +66,6 @@ namespace Shentun.Peis.Models [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!; - - [ForeignKey(nameof(OrganizationUnitId))] - [InverseProperty("Rooms")] - public virtual Department Department { get; set; } = null!; [ForeignKey(nameof(ItemTypeId))] [InverseProperty("Rooms")] public virtual ItemType ItemType { get; set; } = null!; @@ -76,9 +74,6 @@ namespace Shentun.Peis.Models [InverseProperty(nameof(Asbitem.Rooms))] public virtual ICollection Asbitems { get; set; } - //public override object[] GetKeys() - //{ - // return new object[] { RoomId }; - //} + } } diff --git a/src/Shentun.Peis.EntityFrameworkCore/DbMapping/Rooms/RoomDbMapping.cs b/src/Shentun.Peis.EntityFrameworkCore/DbMapping/Rooms/RoomDbMapping.cs index c9f40d2..037f1da 100644 --- a/src/Shentun.Peis.EntityFrameworkCore/DbMapping/Rooms/RoomDbMapping.cs +++ b/src/Shentun.Peis.EntityFrameworkCore/DbMapping/Rooms/RoomDbMapping.cs @@ -17,23 +17,20 @@ namespace Shentun.Peis.DbMapping entity.HasComment("房间设置"); entity.Property(t => t.ItemTypeId).HasComment("项目类别编号").IsRequired().IsFixedLength(); - entity.Property(t => t.OrganizationUnitId).HasComment(""); + entity.Property(t => t.MedicalCenterId).HasComment("体检中心"); entity.Property(e => e.Id).IsFixedLength(); //entity.Property(e => e.CreationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)"); - entity.Property(e => e.OrganizationUnitId).IsFixedLength().IsRequired(); + entity.Property(e => e.MedicalCenterId).IsFixedLength().IsRequired(); entity.Property(e => e.ForSexId).HasDefaultValueSql("'A'::bpchar").IsRequired(); entity.Property(e => e.RoomTypeFlag).HasDefaultValueSql("0").IsRequired(); - entity.HasOne(d => d.Department) - .WithMany(p => p.Rooms) - .HasForeignKey(d => d.OrganizationUnitId) - .HasConstraintName("fk_room_department"); + entity.HasOne(d => d.ItemType) .WithMany(p => p.Rooms)