diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs index 4fe42154f..8dab5e9b9 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs @@ -147,30 +147,36 @@ namespace IRaCIS.Core.Application.Services #region 切换磁盘存储后 - var physicalPath = string.Empty; + var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path); - //找到所有磁盘 - var drives = DriveInfo.GetDrives() - .Where(d => d.DriveType == DriveType.Fixed && d.IsReady) - //剩余空间最多的 - .OrderByDescending(d => d.AvailableFreeSpace) - - //存储空间相同,则按照按照总空间从大到小排序 - .ThenByDescending(d => d.TotalSize - d.TotalFreeSpace) - .Select(d => d.RootDirectory.FullName) - .ToList(); - - - foreach (var drive in drives) + //不存在,去其他路径找 + if (!File.Exists(physicalPath)) { - physicalPath = Path.Combine(drive, _hostEnvironment.EnvironmentName, path.Trim('/')); + //找到所有磁盘 + var drives = DriveInfo.GetDrives() + .Where(d => d.DriveType == DriveType.Fixed && d.IsReady) + //剩余空间最多的 + .OrderByDescending(d => d.AvailableFreeSpace) - if(File.Exists(physicalPath)) + //存储空间相同,则按照按照总空间从大到小排序 + .ThenByDescending(d => d.TotalSize - d.TotalFreeSpace) + .Select(d => d.RootDirectory.FullName) + .ToList(); + + + foreach (var drive in drives) { - break; + physicalPath = Path.Combine(drive, _hostEnvironment.EnvironmentName, path.Trim('/')); + + if (File.Exists(physicalPath)) + { + break; + } } } + + #endregion