From 0d8626509c6412ccff480a37464c160af6044d37 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 24 Apr 2026 14:01:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BA=E5=AE=9A=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 7 +++- .../Service/ImageAndDoc/StudyService.cs | 34 +++++++++++++------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 51a75e0b2..22d408412 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -15353,7 +15353,7 @@ - + 分割 @@ -15447,6 +15447,11 @@ + + + 递归清除依赖此问题的计算问题答案 + + 快捷键服务 diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index c30f36659..b45106a0f 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -112,12 +112,24 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc var prefix = path.Substring(1, path.LastIndexOf('/') - 1); //每次都用一个新的名字 - var maskFileName = $"{Path.GetFileName(path)}.{batchId}_MaskDicom"; + var maskFileName = string.Empty; - if (path.Contains("_MaskDicom")) + if (path.Contains(".MaskDicom_")) { //清理缓存的里面的遮盖图,多次遮盖同一张图时,清除缓存很重要 await _oSSService.DeleteFromPrefix(path, true); //清理缓存的里面的遮盖图,多次遮盖同一张图时,清除缓存很重要 + + //本身就是遮盖的图,那么就要要替换guid + var length = Guid.Empty.ToString().Length + ".MaskDicom_".Length ; + + var restorePath = item.Path[..^length]; + + maskFileName = $"{Path.GetFileName(restorePath)}.MaskDicom_{batchId}"; + } + else + { + //没有遮盖的,直接加上.批次_MaskDicom + maskFileName = $"{Path.GetFileName(path)}.MaskDicom_{batchId}"; } await _oSSService.UploadToOSSAsync(outPutStream, prefix, maskFileName, false); @@ -174,11 +186,11 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc foreach (var item in idPathList) { - if (item.Path.EndsWith("_MaskDicom")) + if (item.Path.Contains(".MaskDicom_")) { await _oSSService.DeleteFromPrefix(item.Path, true); - var length = Guid.Empty.ToString().Length + "_MaskDicom".Length + 1; + var length = Guid.Empty.ToString().Length + ".MaskDicom_".Length; var newPath = item.Path[..^length]; okList.Add(new InstanceIdPath() { Id = item.Id, Path = newPath }); @@ -186,16 +198,16 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc await _dicomInstanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new DicomInstance() { Path = newPath, IsMasked = false }); } - if (item.Path.EndsWith(".")) - { - await _oSSService.DeleteFromPrefix(item.Path, true); + //if (item.Path.EndsWith(".")) + //{ + // await _oSSService.DeleteFromPrefix(item.Path, true); - var newPath = item.Path[..^1]; + // var newPath = item.Path[..^1]; - okList.Add(new InstanceIdPath() { Id = item.Id, Path = newPath }); + // okList.Add(new InstanceIdPath() { Id = item.Id, Path = newPath }); - await _dicomInstanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new DicomInstance() { Path = newPath, IsMasked = false }); - } + // await _dicomInstanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new DicomInstance() { Path = newPath, IsMasked = false }); + //} }