From f082217e9998a8879c01c377aff96dd8e0c0a9d2 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 3 Sep 2025 14:43:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/AuditingData.cs | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 2cf0c5521..d585f0a84 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -79,7 +79,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common { return new List() { - + }; } } @@ -1733,22 +1733,24 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = item.Entity as SCPStudySubjectVisit; - var sCPStudy=await _dbContext.SCPStudy.Where(x => x.Id == entity.SCPStudyId).FirstOrDefaultAsync(); + var sCPStudy = await _dbContext.SCPStudy.Where(x => x.Id == entity.SCPStudyId).FirstOrDefaultAsync(); await InsertInspection(item.Entity as SCPStudySubjectVisit, type, x => new InspectionConvertDTO() { ObjectRelationParentId = x.SubjectId, - ObjectRelationParentId2=x.SubjectVisitId, + ObjectRelationParentId2 = x.SubjectVisitId, ObjectRelationParentId3 = x.StudyId, + IsDistinctionInterface=false, + }, new { - StudyTime = sCPStudy!=null? sCPStudy.StudyTime:null, + StudyTime = sCPStudy != null ? sCPStudy.StudyTime : null, }); - + } @@ -1766,6 +1768,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common var reason = string.Empty; + if (type == AuditOpt.Add) + { + isDistinctionInterface = false; + } + #region 处理标识 switch (_userInfo.RequestUrl.ToLower()) @@ -1860,8 +1867,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(item.Entity as TaskStudy, type, x => new InspectionConvertDTO() { ObjectRelationParentId = x.VisitTaskId, - },new { - ArmEnum= armEnum, + }, new + { + ArmEnum = armEnum, }); } @@ -1914,7 +1922,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var extraIdentification = string.Empty; Arm armEnum = Arm.SingleReadingArm; - if (entity.VisitTaskId!=null) + if (entity.VisitTaskId != null) { extraIdentification = "/VisitTask"; armEnum = await _dbContext.VisitTask.Where(x => x.Id == entity.VisitTaskId).Select(x => x.ArmEnum).FirstOrDefaultAsync(); @@ -1925,7 +1933,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(item.Entity as NoneDicomStudyFile, type, x => new InspectionConvertDTO() { - TrialId= trialid, + TrialId = trialid, ObjectRelationParentId = x.VisitTaskId, ExtraIndentification = extraIdentification }, new @@ -3409,7 +3417,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common Guid? subjectVisitId = null; if (entity.SouceReadModuleId != null) { - subjectVisitId = await _dbContext.ReadModule.Where(x => x.Id == entity.SouceReadModuleId).Select(x => x.SubjectVisitId).FirstOrDefaultAsync(); + subjectVisitId = await _dbContext.ReadModule.Where(x => x.Id == entity.SouceReadModuleId).Select(x => x.SubjectVisitId).FirstOrDefaultAsync(); obj.CutOffVisitName = await _dbContext.SubjectVisit.Where(x => x.Id == subjectVisitId).Select(x => x.BlindName).FirstOrDefaultAsync(); @@ -3422,9 +3430,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(entity, type, x => new InspectionConvertDTO() { VisitTaskId = x.Id, - SubjectVisitId= subjectVisitId, + SubjectVisitId = subjectVisitId, ExtraIndentification = extraIdentification, - + IsDistinctionInterface = type == AuditOpt.Update && isDistinctionInterface ? true : false, ObjectRelationParentId = entity.SourceSubjectVisitId != null ? entity.SourceSubjectVisitId : entity.SouceReadModuleId, @@ -3587,9 +3595,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common if (inspection.VisitTaskId != null) { - if (generalData.TrialId == null || generalData.SubjectId == null || generalData.TrialReadingCriterionId == null || generalData.SubjectVisitId == null) + if (generalData.TrialId == null || generalData.SubjectId == null || generalData.TrialReadingCriterionId == null || generalData.SubjectVisitId == null) { - var info = await _dbContext.VisitTask.Where(x => x.Id == inspection.VisitTaskId).Select(x => new { SubjectCode = x.Subject.Code, SubjectId = x.SubjectId, x.TrialId, x.SourceSubjectVisitId, ReadModuleSubjectVisitId = (Guid?)x.ReadModule.SubjectVisitId, x.TrialReadingCriterionId }).FirstOrDefaultAsync(); + var info = await _dbContext.VisitTask.Where(x => x.Id == inspection.VisitTaskId).Select(x => new { SubjectCode = x.Subject.Code, SubjectId = x.SubjectId, x.TrialId, x.SourceSubjectVisitId, ReadModuleSubjectVisitId = (Guid?)x.ReadModule.SubjectVisitId, x.TrialReadingCriterionId }).FirstOrDefaultAsync(); generalData.TrialReadingCriterionId = info?.TrialReadingCriterionId ?? generalData.TrialReadingCriterionId; generalData.TrialId = info?.TrialId ?? generalData.TrialId; @@ -3616,7 +3624,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common if (inspection.SubjectVisitId != null) { - if (generalData.TrialId == null || generalData.SubjectId == null) + if (generalData.TrialId == null || generalData.SubjectId == null) { var info = await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x => new { x.SubjectId, x.TrialSiteId, x.TrialId, SubjectCode = x.Subject.Code }).FirstOrDefaultAsync(); @@ -3635,9 +3643,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common if (generalData.SubjectId != null) { - if (generalData.TrialId == null ) + if (generalData.TrialId == null) { - var info = await _dbContext.Subject.Where(x => x.Id == generalData.SubjectId).Select(x => new { SubjectId = x.Id, x.TrialSiteId, x.TrialId, SubjectCode = x.Code, }).FirstOrDefaultAsync(); + var info = await _dbContext.Subject.Where(x => x.Id == generalData.SubjectId).Select(x => new { SubjectId = x.Id, x.TrialSiteId, x.TrialId, SubjectCode = x.Code, }).FirstOrDefaultAsync(); if (info == null) { @@ -3687,7 +3695,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common //自定义 标识后面 补充由代码上层的 extraIdentification 附加 if (isSelfDefine) { - result= $"{_userInfo.RequestUrl}/{entityTypeName}"; + result = $"{_userInfo.RequestUrl}/{entityTypeName}"; } else {