From 5684a7b389e2643c17c76e081b916cd77df3d38c Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Tue, 15 Nov 2022 17:30:04 +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 --- .../Reading/Dto/ReadingQuestionViewModel.cs | 5 ++++ .../ReadingQuestionService.cs | 29 +++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index d1287c704..9853a4d67 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -1068,6 +1068,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto [NotDefault] public Guid QuestionId { get; set; } + public string Type { get; set; } + } @@ -1076,6 +1078,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto [NotDefault] public Guid TrialCriterionId { get; set; } + + public string Type { get; set; } + } public class GetTrialGroupNameListInDto diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs index c3a028803..83f484e03 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs @@ -86,7 +86,7 @@ namespace IRaCIS.Application.Services var result =await _readingQuestionTrialRepository .Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialCriterionId) - .Where(x => x.Type == "number") + .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) .OrderBy(x => x.ShowOrder) .Select(x => new GetCalculateQuestionsOutDto (){ @@ -111,7 +111,7 @@ namespace IRaCIS.Application.Services var result = await _readingTableQuestionTrialRepository .Where(x => x.ReadingQuestionId == inDto.QuestionId) - .Where(x=>x.Type== "number") + .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) .OrderBy(x => x.ShowOrder) .Select(x => new GetCalculateTableQuestionsOutDto () @@ -125,6 +125,31 @@ namespace IRaCIS.Application.Services } + /// + /// 获取标准所有表格数值问题 + /// + /// + /// + [HttpPost] + public async Task> GetCalculateAllTableQuestions(GetCalculateQuestionsInDto inDto) + { + + var result = await _readingTableQuestionTrialRepository + + .Where(x => x.TrialCriterionId == inDto.TrialCriterionId) + .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) + .OrderBy(x => x.ShowOrder) + .Select(x => new GetCalculateTableQuestionsOutDto + () + { + TableQuestionId = x.Id, + TableQuestionName = x.QuestionName + + }).ToListAsync(); + + return result; + } + #endregion