Test.EIImageViewer
he 2022-10-13 09:44:21 +08:00
parent 4a33978949
commit 88ef23955e
1 changed files with 18 additions and 18 deletions

View File

@ -524,39 +524,39 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// 全局 阅片结果 // 全局 阅片结果
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo))) 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)) //foreach (var group in list.GroupBy(t => t.TaskId))
{ //{
var questionAnswerList = group.Where(t => t.QuestionId != null).ToList(); // 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 唯一 // //保证Id 唯一
cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.GlobalTaskId.ToString(), firstEntity.TaskId.ToString(), firstEntity.Id.ToString()); // cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.GlobalTaskId.ToString(), firstEntity.TaskId.ToString(), firstEntity.Id.ToString());
await InsertInspection<ReadingGlobalTaskInfo>(cloneEntity, type, x => new InspectionConvertDTO() // await InsertInspection<ReadingGlobalTaskInfo>(cloneEntity, type, x => new InspectionConvertDTO()
{ // {
VisitTaskId = x.TaskId, // 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() });
} //}