From da5d70201b6a6f60f1449cb0257d1b9c98e4e501 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 28 Oct 2022 09:58:02 +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 --- .../ReadingCalculate/PCWG3CalculateService.cs | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs index c07f1cdb6..7b9f7990f 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs @@ -97,6 +97,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 既往新病灶 var questionAlwaysLesions = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == visitTaskInfo.TrialReadingCriterionId && x.LesionType == LesionType.AlwaysNewLesions).FirstNotNullAsync(); + + + var newLesionTableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionNewLesions.Id).ToListAsync(); + var alwaysNewLesionsTableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionAlwaysLesions.Id).ToListAsync(); + + Dictionary alwaysTableQuestionIdDic = new Dictionary(); + + alwaysNewLesionsTableQuestions.ForEach(x => + { + + alwaysTableQuestionIdDic.Add( + x.Id, + newLesionTableQuestions.Where(y => y.QuestionName == x.QuestionName).Select(y => y.Id).FirstOrDefault() + ); + }); + foreach (var item in tableAnsweRowInfos) { if (item.QuestionId == questionAlwaysLesions.Id) @@ -119,6 +135,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { item.QuestionId = questionNewLesions.Id; } + + item.TableQuestionId = alwaysTableQuestionIdDic[item.TableQuestionId]; } @@ -352,10 +370,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate ); }); - var maxNewLesionsRowIndex = tableRowAnswers.Where(x => x.QuestionId == alwaysNewLesionsQuestion.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)) {