Uat_Study
he 2023-05-22 17:43:23 +08:00
parent d4ffe2eadf
commit af86dd92c5
1 changed files with 6 additions and 9 deletions

View File

@ -1131,7 +1131,7 @@ namespace IRaCIS.Application.Services
}); });
var thisAnswer = tableAnswers.Where(x => x.QuestionId == item.Id).ToList(); var thisAnswer = tableAnswers.Where(x => x.QuestionId == item.Id).ToList();
var orders = thisAnswer.OrderBy(x => x.RowIndex).Select(x=>x.RowId).Distinct().ToList(); var orders = thisAnswer.Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList();
item.TableQuestions.Answers = new List<Dictionary<string, string>>(); item.TableQuestions.Answers = new List<Dictionary<string, string>>();
@ -1141,15 +1141,12 @@ namespace IRaCIS.Application.Services
QuestionMark.Part, QuestionMark.Part,
}; };
foreach (var x in orders) orders.ForEach(x =>
{ {
Dictionary<string, string> answers = new Dictionary<string, string>(); Dictionary<string, string> answers = new Dictionary<string, string>();
var rowInfo = tableAnsweRowInfos.Where(y => y.Id==x).FirstOrDefault(); var rowInfo = tableAnsweRowInfos.Where(y => y.RowIndex == x && y.QuestionId == item.Id).FirstOrDefault();
//if (rowInfo == null)
//{
// continue;
//}
var rowAnswer = thisAnswer.Where(y => y.RowId == rowInfo.Id).OrderBy(y => y.ShowOrder).ToList(); var rowAnswer = thisAnswer.Where(y => y.RowId == rowInfo.Id).OrderBy(y => y.ShowOrder).ToList();
var organInfo = organInfos.Where(x => x.Id == rowInfo.OrganInfoId).FirstOrDefault(); var organInfo = organInfos.Where(x => x.Id == rowInfo.OrganInfoId).FirstOrDefault();
@ -1247,7 +1244,7 @@ namespace IRaCIS.Application.Services
item.TableQuestions.Answers.Add(answers); item.TableQuestions.Answers.Add(answers);
}; });
if (item.Childrens != null && item.Childrens.Count != 0) if (item.Childrens != null && item.Childrens.Count != 0)
{ {