Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2024-01-31 09:51:35 +08:00
commit 33a0b8f11f
1 changed files with 20 additions and 0 deletions

View File

@ -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();
}
}
}