From 9dcd9c900a5aa029c359fc4cda9c12ee65c6e7ec Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Fri, 7 Apr 2023 18:12:17 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Service/SiteSurvey/TrialSiteSurveyService.cs | 1 +
IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs
index 82f20e3cd..d54842b95 100644
--- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs
+++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs
@@ -152,6 +152,7 @@ namespace IRaCIS.Core.Application.Contracts
///
///
[HttpPost]
+ [UnitOfWork]
[AllowAnonymous]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task VerifySendCode(LoginDto userInfo, [FromServices] ITokenService _tokenService)
diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
index 6d730007f..cf24c4f80 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
@@ -1056,7 +1056,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as TrialSiteSurvey;
if (entity.TrialSite == null)
{
- entity.TrialSite = await _dbContext.TrialSite.Where(x => x.SiteId == entity.SiteId && x.TrialId == entity.TrialId).FirstOrDefaultAsync();
+ entity.TrialSite = await _dbContext.TrialSite.IgnoreQueryFilters().Where(x => x.SiteId == entity.SiteId && x.TrialId == entity.TrialId).FirstOrDefaultAsync();
}
if (entity.PreliminaryUser == null)
@@ -1069,9 +1069,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
entity.ReviewerUser = await _dbContext.User.Where(x => x.Id == entity.ReviewerUserId).FirstOrDefaultAsync();
}
+ var trialSiteId = entity.TrialSite?.Id;
+
await InsertInspection(item.Entity as TrialSiteSurvey, type, x => new InspectionConvertDTO()
{
- ObjectRelationParentId = entity.TrialSite.Id,
+ ObjectRelationParentId = trialSiteId,
}, new
{