From 2d1785f5130ea37399a22293465c849316531b94 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 10 Oct 2024 14:41:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BF=E8=A7=86=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_DomainEvent/SubjectStateChangedEvent.cs | 13 +++++++++++++ .../Interceptor/AddDomainExt.cs | 13 ++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 IRaCIS.Core.Domain/_DomainEvent/SubjectStateChangedEvent.cs 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); }