修改一版

Uat_Study
he 2022-07-14 15:55:11 +08:00
parent a1c63ec8db
commit d8a91f3903
1 changed files with 5 additions and 5 deletions

View File

@ -354,13 +354,13 @@ namespace IRaCIS.Application.Services
IsPublicPage = firstData.IsPublicPage,
};
var pageGroupList = newPageQusetionList.Where(x =>x.IsPage|| (x.ParentId == null&&x.PageName.IsNullOrEmpty())).ToList();
var pageGroupList = newPageQusetionList.Where(x =>x.Type =="group"|| (x.ParentId == null&&x.GroupName.IsNullOrEmpty())).ToList();
pageGroupList.ForEach(x =>
{
this.FindChildQuestion(x, newPageQusetionList);
});
page.Childrens = pageGroupList;
page.Childrens = pageGroupList.Where(x=> !(x.Type == "group"&&x.Childrens.Count()==0)).ToList();
groupList.Add(page);
}
@ -371,13 +371,13 @@ namespace IRaCIS.Application.Services
{
qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList();
groupList = qusetionList.Where(x => x.IsPage || (x.ParentId == null && x.PageName.IsNullOrEmpty())).ToList();
groupList = qusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
groupList.ForEach(x =>
{
this.FindChildQuestion(x, qusetionList);
});
groupList= groupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList();
result.SinglePage = groupList;
@ -540,7 +540,7 @@ namespace IRaCIS.Application.Services
[NonDynamicMethod]
public void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List<GetTrialReadingQuestionOutDto> questionlists)
{
trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId||(trialReadingQuestion.IsPage&&x.ParentId==null&&x.GroupName==trialReadingQuestion.GroupName)).ToList();
trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId||(trialReadingQuestion.Type == "group"&&x.Type != "group" && x.ParentId==null&&x.GroupName==trialReadingQuestion.GroupName)).ToList();
if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0)
{
trialReadingQuestion.Childrens.ForEach(x =>