修改一版
parent
182f47bbca
commit
9ac7ed7bf4
|
@ -79,6 +79,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public decimal VisitNum { get; set; }
|
||||
|
||||
public Arm ArmEnum { get; set; }
|
||||
|
||||
public List<GlobalQuestionInfo> BeforeQuestionList { get; set; }
|
||||
|
||||
public List<GlobalQuestionInfo> AfterQuestionList { get; set; }
|
||||
|
@ -93,6 +95,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public string Answer { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 答案分组
|
||||
/// </summary>
|
||||
|
@ -253,12 +258,21 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public Guid ReadingQuestionCriterionTrialId { get; set; }
|
||||
}
|
||||
|
||||
public class VisitTaskArm
|
||||
{
|
||||
public Arm ArmEnum { get; set; }
|
||||
|
||||
|
||||
public Guid VisitTaskId { get; set; }
|
||||
}
|
||||
|
||||
public class GetJudgeReadingInfoOutDto
|
||||
{
|
||||
public Guid? JudgeResultTaskId { get; set; }
|
||||
|
||||
public List<JudgeReadingInfoDto> VisitTaskInfoList { get; set; }
|
||||
public List<JudgeReadingInfoDto> VisitInfoList { get; set; }
|
||||
|
||||
public List<VisitTaskArm> VisitTaskArmList { get; set; }
|
||||
|
||||
|
||||
public ReadingTaskState ReadingTaskState { get; set; }
|
||||
|
@ -314,14 +328,24 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public Guid VisitId { get; set; }
|
||||
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
|
||||
public List<JudgeReadingQuestion> VisitTaskInfoList { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class JudgeReadingQuestion
|
||||
{
|
||||
public Arm ArmEnum { get; set; }
|
||||
|
||||
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public List<JudgeQuestion> JudgeQuestionList { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class JudgeQuestion
|
||||
{
|
||||
public Guid QuestionId { get; set; }
|
||||
|
|
|
@ -151,7 +151,8 @@ namespace IRaCIS.Application.Services
|
|||
GetGlobalReadingInfoOutDto result = new GetGlobalReadingInfoOutDto()
|
||||
{
|
||||
GlobalTaskId = inDto.VisitTaskId,
|
||||
ReadingTaskState=taskInfo.ReadingTaskState
|
||||
ReadingTaskState=taskInfo.ReadingTaskState,
|
||||
|
||||
};
|
||||
|
||||
result.TaskList = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
||||
|
@ -160,7 +161,8 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
VisitName = x.SourceSubjectVisit.VisitName,
|
||||
VisitTaskId = x.Id,
|
||||
VisitNum=x.SourceSubjectVisit.VisitNum,
|
||||
ArmEnum= taskInfo.ArmEnum,
|
||||
VisitNum =x.SourceSubjectVisit.VisitNum,
|
||||
VisitId = x.SourceSubjectVisitId.Value,
|
||||
BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(y => y.ReadingQuestionTrial.ShowOrder)
|
||||
.Select(y => new GlobalQuestionInfo()
|
||||
|
@ -168,6 +170,7 @@ namespace IRaCIS.Application.Services
|
|||
QuestionId = y.ReadingQuestionTrialId,
|
||||
QuestionName = y.ReadingQuestionTrial.QuestionName,
|
||||
AnswerGroup=y.ReadingQuestionTrial.AnswerGroup,
|
||||
|
||||
AnswerCombination=y.ReadingQuestionTrial.AnswerCombination,
|
||||
JudgeType=y.ReadingQuestionTrial.JudgeType,
|
||||
Type = y.ReadingQuestionTrial.Type,
|
||||
|
@ -192,6 +195,7 @@ namespace IRaCIS.Application.Services
|
|||
QuestionId = lr.question.QuestionId,
|
||||
QuestionName = lr.question.QuestionName,
|
||||
Type = lr.question.Type,
|
||||
|
||||
AnswerGroup = lr.question.AnswerGroup,
|
||||
AnswerCombination = lr.question.AnswerCombination,
|
||||
JudgeType = lr.question.JudgeType,
|
||||
|
@ -630,44 +634,111 @@ namespace IRaCIS.Application.Services
|
|||
JudgeResultTaskId = visitTask.JudgeResultTaskId,
|
||||
JudgeResultRemark = visitTask.JudgeResultRemark,
|
||||
JudgeResultImagePath = visitTask.JudgeResultImagePath,
|
||||
VisitTaskInfoList = new List<JudgeReadingInfoDto>()
|
||||
VisitInfoList = new List<JudgeReadingInfoDto>()
|
||||
};
|
||||
var firstTask = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == inDto.VisitTaskId).FirstNotNullAsync();
|
||||
var taskList = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == inDto.VisitTaskId).OrderBy(x=>x.ArmEnum).ToListAsync();
|
||||
judgeInfo.VisitTaskArmList = taskList.Select(x => new VisitTaskArm()
|
||||
{
|
||||
ArmEnum = x.ArmEnum,
|
||||
VisitTaskId = x.Id
|
||||
|
||||
}).ToList();
|
||||
var visitIds = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == inDto.VisitTaskId).Select(x => new
|
||||
{
|
||||
x.Id,
|
||||
x.ArmEnum,
|
||||
}).ToListAsync();
|
||||
|
||||
switch (firstTask.ReadingCategory)
|
||||
switch (taskList[0].ReadingCategory)
|
||||
{
|
||||
case ReadingCategory.Visit:
|
||||
JudgeReadingInfoDto judgeReadingInfoDto = new JudgeReadingInfoDto() {
|
||||
VisitId= firstTask.SourceSubjectVisitId.Value,
|
||||
VisitName= firstTask.TaskBlindName,
|
||||
JudgeReadingInfoDto judgeReadingInfoDto = new JudgeReadingInfoDto() {
|
||||
VisitId = taskList[0].SourceSubjectVisitId.Value,
|
||||
VisitName = taskList[0].TaskBlindName,
|
||||
VisitTaskInfoList = new List<JudgeReadingQuestion>(),
|
||||
};
|
||||
|
||||
|
||||
foreach (var item in taskList)
|
||||
{
|
||||
judgeReadingInfoDto.VisitTaskInfoList.Add(new JudgeReadingQuestion()
|
||||
{
|
||||
ArmEnum = item.ArmEnum,
|
||||
VisitTaskId = item.Id,
|
||||
JudgeQuestionList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == item.Id && x.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(x => x.ReadingQuestionTrial.ShowOrder)
|
||||
.Select(x => new JudgeQuestion()
|
||||
{
|
||||
Answer = x.Answer,
|
||||
QuestionId = x.ReadingQuestionTrial.Id,
|
||||
QuestionName = x.ReadingQuestionTrial.QuestionName
|
||||
|
||||
}).ToListAsync(),
|
||||
});
|
||||
}
|
||||
judgeInfo.VisitInfoList.Add(judgeReadingInfoDto);
|
||||
break;
|
||||
|
||||
case ReadingCategory.Global:
|
||||
var taskOneInfo = await this.GetGlobalReadingInfo(new GetGlobalReadingInfoInDto()
|
||||
{
|
||||
UsingOriginalData = true,
|
||||
VisitTaskId = taskList[0].Id
|
||||
});
|
||||
|
||||
var taskTwoInfo = await this.GetGlobalReadingInfo(new GetGlobalReadingInfoInDto()
|
||||
{
|
||||
UsingOriginalData = true,
|
||||
VisitTaskId = taskList[0].Id
|
||||
});
|
||||
|
||||
|
||||
foreach (var item in taskOneInfo.TaskList)
|
||||
{
|
||||
GlobalVisitInfo twoItem = taskTwoInfo.TaskList.Where(x => x.VisitId == item.VisitId).FirstOrDefault();
|
||||
|
||||
JudgeReadingInfoDto judgeReadingInfo = new JudgeReadingInfoDto()
|
||||
{
|
||||
VisitId = item.VisitId,
|
||||
VisitName = item.VisitName,
|
||||
VisitTaskInfoList = new List<JudgeReadingQuestion>(),
|
||||
};
|
||||
|
||||
judgeReadingInfo.VisitTaskInfoList.Add(new JudgeReadingQuestion()
|
||||
{
|
||||
ArmEnum = item.ArmEnum,
|
||||
VisitTaskId = item.VisitTaskId,
|
||||
JudgeQuestionList = item.AfterQuestionList.Where(x => x.QuestionId != null).Select(x => new JudgeQuestion()
|
||||
{
|
||||
|
||||
Answer = x.Answer,
|
||||
QuestionId = x.QuestionId.Value,
|
||||
QuestionName = x.QuestionName
|
||||
}).ToList()
|
||||
});
|
||||
if (twoItem != null)
|
||||
{
|
||||
judgeReadingInfo.VisitTaskInfoList.Add(new JudgeReadingQuestion()
|
||||
{
|
||||
ArmEnum = twoItem.ArmEnum,
|
||||
VisitTaskId = twoItem.VisitTaskId,
|
||||
JudgeQuestionList = twoItem.AfterQuestionList.Where(x => x.QuestionId != null).Select(x => new JudgeQuestion()
|
||||
{
|
||||
|
||||
Answer = x.Answer,
|
||||
QuestionId = x.QuestionId.Value,
|
||||
QuestionName = x.QuestionName
|
||||
}).ToList()
|
||||
});
|
||||
}
|
||||
|
||||
judgeInfo.VisitInfoList.Add(judgeReadingInfo);
|
||||
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//foreach (var item in visitIds)
|
||||
//{
|
||||
// var taskReadingQuestionList = await this.GetTaskAndAnswer(item.Id);
|
||||
// judgeInfo.VisitTaskInfoList.Add(
|
||||
// new JudgeReadingInfoDto()
|
||||
// {
|
||||
// JudgeQuestionAnswerInfoList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == item.Id && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
|
||||
// {
|
||||
// Answer = x.Answer,
|
||||
// QuestionName = x.ReadingQuestionTrial.QuestionName,
|
||||
// }).ToListAsync(),
|
||||
// VisitTaskId = item.Id,
|
||||
// ArmEnum = item.ArmEnum,
|
||||
// TaskReadingQuestionList = taskReadingQuestionList,
|
||||
// });
|
||||
//}
|
||||
|
||||
return judgeInfo;
|
||||
}
|
||||
#endregion
|
||||
|
|
Loading…
Reference in New Issue