访视全局阅片裁判
parent
c30d0be886
commit
e8b4b71499
|
@ -1307,6 +1307,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public List<JudgeQuestion> JudgeQuestionList { get; set; }
|
public List<JudgeQuestion> JudgeQuestionList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GlobalVisitJudgeQuestion : JudgeQuestion
|
||||||
|
{
|
||||||
|
public Guid VisitTaskId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 排序
|
||||||
|
/// </summary>
|
||||||
|
public int ShowOrder { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class JudgeQuestion
|
public class JudgeQuestion
|
||||||
{
|
{
|
||||||
public Guid QuestionId { get; set; }
|
public Guid QuestionId { get; set; }
|
||||||
|
@ -1314,6 +1324,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public string QuestionName { get; set; }
|
public string QuestionName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 问题类型
|
/// 问题类型
|
||||||
|
@ -1522,6 +1534,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public Guid QuestionId { get; set; }
|
public Guid QuestionId { get; set; }
|
||||||
|
|
||||||
|
public decimal VisitTaskNum { get; set; }
|
||||||
public string Answer { get; set; }
|
public string Answer { get; set; }
|
||||||
|
|
||||||
public string AnswerGroup { get; set; }
|
public string AnswerGroup { get; set; }
|
||||||
|
|
|
@ -117,32 +117,106 @@ namespace IRaCIS.Application.Services
|
||||||
switch (taskList[0].ReadingCategory)
|
switch (taskList[0].ReadingCategory)
|
||||||
{
|
{
|
||||||
case ReadingCategory.Visit:
|
case ReadingCategory.Visit:
|
||||||
JudgeReadingInfoDto judgeReadingInfoDto = new JudgeReadingInfoDto()
|
|
||||||
{
|
|
||||||
VisitId = taskList[0].SourceSubjectVisitId.Value,
|
|
||||||
VisitName = taskList[0].TaskBlindName,
|
|
||||||
VisitTaskInfoList = new List<JudgeReadingQuestion>(),
|
|
||||||
};
|
|
||||||
|
|
||||||
foreach (var item in taskList)
|
// 判断是否是全局访视任务
|
||||||
|
if (await VerifyIsGlobalVisitTask(taskList[0].Id))
|
||||||
{
|
{
|
||||||
judgeReadingInfoDto.VisitTaskInfoList.Add(new JudgeReadingQuestion()
|
|
||||||
{
|
// 找到所有的的任务
|
||||||
ArmEnum = item.ArmEnum,
|
var globalVisitTasks = await _visitTaskRepository.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReadingCategory != ReadingCategory.Judge
|
||||||
VisitTaskId = item.Id,
|
&& x.TaskState == TaskState.Effect
|
||||||
JudgeQuestionList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == item.Id && x.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(x => x.ReadingQuestionTrial.ShowOrder)
|
&& x.TrialReadingCriterionId == taskList[0].TrialReadingCriterionId
|
||||||
.Select(x => new JudgeQuestion()
|
&& x.IsAnalysisCreate == false
|
||||||
{
|
&& x.ReadingCategory == ReadingCategory.Visit && x.VisitTaskNum <= taskList[0].VisitTaskNum).Select(x => new {
|
||||||
Answer = x.Answer,
|
x.Id,
|
||||||
QuestionId = x.ReadingQuestionTrial.Id,
|
x.ArmEnum,
|
||||||
QuestionName = x.ReadingQuestionTrial.QuestionName,
|
x.VisitTaskNum,
|
||||||
QuestionGenre=x.ReadingQuestionTrial.QuestionGenre,
|
x.SourceSubjectVisitId,
|
||||||
DictionaryCode=x.ReadingQuestionTrial.DictionaryCode,
|
x.TaskBlindName,
|
||||||
|
} ).ToListAsync();
|
||||||
|
|
||||||
|
var globalVisitTaskIds = globalVisitTasks.Select(x => x.Id).ToList();
|
||||||
|
|
||||||
|
var taskNum = globalVisitTasks.Select(x => x.VisitTaskNum).Distinct().OrderBy(x=>x).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
var judgeQuestionAnswer = await _readingTaskQuestionAnswerRepository.Where(x => globalVisitTaskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(x => x.ReadingQuestionTrial.ShowOrder)
|
||||||
|
.Select(x => new GlobalVisitJudgeQuestion()
|
||||||
|
{
|
||||||
|
Answer = x.Answer,
|
||||||
|
ShowOrder = x.ReadingQuestionTrial.ShowOrder,
|
||||||
|
VisitTaskId = x.VisitTaskId,
|
||||||
|
QuestionId = x.ReadingQuestionTrial.Id,
|
||||||
|
QuestionName = x.ReadingQuestionTrial.QuestionName,
|
||||||
|
QuestionGenre = x.ReadingQuestionTrial.QuestionGenre,
|
||||||
|
DictionaryCode = x.ReadingQuestionTrial.DictionaryCode,
|
||||||
|
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
foreach (var item in taskNum)
|
||||||
|
{
|
||||||
|
var globalTaskInfos = globalVisitTasks.Where(x => x.VisitTaskNum == item).OrderBy(x => x.ArmEnum).ToList();
|
||||||
|
|
||||||
|
JudgeReadingInfoDto judgeReadingInfoDto = new JudgeReadingInfoDto()
|
||||||
|
{
|
||||||
|
VisitId = globalTaskInfos[0].SourceSubjectVisitId.Value,
|
||||||
|
VisitName = globalTaskInfos[0].TaskBlindName,
|
||||||
|
VisitTaskInfoList = new List<JudgeReadingQuestion>(),
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var globalitem in globalTaskInfos)
|
||||||
|
{
|
||||||
|
judgeReadingInfoDto.VisitTaskInfoList.Add(new JudgeReadingQuestion()
|
||||||
|
{
|
||||||
|
ArmEnum = globalitem.ArmEnum,
|
||||||
|
VisitTaskId = globalitem.Id,
|
||||||
|
JudgeQuestionList = judgeQuestionAnswer.Where(x => x.VisitTaskId == globalitem.Id).OrderBy(x => x.ShowOrder)
|
||||||
|
.Select(x => new JudgeQuestion()
|
||||||
|
{
|
||||||
|
Answer = x.Answer,
|
||||||
|
QuestionId = x.QuestionId,
|
||||||
|
QuestionName = x.QuestionName,
|
||||||
|
QuestionGenre = x.QuestionGenre,
|
||||||
|
DictionaryCode = x.DictionaryCode,
|
||||||
|
|
||||||
|
}).ToList(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
judgeInfo.VisitInfoList.Add(judgeReadingInfoDto);
|
||||||
|
}
|
||||||
|
|
||||||
}).ToListAsync(),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
judgeInfo.VisitInfoList.Add(judgeReadingInfoDto);
|
else
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
QuestionGenre = x.ReadingQuestionTrial.QuestionGenre,
|
||||||
|
DictionaryCode = x.ReadingQuestionTrial.DictionaryCode,
|
||||||
|
|
||||||
|
}).ToListAsync(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
judgeInfo.VisitInfoList.Add(judgeReadingInfoDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ReadingCategory.Global:
|
case ReadingCategory.Global:
|
||||||
|
@ -318,6 +392,35 @@ namespace IRaCIS.Application.Services
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 判断任务是否是全局访视任务
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task<bool> VerifyIsGlobalVisitTask(Guid visitTaskId)
|
||||||
|
{
|
||||||
|
// 任务
|
||||||
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
if (taskinfo.ReadingCategory != ReadingCategory.Visit)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var criterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var readModule = await _readModuleRepository.Where(x => x.SubjectVisitId == taskinfo.SourceSubjectVisitId && x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (criterion.IsGlobalReading && !criterion.IsGlobalTask && readModule != null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 触发裁判任务(新)
|
/// 触发裁判任务(新)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -369,29 +472,73 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
// 判断是单访视裁判还是全局访视裁判
|
// 判断是单访视裁判还是全局访视裁判
|
||||||
// 查找两个 访视的阅片答案
|
// 查找两个 访视的阅片答案
|
||||||
var query = from questionAnswet in _readingTaskQuestionAnswerRepository.Where(x => visitTaskids.Contains(x.VisitTaskId))
|
if (await VerifyIsGlobalVisitTask(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,
|
|
||||||
AnswerCombination = question.AnswerCombination,
|
|
||||||
JudgeType = question.JudgeType,
|
|
||||||
QuestionId = question.Id,
|
|
||||||
VisitTaskId = questionAnswet.VisitTaskId,
|
|
||||||
};
|
|
||||||
var questionAnswerlist = await query.ToListAsync();
|
|
||||||
|
|
||||||
// 将答案进行分组
|
|
||||||
List<GroupTaskAnswerDto> groupTasks = questionAnswerlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
|
||||||
{
|
{
|
||||||
QuestionId = x.Key.QuestionId,
|
// 找到所有的的任务
|
||||||
AnswerGroup = x.Key.AnswerGroup,
|
var GlobalVisitTaskIds = await _visitTaskRepository.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReadingCategory != ReadingCategory.Judge
|
||||||
AnswerCombination = x.Key.AnswerCombination,
|
&& x.TaskState == TaskState.Effect
|
||||||
JudgeType = x.Key.JudgeType,
|
&& x.TrialReadingCriterionId == visitTask.TrialReadingCriterionId
|
||||||
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
&& x.IsAnalysisCreate == false
|
||||||
}).ToList();
|
&& x.ReadingCategory == ReadingCategory.Visit && x.VisitTaskNum <= visitTask.VisitTaskNum).Select(x => x.Id).ToListAsync();
|
||||||
noteEqual = ComputeJudgeResult(groupTasks);
|
|
||||||
|
|
||||||
|
var globalVisitQuestionQuery = from questionAnswer in _readingTaskQuestionAnswerRepository.Where(x => GlobalVisitTaskIds.Contains(x.VisitTaskId))
|
||||||
|
join question in _readingQuestionTrialRepository.Where(x => x.IsJudgeQuestion) on new { ReadingQuestionTrialId = questionAnswer.ReadingQuestionTrialId } equals new { ReadingQuestionTrialId = question.Id }
|
||||||
|
select new TaskAnswerDto()
|
||||||
|
{
|
||||||
|
VisitTaskNum=questionAnswer.VisitTask.VisitTaskNum,
|
||||||
|
Answer = questionAnswer.Answer,
|
||||||
|
AnswerGroup = question.AnswerGroup,
|
||||||
|
AnswerCombination = question.AnswerCombination,
|
||||||
|
JudgeType = question.JudgeType,
|
||||||
|
QuestionId = question.Id,
|
||||||
|
VisitTaskId = questionAnswer.VisitTaskId,
|
||||||
|
};
|
||||||
|
var globalVisitAnswerlist = await globalVisitQuestionQuery.ToListAsync();
|
||||||
|
|
||||||
|
var taskNums = globalVisitAnswerlist.Select(x => x.VisitTaskNum).Distinct().OrderBy(x => x).ToList();
|
||||||
|
|
||||||
|
foreach (var item in taskNums)
|
||||||
|
{
|
||||||
|
List<GroupTaskAnswerDto> groupTasks = globalVisitAnswerlist.Where(x=>x.VisitTaskNum==item).GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
||||||
|
{
|
||||||
|
QuestionId = x.Key.QuestionId,
|
||||||
|
AnswerGroup = x.Key.AnswerGroup,
|
||||||
|
AnswerCombination = x.Key.AnswerCombination,
|
||||||
|
JudgeType = x.Key.JudgeType,
|
||||||
|
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
||||||
|
}).ToList();
|
||||||
|
noteEqual = noteEqual || ComputeJudgeResult(groupTasks);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
AnswerCombination = question.AnswerCombination,
|
||||||
|
JudgeType = question.JudgeType,
|
||||||
|
QuestionId = question.Id,
|
||||||
|
VisitTaskId = questionAnswet.VisitTaskId,
|
||||||
|
};
|
||||||
|
var questionAnswerlist = await query.ToListAsync();
|
||||||
|
|
||||||
|
// 将答案进行分组
|
||||||
|
List<GroupTaskAnswerDto> groupTasks = questionAnswerlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
||||||
|
{
|
||||||
|
QuestionId = x.Key.QuestionId,
|
||||||
|
AnswerGroup = x.Key.AnswerGroup,
|
||||||
|
AnswerCombination = x.Key.AnswerCombination,
|
||||||
|
JudgeType = x.Key.JudgeType,
|
||||||
|
TaskAnswerList = x.Select(y => y.Answer).ToList(),
|
||||||
|
}).ToList();
|
||||||
|
noteEqual = ComputeJudgeResult(groupTasks);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ReadingCategory.Global:
|
case ReadingCategory.Global:
|
||||||
var taskOneInfo = await this.GetGlobalReadingInfo(new GetGlobalReadingInfoInDto()
|
var taskOneInfo = await this.GetGlobalReadingInfo(new GetGlobalReadingInfoInDto()
|
||||||
|
|
Loading…
Reference in New Issue