修改影响归档 seqId 自动生成,不是数据库自动生成
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2024-09-02 11:05:33 +08:00
parent bd4e4e0072
commit 84f4343791
11 changed files with 19 additions and 21 deletions

View File

@ -16,6 +16,12 @@ namespace IRaCIS.Core.Domain.Models
} }
//针对dicom
public interface IEntitySeqId
{
public Guid SeqId { get; set; }
}
public abstract class Entity : IEntity<Guid> public abstract class Entity : IEntity<Guid>
{ {
[Key] [Key]

View File

@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
[Table("DicomInstance")] [Table("DicomInstance")]
public class DicomInstance : BaseFullAuditEntity public class DicomInstance : BaseFullAuditEntity, IEntitySeqId
{ {
#region 导航属性 #region 导航属性
[JsonIgnore] [JsonIgnore]
@ -18,7 +18,6 @@ namespace IRaCIS.Core.Domain.Models
#endregion #endregion
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid SeqId { get; set; } public Guid SeqId { get; set; }
public Guid StudyId { get; set; } public Guid StudyId { get; set; }

View File

@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
[Table("DicomSeries")] [Table("DicomSeries")]
public class DicomSeries : BaseFullDeleteAuditEntity public class DicomSeries : BaseFullDeleteAuditEntity, IEntitySeqId
{ {
#region 导航属性 #region 导航属性
[JsonIgnore] [JsonIgnore]
@ -22,7 +22,6 @@ namespace IRaCIS.Core.Domain.Models
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid SeqId { get; set; } public Guid SeqId { get; set; }
public Guid StudyId { get; set; } public Guid StudyId { get; set; }
public string StudyInstanceUid { get; set; } public string StudyInstanceUid { get; set; }

View File

@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
[Table("DicomStudy")] [Table("DicomStudy")]
public class DicomStudy : BaseFullDeleteAuditEntity public class DicomStudy : BaseFullDeleteAuditEntity, IEntitySeqId
{ {
#region 导航属性 #region 导航属性
//一个检查 由多个人管理 //一个检查 由多个人管理
@ -41,7 +41,6 @@ namespace IRaCIS.Core.Domain.Models
#endregion #endregion
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid SeqId { get; set; } public Guid SeqId { get; set; }
public Guid TrialId { get; set; } public Guid TrialId { get; set; }

View File

@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
[Table("SCPInstance")] [Table("SCPInstance")]
public class SCPInstance : BaseFullAuditEntity public class SCPInstance : BaseFullAuditEntity, IEntitySeqId
{ {
#region 导航属性 #region 导航属性
[JsonIgnore] [JsonIgnore]
@ -18,7 +18,6 @@ namespace IRaCIS.Core.Domain.Models
#endregion #endregion
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid SeqId { get; set; } public Guid SeqId { get; set; }
public Guid StudyId { get; set; } public Guid StudyId { get; set; }

View File

@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
[Table("SCPSeries")] [Table("SCPSeries")]
public class SCPSeries : BaseFullDeleteAuditEntity public class SCPSeries : BaseFullDeleteAuditEntity, IEntitySeqId
{ {
#region 导航属性 #region 导航属性
[JsonIgnore] [JsonIgnore]
@ -18,7 +18,6 @@ namespace IRaCIS.Core.Domain.Models
#endregion #endregion
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid SeqId { get; set; } public Guid SeqId { get; set; }
public Guid StudyId { get; set; } public Guid StudyId { get; set; }
public string StudyInstanceUid { get; set; } public string StudyInstanceUid { get; set; }

View File

@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
[Table("SCPStudy")] [Table("SCPStudy")]
public class SCPStudy : BaseFullDeleteAuditEntity public class SCPStudy : BaseFullDeleteAuditEntity, IEntitySeqId
{ {
#region 导航属性 #region 导航属性
@ -31,9 +31,6 @@ namespace IRaCIS.Core.Domain.Models
//0 未知 1 单重 2 双重 //0 未知 1 单重 2 双重
public bool IsDoubleReview { get; set; } public bool IsDoubleReview { get; set; }
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid SeqId { get; set; } public Guid SeqId { get; set; }
[ForeignKey("PatientId")] [ForeignKey("PatientId")]

View File

@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
public class TaskInstance : BaseFullAuditEntity public class TaskInstance : BaseFullAuditEntity, IEntitySeqId
{ {
#region 导航属性 #region 导航属性
[JsonIgnore] [JsonIgnore]
@ -17,7 +17,6 @@ namespace IRaCIS.Core.Domain.Models
#endregion #endregion
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid SeqId { get; set; } public Guid SeqId { get; set; }
public Guid StudyId { get; set; } public Guid StudyId { get; set; }

View File

@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
public class TaskSeries : BaseFullDeleteAuditEntity public class TaskSeries : BaseFullDeleteAuditEntity, IEntitySeqId
{ {
#region 导航属性 #region 导航属性
[JsonIgnore] [JsonIgnore]
@ -18,7 +18,6 @@ namespace IRaCIS.Core.Domain.Models
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid SeqId { get; set; } public Guid SeqId { get; set; }
public Guid StudyId { get; set; } public Guid StudyId { get; set; }
public string StudyInstanceUid { get; set; } public string StudyInstanceUid { get; set; }

View File

@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models namespace IRaCIS.Core.Domain.Models
{ {
public class TaskStudy : BaseFullDeleteAuditEntity public class TaskStudy : BaseFullDeleteAuditEntity, IEntitySeqId
{ {
#region 导航属性 #region 导航属性
[JsonIgnore] [JsonIgnore]
@ -33,8 +33,6 @@ namespace IRaCIS.Core.Domain.Models
#endregion #endregion
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid SeqId { get; set; } public Guid SeqId { get; set; }
public Guid TrialId { get; set; } public Guid TrialId { get; set; }

View File

@ -94,6 +94,10 @@ namespace IRaCIS.Core.Infra.EFCore
{ {
modelBuilder.Entity(entityType.ClrType).Property<Guid>(nameof(Entity.Id)).HasValueGenerator<MySequentialGuidValueGenerator>(); modelBuilder.Entity(entityType.ClrType).Property<Guid>(nameof(Entity.Id)).HasValueGenerator<MySequentialGuidValueGenerator>();
} }
if (typeof(IEntitySeqId).IsAssignableFrom(entityType.ClrType))
{
modelBuilder.Entity(entityType.ClrType).Property<Guid>(nameof(IEntitySeqId.SeqId)).HasValueGenerator<MySequentialGuidValueGenerator>();
}
} }
} }