From 9a6220bda1f7851de30c84cc2f411bd3e7f4e149 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 30 Apr 2026 14:49:23 +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 --- IRaCIS.Core.Domain/Reading/Segment/Segmentation.cs | 4 ++++ IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Domain/Reading/Segment/Segmentation.cs b/IRaCIS.Core.Domain/Reading/Segment/Segmentation.cs index e3e24b6e1..dd3c7d43f 100644 --- a/IRaCIS.Core.Domain/Reading/Segment/Segmentation.cs +++ b/IRaCIS.Core.Domain/Reading/Segment/Segmentation.cs @@ -7,6 +7,10 @@ public class Segmentation : BaseFullDeleteAuditEntity #region 导航属性 [JsonIgnore] public List SegmentList { get; set; } = new List(); + + [JsonIgnore] + [ForeignKey("VisitTaskId")] + public VisitTask VisitTask { get; set; } #endregion /// diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 9c8543324..3b91a7198 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -3631,8 +3631,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = item.Entity as Segmentation; + var visitTask = await _dbContext.VisitTask.Where(x => x.Id == entity.VisitTaskId).FirstOrDefaultAsync(); + await InsertInspection(entity, type, x => new InspectionConvertDTO() { + TrialReadingCriterionId = visitTask != null ? visitTask.TrialReadingCriterionId : null, }); } @@ -3645,9 +3648,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = item.Entity as Segment; + var visitTask = await _dbContext.VisitTask.Where(x => x.Id == entity.VisitTaskId).FirstOrDefaultAsync(); await InsertInspection(entity, type, x => new InspectionConvertDTO() { + TrialReadingCriterionId = visitTask != null ? visitTask.TrialReadingCriterionId : null, }); } @@ -3721,7 +3726,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common - var segmentation = await _dbContext.Segmentation.Where(x => x.Id == entity.SegmentationId).FirstOrDefaultAsync()?? new Segmentation() { }; + var segmentation = await _dbContext.Segmentation.Where(x => x.Id == entity.SegmentationId).Include(x=>x.VisitTask).FirstOrDefaultAsync()?? new Segmentation() { }; var segment= await _dbContext.Segment.Where(x => x.Id == entity.SegmentId).FirstOrDefaultAsync()?? new Segment() { }; @@ -3729,12 +3734,17 @@ namespace IRaCIS.Core.Infra.EFCore.Common var questionName = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == entity.QuestionId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefaultAsync(); - + Guid? trialReadingCriterionId = null; + if (segmentation.VisitTask != null) + { + trialReadingCriterionId= segmentation.VisitTask.TrialReadingCriterionId; + } await InsertInspection(entity, type, x => new InspectionConvertDTO() { + TrialReadingCriterionId= trialReadingCriterionId, },new { segmentation.SegmentationName,