Uat_Study
parent
00dddb2383
commit
32ce326133
|
@ -135,9 +135,24 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<(List<TrialReadQuestion>,bool)> GetTaskAdditionalQuestion(GetTaskAdditionalQuestionInDto inDto)
|
||||
{
|
||||
|
||||
var answerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).IgnoreAutoIncludes().ToListAsync();
|
||||
var taskInfo = await _visitTaskRepository.Where(x => inDto.VisitTaskId == x.Id).FirstNotNullAsync();
|
||||
var result= await _readingQuestionTrialRepository.Where(x => x.IsAdditional && x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId).IgnoreQueryFilters().ProjectTo<TrialReadQuestion>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||
return (result,true);
|
||||
var result= await _readingQuestionTrialRepository.Where(x => x.IsAdditional && x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId).IgnoreAutoIncludes().IgnoreQueryFilters().ProjectTo<TrialReadQuestion>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||
|
||||
result.ForEach(x =>
|
||||
{
|
||||
|
||||
var answer = answerList.Where(y => y.ReadingQuestionTrialId == x.Id).FirstOrDefault();
|
||||
if (answer != null)
|
||||
{
|
||||
x.Answer = answer.Answer;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
return (result,true);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -550,6 +550,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public int? ParentQuestionShowOrder { get; set; }
|
||||
|
||||
public string Answer { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
public class TrialJudgeQuestion
|
||||
|
|
Loading…
Reference in New Issue