diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 636c02fd1..40b753eef 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -92,7 +92,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc idPathList = await _dicomInstanceRepository.Where(t => t.SeriesId == inCommand.SeriesId).Select(t => new InstanceIdPath { Id = t.Id, Path = t.Path }).ToListAsync(); } - var errorPathList = new List(); + var errorList = new List(); + + var okList = new List(); var batchId = Guid.NewGuid(); @@ -116,16 +118,19 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc //清理缓存的里面的遮盖图,多次遮盖同一张图时,清除缓存很重要 await _oSSService.DeleteFromPrefix(path, true); //清理缓存的里面的遮盖图,多次遮盖同一张图时,清除缓存很重要 } - + await _oSSService.UploadToOSSAsync(outPutStream, prefix, maskFileName, false); var newPath = $"/{prefix}/{maskFileName}"; + okList.Add(new InstanceIdPath() { Id = item.Id, Path = newPath }); + await _dicomInstanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new DicomInstance() { Path = newPath, IsMasked = true }); } catch (Exception ex) { - errorPathList.Add(path); + + errorList.Add(new InstanceIdPath() { Id = item.Id, Path = path }); Log.Logger.Error(ex, $"StudyMaskImage Error for InstanceIdList Path:{path} {ex.Message}"); } @@ -134,7 +139,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc await _dicomInstanceRepository.SaveChangesAsync(); - return ResponseOutput.Ok(errorPathList); + return ResponseOutput.Ok(new { OkList = okList, ErrorList = errorList }); }