返回R1 R2 的任务Id
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
parent
f9c33e373a
commit
fe19c3b35e
|
|
@ -2460,6 +2460,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public class GetSingleVisitJudgeAnswerOutDto
|
public class GetSingleVisitJudgeAnswerOutDto
|
||||||
{
|
{
|
||||||
|
public Guid R1VisitTaskId { get; set; }
|
||||||
|
public Guid R2VisitTaskId { get; set; }
|
||||||
public List<SingleVisitJudgeAnswerItemDto> QuestionList { get; set; } = new List<SingleVisitJudgeAnswerItemDto>();
|
public List<SingleVisitJudgeAnswerItemDto> QuestionList { get; set; } = new List<SingleVisitJudgeAnswerItemDto>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,21 +105,26 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.FirstNotNullAsync();
|
.FirstNotNullAsync();
|
||||||
|
|
||||||
var taskIds = new List<Guid> { judgeDataInfo.TaskIdOne, judgeDataInfo.TaskIdTwo };
|
var taskIds = new List<Guid> { judgeDataInfo.TaskIdOne, judgeDataInfo.TaskIdTwo };
|
||||||
var taskInfo = await _visitTaskRepository
|
var readingTasks = await _visitTaskRepository
|
||||||
.Where(x => x.Id == judgeDataInfo.TaskIdOne)
|
.Where(x => taskIds.Contains(x.Id))
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
|
x.Id,
|
||||||
|
x.ArmEnum,
|
||||||
x.TrialReadingCriterionId,
|
x.TrialReadingCriterionId,
|
||||||
x.VisitTaskNum,
|
x.VisitTaskNum,
|
||||||
})
|
})
|
||||||
.FirstNotNullAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
var r1Task = readingTasks.First(x => x.ArmEnum == Arm.DoubleReadingArm1);
|
||||||
|
var r2Task = readingTasks.First(x => x.ArmEnum == Arm.DoubleReadingArm2);
|
||||||
|
|
||||||
var judgeRule = await _readingQuestionCriterionTrialRepository
|
var judgeRule = await _readingQuestionCriterionTrialRepository
|
||||||
.Where(x => x.Id == taskInfo.TrialReadingCriterionId)
|
.Where(x => x.Id == r1Task.TrialReadingCriterionId)
|
||||||
.Select(x => x.JudgeRuleEnum)
|
.Select(x => x.JudgeRuleEnum)
|
||||||
.FirstNotNullAsync();
|
.FirstNotNullAsync();
|
||||||
|
|
||||||
var displayQuestions = await GetJudgeDisplayQuestions(taskInfo.TrialReadingCriterionId, taskInfo.VisitTaskNum, judgeRule);
|
var displayQuestions = await GetJudgeDisplayQuestions(r1Task.TrialReadingCriterionId, r1Task.VisitTaskNum, judgeRule);
|
||||||
var judgeAnswers = displayQuestions
|
var judgeAnswers = displayQuestions
|
||||||
.Select(x => new SingleVisitJudgeAnswerItemDto
|
.Select(x => new SingleVisitJudgeAnswerItemDto
|
||||||
{
|
{
|
||||||
|
|
@ -149,12 +154,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
judgeAnswers.ForEach(question =>
|
judgeAnswers.ForEach(question =>
|
||||||
{
|
{
|
||||||
question.R1Answer = answerList.FirstOrDefault(x => x.VisitTaskId == judgeDataInfo.TaskIdOne && x.ReadingQuestionTrialId == question.ReadingQuestionId)?.Answer ?? string.Empty;
|
question.R1Answer = answerList.FirstOrDefault(x => x.VisitTaskId == r1Task.Id && x.ReadingQuestionTrialId == question.ReadingQuestionId)?.Answer ?? string.Empty;
|
||||||
question.R2Answer = answerList.FirstOrDefault(x => x.VisitTaskId == judgeDataInfo.TaskIdTwo && x.ReadingQuestionTrialId == question.ReadingQuestionId)?.Answer ?? string.Empty;
|
question.R2Answer = answerList.FirstOrDefault(x => x.VisitTaskId == r2Task.Id && x.ReadingQuestionTrialId == question.ReadingQuestionId)?.Answer ?? string.Empty;
|
||||||
});
|
});
|
||||||
|
|
||||||
return new GetSingleVisitJudgeAnswerOutDto
|
return new GetSingleVisitJudgeAnswerOutDto
|
||||||
{
|
{
|
||||||
|
R1VisitTaskId = r1Task.Id,
|
||||||
|
R2VisitTaskId = r2Task.Id,
|
||||||
QuestionList = judgeAnswers,
|
QuestionList = judgeAnswers,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue