From 0b2c707ec72d4e7346a78ed8d1eb8dfc8c4e735a Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 24 Oct 2024 15:48:58 +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 --- .../Service/Reading/Dto/ReadingQuestionViewModel.cs | 4 +++- .../Reading/ReadingCriterion/ReadingQuestionService.cs | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 92893e0ca..e0b091502 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -1766,7 +1766,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto [NotDefault] public Guid QuestionId { get; set; } - public string Type { get; set; } + public string Type { get; set; } = string.Empty; + + public List TypeList { get; set; } = new List(); } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs index 78a91e998..fa89dc852 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs @@ -150,7 +150,10 @@ namespace IRaCIS.Core.Application.Service var result = await _readingTableQuestionTrialRepository .Where(x => x.ReadingQuestionId == inDto.QuestionId) - .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) + .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) + .WhereIf(inDto.TypeList.Count() > 0, x => inDto.TypeList.Contains(x.Type)) + + .OrderBy(x => x.ShowOrder) .ProjectTo(_mapper.ConfigurationProvider, new { @@ -172,7 +175,8 @@ namespace IRaCIS.Core.Application.Service var result = await _readingTableQuestionSystemRepository .Where(x => x.ReadingQuestionId == inDto.QuestionId) - .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) + .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) + .WhereIf(inDto.TypeList.Count() > 0, x => inDto.TypeList.Contains(x.Type)) .OrderBy(x => x.ShowOrder) .ProjectTo(_mapper.ConfigurationProvider, new {