diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs index c8331a768..b3b27d575 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs @@ -56,9 +56,21 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task SetTrialQuestionExportResult(SetTrialQuestionExportResultInDto inDto) { - foreach (var item in inDto.QuestionList) + List needAdd = new List() + { + ExportResult.DetailedTableOfAdjudicationResults, + ExportResult.DetailedTableOfIntraReaderAnalysisResults, + ExportResult.DetailedTableOfInterReaderAnalysisResults + }; + foreach (var item in inDto.QuestionList) { + if (item.ExportResult.Contains(ExportResult.TableOfAssessmentResults)) + { + item.ExportResult.AddRange(needAdd); + } + + var ExportResultStr=JsonConvert.SerializeObject(item.ExportResult); await _readingQuestionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == item.QuestionId, x => new ReadingQuestionTrial() { @@ -68,6 +80,10 @@ namespace IRaCIS.Core.Application.Service foreach (var item in inDto.TableQuestionList) { + if (item.ExportResult.Contains(ExportResult.TableOfAssessmentResults)) + { + item.ExportResult.AddRange(needAdd); + } var ExportResultStr = JsonConvert.SerializeObject(item.ExportResult); await _readingTableQuestionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == item.TableQuestionId, x => new ReadingTableQuestionTrial() @@ -87,13 +103,13 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task GetTrialQuestionExportResult(GetTrialQuestionExportResultInDto inDto) { - var questionList = await _readingQuestionTrialRepository.Where(x => x.Type!= ReadingQestionType.Group&& x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId) + var questionList = await _readingQuestionTrialRepository.Where(x => x.Type != ReadingQestionType.Group && x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId) .OrderBy(x => x.ShowOrder).Select(x => new TrialQuestionExport() { QuestionId = x.Id, QuestionName = _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName, ExportResult = x.ExportResult, - ShowOrder=x.ShowOrder, + ShowOrder = x.ShowOrder, }).ToListAsync(); @@ -103,10 +119,10 @@ namespace IRaCIS.Core.Application.Service .OrderBy(x => x.ShowOrder).Select(x => new TrialQuestionExport() { QuestionId = x.ReadingQuestionId, - TableQuestionId=x.Id, + TableQuestionId = x.Id, QuestionName = _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName, ExportResult = x.ExportResult, - ShowOrder=x.ShowOrder, + ShowOrder = x.ShowOrder, }).ToListAsync(); questionList.ForEach(x => @@ -114,7 +130,9 @@ namespace IRaCIS.Core.Application.Service x.Children = tableQuestionList.Where(y => y.QuestionId == x.QuestionId).OrderBy(y => y.ShowOrder).ToList(); }); + List dicCode = new List() { "1","2"}; var dicList = await _dictionaryRepository.Where(x => x.Parent.Code == "ExportResult") + .Where(x=> dicCode.Contains(x.Code)) .OrderBy(x => x.ShowOrder) .Select(x => new TrialQuestionExportDic() {