获取单个问题

Test_IRC_Net10
he 2026-07-27 13:53:11 +08:00
parent e762da2bf5
commit 11f8c9ca56
2 changed files with 46 additions and 0 deletions

View File

@ -1546,6 +1546,20 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public QuestionClassify? QuestionClassify { get; set; }
}
public class GetFilterTableQuestionInDto
{
public Guid TrialId { get; set; }
public Guid VisitTaskId { get; set; }
public Guid QuestionId { get; set; }
/// <summary>
/// 问题分类
/// </summary>
public QuestionClassify? QuestionClassify { get; set; }
}
#endregion
public class GetHistoryGlobalInfoOutDto
{

View File

@ -1401,6 +1401,38 @@ namespace IRaCIS.Core.Application.Service
}); ;
}
/// <summary>
/// 获取单个表格问题及答案 过滤问题
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<TrialReadQuestionData> GetFilterTableQuestion(GetFilterTableQuestionInDto inDto)
{
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
var tableAnswers = await _readingTableQuestionAnswerRepository
.ProjectTo<ReadingTableQuestionAnswerInfo>(_mapper.ConfigurationProvider)
.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ProjectTo<TableAnsweRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
var organIds = tableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
var questionPage = await GetReadingTableQuestion(
new GetReadingTableQuestionOrAnswerInDto()
{
TrialReadingCriterionId = taskinfo.TrialReadingCriterionId,
TaskId = inDto.VisitTaskId,
TableAnswers = tableAnswers,
TableAnsweRowInfos = tableAnsweRowInfos,
OrganInfos = organList,
QuestionClassify = inDto.QuestionClassify,
});
var result = questionPage.SinglePage.SelectMany(x => x.Childrens).Where(x => x.Id == inDto.QuestionId).FirstOrDefault();
return result;
}
/// <summary>
/// 获取自定义问题以及答案
/// </summary>