j修改全局阅片结果
parent
274e0846fe
commit
ab2be64346
|
@ -54,6 +54,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<ReadingQuestionSystem> ReadingQuestionSystemList { get; set; } = new List<ReadingQuestionSystem>();
|
||||
|
||||
[ForeignKey("CriterionId")]
|
||||
|
|
|
@ -279,32 +279,58 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
});
|
||||
}
|
||||
// 全局 阅片结果
|
||||
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo)))
|
||||
u
|
||||
// 全局 阅片结果
|
||||
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo)))
|
||||
{
|
||||
var type = AuditOpt.Add;
|
||||
|
||||
var entity = item.Entity as ReadingGlobalTaskInfo;
|
||||
var list = entitys.Where(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo)).Select(t => t.Entity as ReadingGlobalTaskInfo);
|
||||
|
||||
var questionName = string.Empty;
|
||||
if(entity.QuestionId != null)
|
||||
|
||||
foreach (var group in list.GroupBy(t => t.TaskId))
|
||||
{
|
||||
questionName= await _dbContext.ReadingQuestionTrial.Where(t => t.Id == entity.QuestionId).Select(t => t.QuestionName).FirstOrDefaultAsync();
|
||||
var questionAnswerList = group.Where(t => t.QuestionId != null).ToList();
|
||||
|
||||
var reasonStr = group.Where(t => t.QuestionId == null).FirstOrDefault().Answer;
|
||||
|
||||
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 firstEntity = questionAnswerList.First();
|
||||
|
||||
var cloneEntity = firstEntity.Clone();
|
||||
|
||||
//保证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,
|
||||
|
||||
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() });
|
||||
}
|
||||
|
||||
await InsertInspection<ReadingGlobalTaskInfo>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
VisitTaskId = entity.TaskId,
|
||||
|
||||
ObjectRelationParentId = entity.TaskId,
|
||||
|
||||
},new { QuestionName= questionName });
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Qc 问题答案
|
||||
if (entitys.Any(x => x.Entity.GetType() == typeof(TrialQCQuestionAnswer)))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue