From e9e0e37694d6c0ef4044ad07be0a17472d1f7a2c Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Tue, 6 Dec 2022 10:35:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingImageTaskViewModel.cs | 5 +++++ .../ReadingImageTaskService.cs | 21 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 10e370c2e..3624155e2 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -370,6 +370,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } + public class GetCustomTableQuestionAnswerInDto + { + [NotDefault] + public Guid VisitTaskId { get; set; } + } public class GetReadingTableQuestionOutDto { diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index c9a23723f..0add0e583 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -508,6 +508,27 @@ namespace IRaCIS.Application.Services }); ; } + /// + /// 获取自定义问题以及答案 + /// + /// + /// + [HttpPost] + public async Task<(GetReadingTableQuestionOutDto,bool)> GetCustomTableQuestionAnswer(GetCustomTableQuestionAnswerInDto inDto) + { + + var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); + + var tableAnswers = await _readingTableQuestionAnswerRepository + .ProjectTo(_mapper.ConfigurationProvider) + .Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync(); + + var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + return (await this.GetReadingTableQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id, tableAnswers, tableAnsweRowInfos, true), true); + + } + /// /// 获取表格问题及答案 只返回表格问题(任务和标准) ///