From 7685439398a284c73c63f507d4880aaf549165db Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 17 Dec 2025 13:40:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReadingCalculate/IVUSCalculateService.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs index 29abac87d..298007dec 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs @@ -826,6 +826,29 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto) { + var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync(); + + var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.PatchDataStatistics && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync(); + + + var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == question.Id) + .Where(x => x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show).ToListAsync(); + + var rowinfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == question.Id).Include(x => x.ReadingQuestionTrial).OrderBy(x => x.RowIndex).ToListAsync(); + + var tableQuesionAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == question.Id).ToListAsync(); + + foreach (var item in rowinfoList) + { + foreach (var tq in tableQuestions) + { + var answer = tableQuesionAnswerList.Where(x => x.TableQuestionId == tq.Id && x.RowId == item.Id).FirstOrDefault(); + if (answer == null || answer.Answer.IsNullOrEmpty()) + { + throw new BusinessValidationFailedException(_localizer["OCTTableRequired", item.ReadingQuestionTrial.OrderMark + item.RowIndex.GetLesionMark()]); + } + } + } }