From f1d8324b3aa3e247ac8ed5a70a9f64cd08db720b Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 16 Sep 2022 16:09:40 +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 --- .../IRaCIS.Core.Application.xml | 14 ++++++++++++++ .../Reading/Dto/ReadingImageTaskViewModel.cs | 9 +++++++++ .../Service/Reading/ReadingImageTaskService.cs | 14 ++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index bbfa787a4..c9ab592d5 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -3804,6 +3804,13 @@ + + + 获取报告整体整体评估 + + + + 验证访视提交 @@ -7918,6 +7925,13 @@ + + + 删除系统问题标准 + + + + 新增修改系统问题 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index ace623c7f..b92d17bea 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -917,6 +917,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid VisitTaskId { get; set; } } + + public class TableQuestionData + { + public Guid TableQuestionId { get; set; } + + public int Count { get; set; } + + } + public class SubmitTableQuestionInDto { public Guid QuestionId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index fecda9b19..5d59c85a8 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -1887,7 +1887,21 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task SubmitTableQuestion(SubmitTableQuestionInDto inDto) { + + var tableQuestionIds = inDto.AnswerList.Select(x => x.TableQuestionId).ToList(); + + var tableQuestionIdGroup = tableQuestionIds.GroupBy(x => new { TableQuestionId = x }).Select(x => new TableQuestionData + { + TableQuestionId = x.Key.TableQuestionId, + Count = x.Count() + }).ToList(); + + if (tableQuestionIdGroup.Any(x => x.Count > 1)) + { + throw new BusinessValidationFailedException($"相同问题传入两次!"); + } + var questions = await _readingTableQuestionTrialRepository.Where(x => tableQuestionIds.Contains(x.Id) && x.MaxRowCount != null && x.MaxRowCount != 0).ToListAsync(); foreach (var item in questions)