Test.EIImageViewer
parent
4a33978949
commit
88ef23955e
|
@ -524,39 +524,39 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
// 全局 阅片结果
|
||||
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo)))
|
||||
{
|
||||
var type = AuditOpt.Add;
|
||||
//var type = AuditOpt.Add;
|
||||
|
||||
var list = entitys.Where(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo)).Select(t => t.Entity as ReadingGlobalTaskInfo);
|
||||
//var list = entitys.Where(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo)).Select(t => t.Entity as ReadingGlobalTaskInfo);
|
||||
|
||||
|
||||
foreach (var group in list.GroupBy(t => t.TaskId))
|
||||
{
|
||||
var questionAnswerList = group.Where(t => t.QuestionId != null).ToList();
|
||||
//foreach (var group in list.GroupBy(t => t.TaskId))
|
||||
//{
|
||||
// var questionAnswerList = group.Where(t => t.QuestionId != null).ToList();
|
||||
|
||||
var reasonStr = group.Where(t => t.QuestionId == null).FirstOrDefault().Answer;
|
||||
// var reasonStr = group.Where(t => t.QuestionId == null).FirstOrDefault().Answer;
|
||||
|
||||
var questionIdList = questionAnswerList.Select(t => t.QuestionId).ToList();
|
||||
// var questionIdList = questionAnswerList.Select(t => t.QuestionId).ToList();
|
||||
|
||||
var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => questionIdList.Contains(t.Id)).Select(t => new { t.QuestionName, QuestionId = t.Id, t.ShowOrder }).OrderBy(t => t.ShowOrder).ToListAsync();
|
||||
// var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => questionIdList.Contains(t.Id)).Select(t => new { t.QuestionName, QuestionId = t.Id, t.ShowOrder }).OrderBy(t => t.ShowOrder).ToListAsync();
|
||||
|
||||
|
||||
var firstEntity = questionAnswerList.First();
|
||||
// var firstEntity = questionAnswerList.First();
|
||||
|
||||
var cloneEntity = firstEntity.Clone();
|
||||
// var cloneEntity = firstEntity.Clone();
|
||||
|
||||
//保证Id 唯一
|
||||
cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.GlobalTaskId.ToString(), firstEntity.TaskId.ToString(), firstEntity.Id.ToString());
|
||||
// //保证Id 唯一
|
||||
// cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.GlobalTaskId.ToString(), firstEntity.TaskId.ToString(), firstEntity.Id.ToString());
|
||||
|
||||
|
||||
|
||||
await InsertInspection<ReadingGlobalTaskInfo>(cloneEntity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
VisitTaskId = x.TaskId,
|
||||
// await InsertInspection<ReadingGlobalTaskInfo>(cloneEntity, type, x => new InspectionConvertDTO()
|
||||
// {
|
||||
// VisitTaskId = x.TaskId,
|
||||
|
||||
ObjectRelationParentId = x.TaskId,
|
||||
// ObjectRelationParentId = x.TaskId,
|
||||
|
||||
}, new { Reason = reasonStr, QuestionAnswerList = questionAnswerList.Join(quesionList, t => t.QuestionId, u => u.QuestionId, (t, u) => new { t.Answer, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList() });
|
||||
}
|
||||
// }, new { Reason = reasonStr, QuestionAnswerList = questionAnswerList.Join(quesionList, t => t.QuestionId, u => u.QuestionId, (t, u) => new { t.Answer, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList() });
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue