获取单个问题
parent
e762da2bf5
commit
11f8c9ca56
|
|
@ -1546,6 +1546,20 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public QuestionClassify? QuestionClassify { get; set; }
|
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
|
#endregion
|
||||||
public class GetHistoryGlobalInfoOutDto
|
public class GetHistoryGlobalInfoOutDto
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
/// 获取自定义问题以及答案
|
/// 获取自定义问题以及答案
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue