From b5af2d62eee34c765a5f373bada98bd8df1ba2d1 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 23 Sep 2022 17:35:01 +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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 5a38a2b52..bf5da5a3a 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -117,7 +117,7 @@ namespace IRaCIS.Application.Services public async Task SplitLesion(SplitLesionInDto inDto) { await this.VerifyIsBaseLineTask(inDto.VisitTaskId); - var rowAnswer = await _readingTableAnswerRowInfoRepository.Where(x =>x.Id==inDto.RowId).FirstNotNullAsync(); + var rowAnswer = await _readingTableAnswerRowInfoRepository.Where(x =>x.Id==inDto.RowId).AsNoTracking().FirstNotNullAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == rowAnswer.RowIndex && x.QuestionId == inDto.QuestionId).Include(x=>x.ReadingTableQuestionTrial).ToListAsync(); var maxRowIndex = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId&&x.RowIndex< Math.Floor(rowAnswer.RowIndex+1)).OrderByDescending(x => x.RowIndex).Select(x => x.RowIndex).FirstOrDefaultAsync(); var newRowIndex = maxRowIndex + (decimal)0.01; @@ -139,7 +139,9 @@ namespace IRaCIS.Application.Services x.Id = NewId.NextGuid(); x.RowIndex = newRowIndex; x.VisitTaskId = inDto.VisitTaskId; + x.RowId = rowAnswer.Id; x.Answer = needRemoveMark.Contains(x.ReadingTableQuestionTrial.QuestionMark) ? string.Empty : x.Answer; + x.ReadingTableQuestionTrial = null; }); await _readingTableAnswerRowInfoRepository.AddAsync(rowAnswer); await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);