修改一版

Uat_Study
he 2022-06-20 15:39:59 +08:00
parent b2b1f36328
commit 522d7eca07
2 changed files with 27 additions and 3 deletions

View File

@ -79,6 +79,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public string QuestionName { get; set; }
public string AnswerGroup { get; set; }
}
public class GetTrialCriterionJudgeQuestionListInDto
@ -128,6 +130,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
// List<GetTrialReadingQuestionOutDto> Questions { get; set; }
//}
public class TaskAnswerDto
{
public Guid VisitTaskId { get; set; }
public Guid QuestionId { get; set; }
public string Answer { get; set; }
public string AnswerGroup { get; set; }
}
public class GetTrialReadingQuestionOutDto
{
public Guid ReadingQuestionTrialId { get; set; }

View File

@ -224,7 +224,7 @@ namespace IRaCIS.Application.Services
Answer= leftquestionAnswer.Answer
};
var qusetionList =await query.ToListAsync();
var qusetionList =await query.OrderBy(x=>x.ShowOrder).ToListAsync();
@ -311,9 +311,20 @@ namespace IRaCIS.Application.Services
{
var visitTask = await _visitTaskRepository.Where(x => x.Id == VisitTaskId).FirstOrDefaultAsync();
var visitTaskList = await _visitTaskRepository.Where(x =>x.ReadingTaskState== ReadingTaskState.HaveSigned&& x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && x.SouceReadModuleId == visitTask.SouceReadModuleId).ToListAsync();
if (visitTaskList.Count == 0)
var visitTaskids = visitTaskList.Select(x => x.Id).ToList();
if (visitTaskList.Count == 2)
{
var query = from questionAnswet in _readingTaskQuestionAnswerRepository.Where(x=> visitTaskids.Contains(x.VisitTaskId))
join question in _readingQuestionTrialRepository.Where(x=>x.IsJudgeQuestion) on new { ReadingQuestionTrialId= questionAnswet.ReadingQuestionTrialId } equals new { ReadingQuestionTrialId= question.Id }
select new TaskAnswerDto()
{
Answer= questionAnswet.Answer,
AnswerGroup= question.AnswerGroup,
QuestionId= question.Id,
VisitTaskId= questionAnswet.VisitTaskId,
};
}
}