diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 100081bf1..124994922 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -14,6 +14,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Microsoft.Extensions.Caching.Memory; using IRaCIS.Core.Application.Filter; +using DocumentFormat.OpenXml.Drawing; namespace IRaCIS.Application.Services { @@ -1130,7 +1131,7 @@ namespace IRaCIS.Application.Services }); var thisAnswer = tableAnswers.Where(x => x.QuestionId == item.Id).ToList(); - var orders = thisAnswer.Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList(); + var orders = thisAnswer.OrderBy(x => x.RowIndex).Select(x=>x.RowId).Distinct().ToList(); item.TableQuestions.Answers = new List>(); @@ -1140,10 +1141,15 @@ namespace IRaCIS.Application.Services QuestionMark.Part, }; - orders.ForEach(x => + foreach (var x in orders) { Dictionary answers = new Dictionary(); - var rowInfo = tableAnsweRowInfos.Where(y => y.RowIndex == x && y.QuestionId == item.Id).FirstOrDefault(); + var rowInfo = tableAnsweRowInfos.Where(y => y.Id==x).FirstOrDefault(); + //if (rowInfo == null) + //{ + // continue; + //} + var rowAnswer = thisAnswer.Where(y => y.RowId == rowInfo.Id).OrderBy(y => y.ShowOrder).ToList(); var organInfo = organInfos.Where(x => x.Id == rowInfo.OrganInfoId).FirstOrDefault(); @@ -1241,7 +1247,7 @@ namespace IRaCIS.Application.Services item.TableQuestions.Answers.Add(answers); - }); + }; if (item.Childrens != null && item.Childrens.Count != 0) { diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs index e6919d664..258dcf6f1 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs @@ -249,8 +249,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate index++; x.RowIndex = index; x.RowMark = otherLesionQuestion.OrderMark + x.RowIndex.GetLesionMark(); - x.FromMark = x.FristAddTaskId == beforeConvertedTaskId ? string.Empty : x.RowMark; - x.FristAddTaskId = x.FristAddTaskId==beforeConvertedTaskId? visitTaskId: x.FristAddTaskId; + var fristAddTaskId = x.FristAddTaskId.Clone(); + x.FromMark = fristAddTaskId == beforeConvertedTaskId ? string.Empty : x.RowMark; + x.FristAddTaskId = fristAddTaskId == beforeConvertedTaskId? visitTaskId: fristAddTaskId; x.QuestionId = otherLesionQuestion.Id; x.OrderMark = otherLesionQuestion.OrderMark; x.ReportMark = x.RowMark; @@ -265,6 +266,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { if (needRowIds.Contains(x.RowId)) { + + var row = addrowInfo.Where(y => y.Id == x.RowId).FirstOrDefault(); + if (row != null) + { + x.RowIndex = row.RowIndex; + } + + x.QuestionId = otherLesionQuestion.Id; var newLesionTableQuestion = newLesionTableQuestionList.Where(y => y.Id == x.TableQuestionId).FirstOrDefault();