diff --git a/IRaCIS.Core.Domain/_DomainEvent/SubjectStateChangedEvent.cs b/IRaCIS.Core.Domain/_DomainEvent/SubjectStateChangedEvent.cs new file mode 100644 index 000000000..f95b27ff8 --- /dev/null +++ b/IRaCIS.Core.Domain/_DomainEvent/SubjectStateChangedEvent.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IRaCIS.Core.Domain._DomainEvent +{ + + + + +} diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs index 72c5afae8..5aa9e8ad9 100644 --- a/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs +++ b/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs @@ -62,6 +62,17 @@ public static class DBContext_Ext foreach (var entry in changeTracker.Entries()) { + var subjectVisit = entry.Entity; + + //跟踪的方式查询 不会查询数据库多次 + var findTrial = dbContext.Trial.Find(subjectVisit.TrialId); + + //入组或者PD 才执行下面的逻辑 + if (findTrial != null && findTrial.IsEnrollementQualificationConfirm && findTrial.IsPDProgressView) + { + + } + } @@ -70,7 +81,7 @@ public static class DBContext_Ext //跟随事务一起保存数据库 - dbContext.EventStoreRecord.AddRangeAsync(eventStoreList); + dbContext.EventStoreRecord.AddRange(eventStoreList); }