diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 5c0b28030..f7fbea8cc 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -100,6 +100,26 @@ namespace IRaCIS.Core.Application.Service var taskid = mark.VisitTaskId; await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.RowId == mark.RowId && x.TableQuestionId == mark.TableQuestionId); await _readingTaskQuestionMarkRepository.DeleteFromQueryAsync(x => x.Id == inDto.Id); + + + await _readingTaskQuestionMarkRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new ReadingTaskQuestionMark() + { + InstanceId=null, + SeriesId = null, + StudyId = null, + MarkTool = string.Empty, + PicturePath = string.Empty, + NumberOfFrames = null, + MeasureData = string.Empty, + OrderMarkName = string.Empty, + OtherInstanceId = null, + OtherSeriesId = null, + OtherStudyId = null, + OtherMarkTool = string.Empty, + OtherPicturePath = string.Empty, + OtherNumberOfFrames = null, + OtherMeasureData = string.Empty, + }); var result= await _readingTaskQuestionMarkRepository.SaveChangesAsync(); await _readingCalculateService.CalculateTask(new CalculateTaskInDto() @@ -122,7 +142,24 @@ namespace IRaCIS.Core.Application.Service [Route("/DeleteTableQuestionMark/{param}")] public async Task DeleteTableQuestionMark(DeleteTableQuestionMarkInDto inDto, string param) { - await _readingTaskQuestionMarkRepository.DeleteFromQueryAsync(x => x.RowId == inDto.RowId); + await _readingTaskQuestionMarkRepository.UpdatePartialFromQueryAsync(x => x.RowId == inDto.RowId, x => new ReadingTaskQuestionMark() + { + InstanceId = null, + SeriesId = null, + StudyId = null, + MarkTool = string.Empty, + PicturePath = string.Empty, + NumberOfFrames = null, + MeasureData = string.Empty, + OrderMarkName = string.Empty, + OtherInstanceId = null, + OtherSeriesId = null, + OtherStudyId = null, + OtherMarkTool = string.Empty, + OtherPicturePath = string.Empty, + OtherNumberOfFrames = null, + OtherMeasureData = string.Empty, + }); return await _readingTaskQuestionMarkRepository.SaveChangesAsync(); } @@ -137,7 +174,6 @@ namespace IRaCIS.Core.Application.Service [Route("/SaveTableQuestionMark/{param}")] public async Task SaveTableQuestionMark(SaveTableQuestionMarkInDto inDto, string param) { - inDto.FristAddTaskId = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == inDto.TableQuestionId && x.RowId == inDto.RowId).Select(x => x.FristAddTaskId).FirstOrDefaultAsync(); inDto.FristAddTaskId = inDto.FristAddTaskId == null ? inDto.VisitTaskId : inDto.FristAddTaskId; var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();