From 2747fa82e3b9b2cb0a172b406b692bbcb252e1a8 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 30 Jan 2024 14:29:28 +0800 Subject: [PATCH] =?UTF-8?q?lugano=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LuganoCalculateService.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index 7add36e94..7e4d51382 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -882,6 +882,26 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if(targetQuestion!=null) { // 找到状态问题 + var stateQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == targetQuestion.Id && x.QuestionMark == QuestionMark.State).FirstOrDefaultAsync(); + if (stateQuestion != null) + { + var state =await _readingTableQuestionAnswerRepository.Where(x=>x.VisitTaskId==inDto.VisitTaskId&&x.RowIndex== (int)Math.Floor(inDto.RowNumber)&&x.TableQuestionId== stateQuestion.Id).Select(x=>x.Answer).FirstOrDefaultAsync(); + + // 找到ppd问题 + var ppdQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == targetQuestion.Id && x.QuestionMark == QuestionMark.PPD).FirstOrDefaultAsync(); + + if(ppdQuestion!=null) + { + var ppdAnswerList= await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == stateQuestion.Id) + .Where(x=> x.RowIndex >= (int)Math.Floor(inDto.RowNumber) && x.RowIndex< ((int)Math.Floor(inDto.RowNumber)+1)) + .Select(x => x.Answer).ToListAsync(); + + var allPPd = ppdAnswerList.Select(x => x.IsNullOrEmptyReturn0()).Sum(); + + + + } + } }