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();