修改一版
parent
ce988d44d7
commit
0493786b36
|
@ -300,6 +300,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
ReadingTaskState = ReadingTaskState.HaveSigned
|
||||
});
|
||||
await this.TriggerJudgeQuestion(inDto.VisitTaskId);
|
||||
var result = await _visitTaskRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
@ -334,7 +335,7 @@ namespace IRaCIS.Application.Services
|
|||
var verificationResults = true;
|
||||
foreach (var item in groupTasks)
|
||||
{
|
||||
if (item.TaskAnswerList.Count() != 2)
|
||||
if (item.TaskAnswerList.Count() != 2|| item.AnswerGroup==string.Empty)
|
||||
{
|
||||
verificationResults = false;
|
||||
break;
|
||||
|
@ -350,10 +351,8 @@ namespace IRaCIS.Application.Services
|
|||
GroupId = NewId.NextGuid(),
|
||||
GroupValue = x
|
||||
});
|
||||
|
||||
var itemAnswerGroupsitem1 = answerGroup.Where(x => x.GroupValue.Contains($"|{item1.Answer}|"));
|
||||
var itemAnswerGroupsitem2 = answerGroup.Where(x => x.GroupValue.Contains($"|{item2.Answer}|"));
|
||||
|
||||
var unionList = itemAnswerGroupsitem1.Union(itemAnswerGroupsitem2).ToList();
|
||||
if (unionList.Count < 1)
|
||||
{
|
||||
|
@ -366,7 +365,9 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
if (!verificationResults)
|
||||
{
|
||||
|
||||
await this.SaveJudgeTask(new SaveJudgeTaskDto() {
|
||||
VisitTaskIds= visitTaskids,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -375,9 +376,31 @@ namespace IRaCIS.Application.Services
|
|||
/// 添加裁判任务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task SaveJudgeTask()
|
||||
private async Task SaveJudgeTask(SaveJudgeTaskDto inDto)
|
||||
{
|
||||
var firstTask = await _visitTaskRepository.Where(x => inDto.VisitTaskIds.Contains(x.Id)).FirstOrDefaultAsync();
|
||||
|
||||
VisitTask visitTask = new VisitTask()
|
||||
{
|
||||
Id = NewId.NextGuid(),
|
||||
ArmEnum = Arm.JudgeArm,
|
||||
SouceReadModuleId = firstTask.SouceReadModuleId,
|
||||
SourceSubjectVisitId = firstTask.SourceSubjectVisitId,
|
||||
SubjectId = firstTask.SubjectId,
|
||||
ReadingTaskState = ReadingTaskState.WaitReading,
|
||||
TaskName = firstTask.TaskName + "AD",
|
||||
ReadingCategory = ReadingCategory.Judge,
|
||||
TrialId = firstTask.TrialId,
|
||||
};
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => inDto.VisitTaskIds.Contains(x.Id), x => new VisitTask()
|
||||
{
|
||||
JudgeVisitTaskId = visitTask.Id
|
||||
});
|
||||
|
||||
await _visitTaskRepository.AddAsync(visitTask);
|
||||
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -359,6 +359,7 @@ namespace IRaCIS.Application.Services
|
|||
QuestionName = quesiton.QuestionName,
|
||||
ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId,
|
||||
TrialId = trialId,
|
||||
AnswerGroup = string.Empty,
|
||||
Type = quesiton.Type,
|
||||
GroupName=quesiton.GroupName,
|
||||
ReadingQuestionSystemId=x.Id,
|
||||
|
@ -396,6 +397,7 @@ namespace IRaCIS.Application.Services
|
|||
IsRequired = quesiton.IsRequired,
|
||||
ParentId = newParentId,
|
||||
ReadingQuestionSystemId = x.Id,
|
||||
AnswerGroup = string.Empty,
|
||||
ParentTriggerValue = quesiton.ParentTriggerValue,
|
||||
QuestionName = quesiton.QuestionName,
|
||||
ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId,
|
||||
|
@ -405,7 +407,7 @@ namespace IRaCIS.Application.Services
|
|||
IsJudgeQuestion = quesiton.IsJudgeQuestion,
|
||||
Remark = quesiton.Remark,
|
||||
TypeValue = quesiton.TypeValue,
|
||||
});
|
||||
}) ;
|
||||
|
||||
CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue