From 697018962ddf97610073de8052936a8099863886 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 26 Sep 2022 09:55: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 --- .../Service/Reading/ReadingImageTaskService.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 66bcbf086..012d13440 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -281,7 +281,14 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task DeleteReadingRowAnswer(DeleteReadingRowAnswerInDto inDto) { - var deleteRowIndex = inDto.RowIndex; + + var deleteRowInfo=await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == inDto.RowIndex && x.QuestionId == inDto.QuestionId).FirstNotNullAsync(); + + if(await _readingTableAnswerRowInfoRepository.AnyAsync(x=>x.SplitRowId== deleteRowInfo.Id&&x.MergeRowId==deleteRowInfo.Id)) + { + throw new BusinessValidationFailedException($"当前病灶分裂出其他病灶或者其他病灶合并到了当前病灶,删除失败"); + } + await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == inDto.RowIndex && x.QuestionId == inDto.QuestionId); await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == inDto.RowIndex && x.QuestionId == inDto.QuestionId); await _readingTableAnswerRowInfoRepository.SaveChangesAsync();