diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 9f7bfeb83..b37de711e 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -5618,6 +5618,13 @@ 获取项目的阅片问题 + + SinglePage 单页 + + MultiPage 多页 + + PublicPage 公共 + diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 75a669401..8e0d6c2d4 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -296,6 +296,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public JudgeTypeEnum JudgeType { get; set; } } + + public class GetTrialReadingQuestionPageDto + { + public List SinglePage { get; set; } + + public List MultiPage { get; set; } + + public List PublicPage{ get; set; } + } public class GetTrialReadingQuestionOutDto { public Guid ReadingQuestionTrialId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index bb0946bc7..405941311 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -78,6 +78,7 @@ namespace IRaCIS.Application.Services /// /// 获取下一个阅片任务 /// + /// /// [HttpPost] @@ -292,12 +293,19 @@ namespace IRaCIS.Application.Services /// /// 获取项目的阅片问题 /// + /// + /// SinglePage 单页 + /// + /// MultiPage 多页 + /// + /// PublicPage 公共 + /// /// /// [HttpPost] - public async Task<(List, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto) + public async Task<(GetTrialReadingQuestionPageDto, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto) { - + var result = new GetTrialReadingQuestionPageDto(); var readingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.ReadingTaskState).FirstOrDefaultAsync(); var query= from data in _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId==inDto.ReadingQuestionCriterionTrialId) @@ -326,9 +334,6 @@ namespace IRaCIS.Application.Services IsPublicPage=leftpage.IsPublicPage, }; - - - var qusetionList =await query.OrderBy(x=>x.ShowOrder).ToListAsync(); var formType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.ReadingQuestionCriterionTrialId).Select(x => x.FormType).FirstOrDefaultAsync(); @@ -340,50 +345,73 @@ namespace IRaCIS.Application.Services var readingCriterionPageIds = qusetionList.OrderBy(x => x.PageShowOrder).Select(x => x.ReadingCriterionPageId).Distinct().ToList(); foreach (var item in readingCriterionPageIds) { - var newPageQusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == item).ToList(); - var firstData = newPageQusetionList.FirstOrDefault(); var page = new GetTrialReadingQuestionOutDto() { - PageName = firstData.PageName, IsPage = true, IsPublicPage = firstData.IsPublicPage, - }; - - var pageGroupList = newPageQusetionList.Where(x => x.Type == "group").ToList(); - pageGroupList.ForEach(x => + var pageGroupList = newPageQusetionList.Where(x => x.Type == "group").ToList(); + if (pageGroupList.Count()!=0) { - x.Childrens = newPageQusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null && y.Type != "group").ToList(); - x.Childrens.ForEach(z => + pageGroupList.ForEach(x => { - this.FindChildQuestion(z, newPageQusetionList); + x.Childrens = newPageQusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null && y.Type != "group").ToList(); + x.Childrens.ForEach(z => + { + this.FindChildQuestion(z, newPageQusetionList); + }); }); - }); - firstData.Childrens = pageGroupList; - groupList.Add(firstData); + } + else + { + pageGroupList = newPageQusetionList.Where(x => x.ParentId == null).ToList(); + pageGroupList.ForEach(x => + { + this.FindChildQuestion(x, newPageQusetionList); + }); + } + page.Childrens = pageGroupList; + groupList.Add(page); } - - + result.PublicPage = groupList.Where(x => x.IsPublicPage.Value).ToList(); + result.MultiPage= groupList.Where(x => !x.IsPublicPage.Value).ToList(); } else { qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList(); groupList = qusetionList.Where(x => x.Type == "group").ToList(); - groupList.ForEach(x => - { - x.Childrens = qusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null && y.Type != "group").ToList(); - x.Childrens.ForEach(z => + if (groupList.Count() != 0) + { + groupList.ForEach(x => { - this.FindChildQuestion(z, qusetionList); + 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; + + } @@ -397,7 +425,7 @@ namespace IRaCIS.Application.Services //{ // this.FindChildQuestion(x, qusetionList); //}); - return (groupList, new + return (result, new { readingTaskState = readingTaskState, FormType= formType