From 79fd496fc31dbbbd6f636a12050a3743495d6090 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Thu, 4 Aug 2022 11:57:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/ReadingImageTaskService.cs | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 7e5710981..161bc0ad3 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -170,13 +170,13 @@ namespace IRaCIS.Application.Services { VisitName = x.SourceSubjectVisit.VisitName, VisitTaskId = x.Id, - QuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) - .Select(y => new OncologyQuestion() - { - QuestionId = y.ReadingQuestionTrialId, - QuestionName = y.ReadingQuestionTrial.QuestionName, - Answer = y.GlobalChangeAnswer - }).ToList() + // QuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) + //.Select(y => new OncologyQuestion() + //{ + // QuestionId = y.ReadingQuestionTrialId, + // QuestionName = y.ReadingQuestionTrial.QuestionName, + // Answer = y.GlobalChangeAnswer + //}).ToList() }).ToListAsync(); var oncologyReadingQuestions = await _readingOncologyTaskInfoRepository.Where(x => x.OncologyTaskId == inDto.VisitTaskId).ToListAsync(); @@ -191,15 +191,19 @@ namespace IRaCIS.Application.Services x.EvaluationReason = oncologyData.EvaluationReason; } - x.QuestionList.ForEach(z => + x.QuestionList = globalTaskReadingInfo.TaskList.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(x => x.QuestionId != null) + .Select(y => new OncologyQuestion { - z.Answer = globalTaskReadingInfo.TaskList.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(y => z.QuestionId == y.QuestionId).Select(y => y.Answer).FirstOrDefault(); + QuestionId = y.QuestionId ?? default(Guid), + QuestionName = y.QuestionName, + Answer = y.Answer + }).ToList(); - }); + x.IsHaveChange = globalTaskReadingInfo.TaskList.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Any(y => y.IsHaveChange); - x.VisitRemark = globalTaskReadingInfo.TaskList.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(y => y.QuestionId == null).Select(x => x.Answer).FirstOrDefault() ?? String.Empty; + x.VisitRemark = globalTaskReadingInfo.TaskList.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(y => y.QuestionId == null).Select(x => x.Answer).FirstOrDefault() ?? string.Empty; });