From c4a7e8f632473b93d25517902b7fde487dd30ec6 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Thu, 14 Jul 2022 15:21:06 +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 | 40 +++---------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 405941311..763eadadf 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -353,26 +353,13 @@ namespace IRaCIS.Application.Services IsPage = true, IsPublicPage = firstData.IsPublicPage, }; - var pageGroupList = newPageQusetionList.Where(x => x.Type == "group").ToList(); - if (pageGroupList.Count()!=0) - { - pageGroupList.ForEach(x => - { - x.Childrens = newPageQusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null && y.Type != "group").ToList(); - x.Childrens.ForEach(z => - { - this.FindChildQuestion(z, newPageQusetionList); - }); - }); - } - else - { - pageGroupList = newPageQusetionList.Where(x => x.ParentId == null).ToList(); + + var pageGroupList = newPageQusetionList.Where(x => x.ParentId == null).ToList(); pageGroupList.ForEach(x => { this.FindChildQuestion(x, newPageQusetionList); }); - } + page.Childrens = pageGroupList; groupList.Add(page); } @@ -383,31 +370,14 @@ namespace IRaCIS.Application.Services else { qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList(); - groupList = qusetionList.Where(x => x.Type == "group").ToList(); - - - if (groupList.Count() != 0) - { - groupList.ForEach(x => - { - x.Childrens = qusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null && y.Type != "group").ToList(); - - x.Childrens.ForEach(z => - { - this.FindChildQuestion(z, qusetionList); - }); - - }); - } - else - { + groupList = qusetionList.Where(x => x.ParentId == null).ToList(); groupList.ForEach(x => { this.FindChildQuestion(x, qusetionList); }); - } + result.SinglePage = groupList;