From b5e3b22a3eae59fccd4e6d9d7e95cb30ef82523c Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Thu, 14 Jul 2022 16:15:25 +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 | 3 +++ .../Service/Reading/ReadingImageTaskService.cs | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 8e0d6c2d4..d6f2f6df7 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -133,6 +133,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetTrialCriterionJudgeQuestionListInDto { + [NotDefault] + public Guid TrialId { get; set; } + [NotDefault] public Guid ReadingQuestionCriterionTrialId { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 17954d93e..c495d6a70 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -255,9 +255,13 @@ namespace IRaCIS.Application.Services /// /// [HttpPost] - public async Task> GetTrialCriterionJudgeQuestionList(GetTrialCriterionJudgeQuestionListInDto inDto) + public async Task<(List,object)> GetTrialCriterionJudgeQuestionList(GetTrialCriterionJudgeQuestionListInDto inDto) { + var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync(); + var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId && x.IsJudgeQuestion) + .WhereIf(trialCriterion.FormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null) + .WhereIf(trialCriterion.FormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null) .Select(x => new GetTrialCriterionJudgeQuestionListOutDto() { AnswerGroup = JsonConvert.DeserializeObject>(x.AnswerGroup.IsNullOrEmpty()?"[]": x.AnswerGroup), @@ -267,7 +271,17 @@ namespace IRaCIS.Application.Services JudgeType=x.JudgeType, ReadingQuestionTrialId = x.Id }).ToListAsync(); - return result; + + + var signTime = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => x.ReadingInfoSignTime).FirstOrDefaultAsync(); + + return (result, new + { + + IsSign = signTime != null, + + }); + } ///