diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs index 46f834617..e1c702efd 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs @@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Contracts Task SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto); - void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List questionlists); + Task SubmitGlobalReadingInfo(SubmitGlobalReadingInfoInDto inDto); diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 3cbe5fce2..46aaa69a3 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -42,6 +42,7 @@ namespace IRaCIS.Application.Services private readonly IRepository _readingJudgeInfoRepository; private readonly IRepository _readModuleRepository; private readonly IRepository _readingTableQuestionSystemRepository; + private readonly IRepository _readingTableQuestionTrialRepository; private readonly IRepository _readingTaskQuestionAnswerRepository; private readonly IRepository _readingQuestionCriterionTrialRepository; private readonly IRepository _readingQuestionCriterionSystemRepository; @@ -66,6 +67,7 @@ namespace IRaCIS.Application.Services IRepository readingJudgeInfoRepository, IRepository readModuleRepository, IRepository readingTableQuestionSystemRepository, + IRepository readingTableQuestionTrialRepository, IRepository readingTaskQuestionAnswerRepository, IRepository readingQuestionCriterionTrialRepository, IRepository readingQuestionCriterionSystemRepository, @@ -89,6 +91,7 @@ namespace IRaCIS.Application.Services this._readingJudgeInfoRepository = readingJudgeInfoRepository; this._readModuleRepository = readModuleRepository; this._readingTableQuestionSystemRepository = readingTableQuestionSystemRepository; + this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository; this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository; this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository; this._readingQuestionCriterionSystemRepository = readingQuestionCriterionSystemRepository; @@ -722,7 +725,7 @@ namespace IRaCIS.Application.Services #region 获取项目的阅片问题 /// - /// 获取项目的阅片问题 + /// 获取项目的阅片问题ECRF预览 /// /// /// SinglePage 单页 @@ -745,6 +748,9 @@ namespace IRaCIS.Application.Services var formType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.ReadingQuestionCriterionTrialId).Select(x => x.FormType).FirstOrDefaultAsync(); var groupList = new List(); + var qusetionIds = qusetionList.Select(x => x.ReadingQuestionTrialId).ToList(); + var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId)) + .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync(); if (inDto.FormType != null) { formType = inDto.FormType.Value; @@ -768,7 +774,7 @@ namespace IRaCIS.Application.Services var pageGroupList = newPageQusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList(); pageGroupList.ForEach(x => { - this.FindChildQuestion(x, newPageQusetionList); + this.FindChildQuestion(x, newPageQusetionList, tableQuestionList); }); page.Childrens = pageGroupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList(); @@ -785,7 +791,7 @@ namespace IRaCIS.Application.Services groupList = qusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList(); groupList.ForEach(x => { - this.FindChildQuestion(x, qusetionList); + this.FindChildQuestion(x, qusetionList, tableQuestionList); }); groupList = groupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList(); @@ -795,17 +801,7 @@ namespace IRaCIS.Application.Services } - - - - //List groupList = qusetionList.Where(x => x.ParentId == null).ToList(); - - - - //groupList.ForEach(x => - //{ - // this.FindChildQuestion(x, qusetionList); - //}); + return (result, new { readingTaskState = readingTaskState, @@ -1176,15 +1172,19 @@ namespace IRaCIS.Application.Services /// /// /// + /// [NonDynamicMethod] - public void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List questionlists) + public void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List questionlists,List tableQuestionLists) { trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId || (trialReadingQuestion.Type == "group" && x.Type != "group" && x.ParentId == null && x.GroupName == trialReadingQuestion.GroupName)).ToList(); + trialReadingQuestion.TableQuestions = tableQuestionLists.Where(x => x.ReadingQuestionId == trialReadingQuestion.ReadingQuestionTrialId).ToList(); + + if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0) { trialReadingQuestion.Childrens.ForEach(x => { - this.FindChildQuestion(x, questionlists); + this.FindChildQuestion(x, questionlists, tableQuestionLists); }); } } diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 7cb6a68ef..f2fa73d37 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -54,6 +54,7 @@ namespace IRaCIS.Core.Application.Service CreateMap(); CreateMap(); + CreateMap(); CreateMap() .ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder));