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 1/3] =?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 { From 70240da5c5ba9a6876515ba91df6f219bbfd614f Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 24 Oct 2024 16:10:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Reading/_MapConfig.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 1e88652d7..905ea7a4d 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -232,9 +232,11 @@ namespace IRaCIS.Core.Application.Service CreateMap() + .ForMember(d => d.QuestionId, u => u.MapFrom(s => s.Id)) .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)); CreateMap() + .ForMember(d => d.QuestionId, u => u.MapFrom(s => s.Id)) .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)); From a4c12dcbeb8c44a42ab35c456d8cc562b2d5c1ea Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 24 Oct 2024 17:35:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Reading/_MapConfig.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 905ea7a4d..c906330fd 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -267,6 +267,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(d => d.CreateUser, u => u.Ignore()) + .ForMember(d => d.ReadingTableQuestionTrialList, u => u.Ignore()) .ForMember(d => d.ReadingQuestionSystemId, u => u.MapFrom(s => s.Id)); CreateMap()