修改一版
parent
4590019929
commit
a9022b4c02
|
@ -69,18 +69,30 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
|
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public List<AnswerGroupDto> AnswerGroup { get; set; }
|
public List<string> AnswerGroup { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public List<AnswerCombinationDto> AnswerCombination { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public JudgeTypeEnum JudgeType { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetTrialCriterionJudgeQuestionListOutDto
|
public class GetTrialCriterionJudgeQuestionListOutDto
|
||||||
{
|
{
|
||||||
public Guid ReadingQuestionTrialId { get; set; }
|
public Guid ReadingQuestionTrialId { get; set; }
|
||||||
|
|
||||||
public string QuestionName { get; set; }
|
public string QuestionName { get; set; }
|
||||||
|
|
||||||
public string TypeValue { get; set; }
|
public string TypeValue { get; set; }
|
||||||
|
|
||||||
public List<AnswerGroupDto> AnswerGroup { get; set; }
|
public JudgeTypeEnum JudgeType { get; set; }
|
||||||
|
|
||||||
|
public List<string> AnswerGroup { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public List<AnswerCombinationDto> AnswerCombination { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -112,6 +124,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public Guid ReadingQuestionCriterionTrialId { get; set; }
|
public Guid ReadingQuestionCriterionTrialId { get; set; }
|
||||||
|
|
||||||
public List<QuestionAnswer> AnswerList { get; set; } = new List<QuestionAnswer>();
|
public List<QuestionAnswer> AnswerList { get; set; } = new List<QuestionAnswer>();
|
||||||
|
|
||||||
|
public JudgeTypeEnum JudgeType { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SaveJudgeTaskDto
|
public class SaveJudgeTaskDto
|
||||||
|
@ -142,6 +156,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public string AnswerGroup { get; set; }
|
public string AnswerGroup { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string AnswerCombination { get; set; }
|
||||||
|
|
||||||
|
public JudgeTypeEnum JudgeType { get; set; }
|
||||||
|
|
||||||
public List<TaskAnswerDto> TaskAnswerList { get; set; }
|
public List<TaskAnswerDto> TaskAnswerList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +172,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class AnswerGroupDto
|
public class AnswerCombinationDto
|
||||||
{
|
{
|
||||||
public List<string> AnswerGroupA { get; set; }
|
public List<string> AnswerGroupA { get; set; }
|
||||||
|
|
||||||
|
@ -169,6 +188,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public string Answer { get; set; }
|
public string Answer { get; set; }
|
||||||
|
|
||||||
public string AnswerGroup { get; set; }
|
public string AnswerGroup { get; set; }
|
||||||
|
|
||||||
|
public string AnswerCombination { get; set; }
|
||||||
|
|
||||||
|
public JudgeTypeEnum JudgeType { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetTrialReadingQuestionOutDto
|
public class GetTrialReadingQuestionOutDto
|
||||||
|
|
|
@ -180,9 +180,11 @@ namespace IRaCIS.Application.Services
|
||||||
var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId && x.IsJudgeQuestion)
|
var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId && x.IsJudgeQuestion)
|
||||||
.Select(x => new GetTrialCriterionJudgeQuestionListOutDto()
|
.Select(x => new GetTrialCriterionJudgeQuestionListOutDto()
|
||||||
{
|
{
|
||||||
AnswerGroup = JsonConvert.DeserializeObject<List<AnswerGroupDto>>(x.AnswerGroup.IsNullOrEmpty()?"[]": x.AnswerGroup),
|
AnswerGroup = JsonConvert.DeserializeObject<List<string>>(x.AnswerGroup.IsNullOrEmpty()?"[]": x.AnswerGroup),
|
||||||
|
AnswerCombination = JsonConvert.DeserializeObject<List<AnswerCombinationDto>>(x.AnswerCombination.IsNullOrEmpty() ? "[]" : x.AnswerCombination),
|
||||||
QuestionName = x.QuestionName,
|
QuestionName = x.QuestionName,
|
||||||
TypeValue =x.TypeValue,
|
TypeValue =x.TypeValue,
|
||||||
|
JudgeType=x.JudgeType,
|
||||||
ReadingQuestionTrialId = x.Id
|
ReadingQuestionTrialId = x.Id
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
return result;
|
return result;
|
||||||
|
@ -198,7 +200,9 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
await _readingQuestionTrialRepository.UpdatePartialFromQueryAsync(inDto.ReadingQuestionTrialId, x => new ReadingQuestionTrial()
|
await _readingQuestionTrialRepository.UpdatePartialFromQueryAsync(inDto.ReadingQuestionTrialId, x => new ReadingQuestionTrial()
|
||||||
{
|
{
|
||||||
AnswerGroup = JsonConvert.SerializeObject(inDto.AnswerGroup)
|
AnswerGroup = JsonConvert.SerializeObject(inDto.AnswerCombination),
|
||||||
|
AnswerCombination = JsonConvert.SerializeObject(inDto.AnswerCombination),
|
||||||
|
JudgeType= inDto.JudgeType,
|
||||||
}) ;
|
}) ;
|
||||||
|
|
||||||
var result = await _readingQuestionTrialRepository.SaveChangesAsync();
|
var result = await _readingQuestionTrialRepository.SaveChangesAsync();
|
||||||
|
@ -236,9 +240,6 @@ namespace IRaCIS.Application.Services
|
||||||
};
|
};
|
||||||
|
|
||||||
var qusetionList =await query.OrderBy(x=>x.ShowOrder).ToListAsync();
|
var qusetionList =await query.OrderBy(x=>x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<GetTrialReadingQuestionOutDto> groupList = qusetionList.Where(x => x.ParentId == null).ToList();
|
List<GetTrialReadingQuestionOutDto> groupList = qusetionList.Where(x => x.ParentId == null).ToList();
|
||||||
groupList.ForEach(x =>
|
groupList.ForEach(x =>
|
||||||
{
|
{
|
||||||
|
@ -312,7 +313,7 @@ namespace IRaCIS.Application.Services
|
||||||
});
|
});
|
||||||
var result = await _visitTaskRepository.SaveChangesAsync();
|
var result = await _visitTaskRepository.SaveChangesAsync();
|
||||||
// 触裁判任务
|
// 触裁判任务
|
||||||
await this.TriggerJudgeQuestionNew(inDto.VisitTaskId);
|
await this.TriggerJudgeQuestion(inDto.VisitTaskId);
|
||||||
// 添加阅片期任务
|
// 添加阅片期任务
|
||||||
await this.AddReadingTask(inDto.VisitTaskId);
|
await this.AddReadingTask(inDto.VisitTaskId);
|
||||||
// 完成阅片修改状态
|
// 完成阅片修改状态
|
||||||
|
@ -428,10 +429,10 @@ namespace IRaCIS.Application.Services
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="visitTaskId"></param>
|
/// <param name="visitTaskId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task TriggerJudgeQuestionNew(Guid visitTaskId)
|
private async Task TriggerJudgeQuestion(Guid visitTaskId)
|
||||||
{
|
{
|
||||||
var visitTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstOrDefaultAsync();
|
var visitTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstOrDefaultAsync();
|
||||||
var visitTaskids = await _visitTaskRepository.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned &&x.ReadingCategory!= ReadingCategory.Judge && x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && x.SouceReadModuleId == visitTask.SouceReadModuleId).Select(x => x.Id).ToListAsync();
|
var visitTaskids = await _visitTaskRepository.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned &&x.ReadingCategory!= ReadingCategory.Judge&&!x.IsReReading && x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && x.SouceReadModuleId == visitTask.SouceReadModuleId).Select(x => x.Id).ToListAsync();
|
||||||
if (visitTaskids.Count == 2)
|
if (visitTaskids.Count == 2)
|
||||||
{
|
{
|
||||||
var query = from questionAnswet in _readingTaskQuestionAnswerRepository.Where(x => visitTaskids.Contains(x.VisitTaskId))
|
var query = from questionAnswet in _readingTaskQuestionAnswerRepository.Where(x => visitTaskids.Contains(x.VisitTaskId))
|
||||||
|
@ -440,22 +441,26 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
Answer = questionAnswet.Answer,
|
Answer = questionAnswet.Answer,
|
||||||
AnswerGroup = question.AnswerGroup,
|
AnswerGroup = question.AnswerGroup,
|
||||||
|
AnswerCombination=question.AnswerCombination,
|
||||||
|
JudgeType=question.JudgeType,
|
||||||
QuestionId = question.Id,
|
QuestionId = question.Id,
|
||||||
VisitTaskId = questionAnswet.VisitTaskId,
|
VisitTaskId = questionAnswet.VisitTaskId,
|
||||||
};
|
};
|
||||||
var questionAnswerlist = await query.ToListAsync();
|
var questionAnswerlist = await query.ToListAsync();
|
||||||
List<GroupTaskAnswerDto> groupTasks = questionAnswerlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup }).Select(x => new GroupTaskAnswerDto
|
List<GroupTaskAnswerDto> groupTasks = questionAnswerlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup,x.JudgeType,x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
|
||||||
{
|
{
|
||||||
QuestionId = x.Key.QuestionId,
|
QuestionId = x.Key.QuestionId,
|
||||||
AnswerGroup = x.Key.AnswerGroup,
|
AnswerGroup = x.Key.AnswerGroup,
|
||||||
|
AnswerCombination=x.Key.AnswerCombination,
|
||||||
|
JudgeType=x.Key.JudgeType,
|
||||||
TaskAnswerList = x.ToList(),
|
TaskAnswerList = x.ToList(),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
var verificationResults = false;
|
var noteEqual = false;
|
||||||
foreach (var item in groupTasks)
|
foreach (var item in groupTasks)
|
||||||
{
|
{
|
||||||
if (item.TaskAnswerList.Count() != 2)
|
if (item.TaskAnswerList.Count() != 2)
|
||||||
{
|
{
|
||||||
verificationResults = true;
|
noteEqual = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -464,22 +469,45 @@ namespace IRaCIS.Application.Services
|
||||||
var taskAnswer2 = item.TaskAnswerList[1];
|
var taskAnswer2 = item.TaskAnswerList[1];
|
||||||
if (taskAnswer1.Answer != taskAnswer2.Answer)
|
if (taskAnswer1.Answer != taskAnswer2.Answer)
|
||||||
{
|
{
|
||||||
var answerGroup = JsonConvert.DeserializeObject<List<AnswerGroupDto>>(item.AnswerGroup==string.Empty?"[]": item.AnswerGroup).ToList();
|
|
||||||
answerGroup.ForEach(x =>
|
switch (item.JudgeType)
|
||||||
{
|
{
|
||||||
if (x.AnswerGroupA.Contains(taskAnswer1.Answer) && x.AnswerGroupB.Contains(taskAnswer2.Answer))
|
case JudgeTypeEnum.AnswerDisaffinity:
|
||||||
{
|
noteEqual = true;
|
||||||
verificationResults = true;
|
break;
|
||||||
}
|
case JudgeTypeEnum.AnswerGroup:
|
||||||
if (x.AnswerGroupB.Contains(taskAnswer1.Answer) && x.AnswerGroupA.Contains(taskAnswer2.Answer))
|
var answerGroupList = JsonConvert.DeserializeObject<List<string>>(item.AnswerGroup).Select(x => new AnswerGroup()
|
||||||
{
|
{
|
||||||
verificationResults = true;
|
GroupId = NewId.NextGuid(),
|
||||||
}
|
GroupValue = x
|
||||||
});
|
}).ToList();
|
||||||
|
var itemAnswerGroupsitem1 = answerGroupList.Where(x => x.GroupValue.Contains($"|{taskAnswer1.Answer}|"));
|
||||||
|
var itemAnswerGroupsitem2 = answerGroupList.Where(x => x.GroupValue.Contains($"|{taskAnswer2.Answer}|"));
|
||||||
|
var unionList = itemAnswerGroupsitem1.Intersect(itemAnswerGroupsitem2).ToList();
|
||||||
|
if (unionList.Count < 1)
|
||||||
|
{
|
||||||
|
noteEqual =true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case JudgeTypeEnum.AnswerCombination:
|
||||||
|
var answerCombinationList = JsonConvert.DeserializeObject<List<AnswerCombinationDto>>(item.AnswerCombination == string.Empty ? "[]" : item.AnswerCombination).ToList();
|
||||||
|
answerCombinationList.ForEach(x =>
|
||||||
|
{
|
||||||
|
if (x.AnswerGroupA.Contains(taskAnswer1.Answer) && x.AnswerGroupB.Contains(taskAnswer2.Answer))
|
||||||
|
{
|
||||||
|
noteEqual = true;
|
||||||
|
}
|
||||||
|
if (x.AnswerGroupB.Contains(taskAnswer1.Answer) && x.AnswerGroupA.Contains(taskAnswer2.Answer))
|
||||||
|
{
|
||||||
|
noteEqual = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (verificationResults)
|
if (noteEqual)
|
||||||
{
|
{
|
||||||
await this.SaveJudgeTask(new SaveJudgeTaskDto()
|
await this.SaveJudgeTask(new SaveJudgeTaskDto()
|
||||||
{
|
{
|
||||||
|
|
|
@ -163,6 +163,28 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
Read = 2,
|
Read = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum JudgeTypeEnum
|
||||||
|
{
|
||||||
|
None=0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 答案不相同
|
||||||
|
/// </summary>
|
||||||
|
AnswerDisaffinity=1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 答案分组
|
||||||
|
/// </summary>
|
||||||
|
AnswerGroup=2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 答案组合
|
||||||
|
/// </summary>
|
||||||
|
AnswerCombination=3,
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 阅片状态
|
/// 阅片状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -92,6 +92,16 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string AnswerGroup { get; set; } = string.Empty;
|
public string AnswerGroup { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 答案组合
|
||||||
|
/// </summary>
|
||||||
|
public string AnswerCombination { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 裁判类型
|
||||||
|
/// </summary>
|
||||||
|
public JudgeTypeEnum JudgeType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建人
|
/// 创建人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue