From d0148a27cc3dc15c5cda4e5bf6facc0598b05fc7 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Thu, 27 Oct 2022 10:14:18 +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/ReadingCalculate/PCWG3CalculateService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs index 2e58c9ef9..093401f9d 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs @@ -125,7 +125,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate TableQuestionId = x.TableQuestionId, TrialId = x.TrialId, VisitTaskId = visitTaskId, - }); + }).ToList(); try @@ -148,18 +148,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var maxNewLesionsRowIndex = tableRowAnswers.Where(x => x.QuestionId == newLesionQuestion.Id).OrderByDescending(x => x.RowIndex).Select(x => x.RowIndex).FirstOrDefault(); maxNewLesionsRowIndex = Math.Floor(maxNewLesionsRowIndex); + + foreach (var item in tableRowAnswers.Where(x => x.QuestionId == newLesionQuestion.Id).OrderBy(x=>x.RowIndex)) { maxNewLesionsRowIndex++; item.QuestionId = alwaysNewLesionsQuestion.Id; item.RowIndex = maxNewLesionsRowIndex; - foreach (var tableAnswer in tableAnswers.Where(y=>y.RowId== item.Id)) + foreach (var tableAnswer in tableAnswers.Where(y => y.RowId == item.Id)) { - tableAnswer.QuestionId= alwaysNewLesionsQuestion.Id; + tableAnswer.QuestionId = alwaysNewLesionsQuestion.Id; tableAnswer.TableQuestionId = alwaysTableQuestionIdDic[tableAnswer.TableQuestionId]; + tableAnswer.RowIndex = maxNewLesionsRowIndex; } - } }