From 711fa5a2b8b272d8d93ca14fe5330afe96529aca Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Fri, 12 Dec 2025 16:58:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 4abdb083d..b819a7b5b 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -1979,7 +1979,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(entity, type, x => new InspectionConvertDTO() { SubjectId = x.Id, - + Reason= entity.SuspendReason, TrialSiteId = x.TrialSiteId, //项目的信息 找离的最近的项目稽查信息 @@ -4204,6 +4204,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common inspection = f(entityObj); } + var reason = inspection.Reason; //避免重复赋值 有些特殊的GeneralId var generalId = (inspection.GeneralId != null && inspection.GeneralId != Guid.Empty) ? inspection.GeneralId : entityObj.Id; @@ -4217,6 +4218,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common //var generalData = await GetInspectionGeneralDataAsync(inspection); var generalData = await GetInspectionGeneralGuidAsync(inspection); + //不可少 因为稽查实体可能某些Id没有 MapEntityPropertyToAuditEntity(generalData, inspection); @@ -4276,11 +4278,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common CommonData = new { SiteCode = generalData.SiteCode, SubjectCode = generalData.SubjectCode }, }.ToJsonStr(); - inspection.BatchId = _userInfo.BatchId.Value; inspection.EntityName = entityName; + inspection.Reason=inspection.Reason==string.Empty&&reason!=string.Empty?reason:inspection.Reason; await _dbContext.DataInspection.AddAsync(inspection);