From 84d08c037878c906e15d81070164df45ccd7e62f Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 15 Sep 2025 17:49:12 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=E6=96=B9=E6=B3=95=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/TestService.cs | 211 ++++++++++++++++++++++++- 1 file changed, 208 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 9b29f6f71..634ad7f0d 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -1,5 +1,6 @@ using Aliyun.OSS; using DocumentFormat.OpenXml.Spreadsheet; +using FellowOakDicom; using FellowOakDicom.Imaging; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.BusinessFilter; @@ -15,7 +16,9 @@ using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Encryption; using IRaCIS.Core.Infrastructure.NewtonsoftJson; using MassTransit; +using MassTransit.Caching.Internals; using MassTransit.Mediator; +using MathNet.Numerics; using MaxMind.GeoIP2; using Medallion.Threading; using Microsoft.AspNetCore.Authorization; @@ -27,18 +30,22 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using MiniExcelLibs; +using Minio.DataModel; using NPOI.SS.Formula.Functions; using NPOI.XWPF.UserModel; using SharpCompress.Common; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp.Processing; +using System.Collections.Concurrent; +using System.Diagnostics; using System.Globalization; using System.Linq.Dynamic.Core; using System.Reactive.Subjects; using System.Reflection.Metadata.Ecma335; using System.Runtime.InteropServices; using System.Text; +using static IRaCIS.Core.Domain.Share.StaticData; @@ -136,7 +143,7 @@ namespace IRaCIS.Core.Application.Service { if (!_readingMedicineSystemQuestion.Any(t => t.CriterionTypeEnum == CriterionType.mRECISTHCC)) { - var list = _readingMedicineSystemQuestion.Where(t => t.CriterionTypeEnum == CriterionType.RECIST1Point1).OrderBy(t=>t.ShowOrder).ToList(); + var list = _readingMedicineSystemQuestion.Where(t => t.CriterionTypeEnum == CriterionType.RECIST1Point1).OrderBy(t => t.ShowOrder).ToList(); var initOrder = 500; foreach (var item in list) @@ -151,10 +158,10 @@ namespace IRaCIS.Core.Application.Service initOrder = initOrder + 1; } - await _readingMedicineSystemQuestion.AddRangeAsync(list,true); + await _readingMedicineSystemQuestion.AddRangeAsync(list, true); } - + return ResponseOutput.Ok(); } @@ -365,6 +372,204 @@ namespace IRaCIS.Core.Application.Service } + [AllowAnonymous] + public async Task RestoreDBOSSDate( + [FromServices] IOSSService _oSSService, [FromServices] IWebHostEnvironment _hostEnvironment, [FromServices] IRepository _studyRepository) + { + var folder = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); + + var outputFile = Path.Combine(folder, $"{Guid.NewGuid()}_deleteKey_info.txt"); + + var outputErrorFile = Path.Combine(folder, $"{Guid.NewGuid()}_deleteKeyerror.txt"); + var outputErrorFile2 = Path.Combine(folder, $"{Guid.NewGuid()}_deleteKeyerrorStudy.txt"); + + + var aliConfig = _oSSService.ObjectStoreServiceOptions.AliyunOSS; + + var tempToken = _oSSService.GetObjectStoreTempToken(); + + var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, + tempToken.AliyunOSS.AccessKeyId, + tempToken.AliyunOSS.AccessKeySecret, + tempToken.AliyunOSS.SecurityToken); + + + var allVersions = new List(); + var allDeleteMarkers = new List(); + + var request = new ListObjectVersionsRequest(tempToken.AliyunOSS.BucketName) + { + Prefix = "01000000-ac13-0242-6397-08dcd2d2a091/Image", + //Prefix = "01000000-ac13-0242-6397-08dcd2d2a091/Image/08dd9c04-c1b2-c2da-0242-ac1301000000/01000000-ac13-0242-235b-08dd9c04c1b3", + MaxKeys = 1000, + }; + + ObjectVersionList result; + do + { + + //var tt = _ossClient.ListObjects(new Aliyun.OSS.ListObjectsRequest(aliConfig.BucketName) + //{ + // Prefix = "01000000-ac13-0242-6397-08dcd2d2a091/Image/08dd9c04-c1b2-c2da-0242-ac1301000000/01000000-ac13-0242-235b-08dd9c04c1b3", // 根目录,留空即可 + // MaxKeys = 100, + //}); + + result = _ossClient.ListObjectVersions(request); + + if (result.ObjectVersionSummaries != null) + allVersions.AddRange(result.ObjectVersionSummaries); + + if (result.DeleteMarkerSummaries != null) + allDeleteMarkers.AddRange(result.DeleteMarkerSummaries); + + request.KeyMarker = result.NextKeyMarker; + request.VersionIdMarker = result.NextVersionIdMarker; + + } while (result.IsTruncated); + + Console.WriteLine($"共找到 {allDeleteMarkers.Count} 个删除标记"); + + + + int total = allDeleteMarkers.Count; + + int processed = 0; + double lastPercent = 0; + + + // 按 Key 分组,找每个删除标记前的最近版本 + var versionsByKey = allVersions + .GroupBy(v => v.Key) + .ToDictionary(g => g.Key, g => g.OrderByDescending(x => x.LastModified).ToList()); + + foreach (var del in allDeleteMarkers) + { + #region 防止阿里云过期 + if (tempToken.AliyunOSS.Expiration.AddSeconds(10) <= DateTime.Now) + { + tempToken = _oSSService.GetObjectStoreTempToken(); + + _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, + tempToken.AliyunOSS.AccessKeyId, + tempToken.AliyunOSS.AccessKeySecret, + tempToken.AliyunOSS.SecurityToken); + } + + #endregion + + if (!versionsByKey.TryGetValue(del.Key, out var versions)) + continue; // 没有历史版本无法恢复 + + var prevVersion = versions.FirstOrDefault(v => v.LastModified < del.LastModified); + if (prevVersion == null) + continue; // 没找到可恢复版本 + + + var localPath = Path.Combine(folder, prevVersion.Key.Trim('/').Replace('/', Path.DirectorySeparatorChar)); + Directory.CreateDirectory(Path.GetDirectoryName(localPath)); + + + try + { + await File.AppendAllTextAsync(outputFile, $"{prevVersion.Key},{prevVersion.VersionId}" + Environment.NewLine); + + var getReq = new GetObjectRequest(tempToken.AliyunOSS.BucketName, prevVersion.Key) + { + VersionId = prevVersion.VersionId + }; + + using (var getResult = _ossClient.GetObject(getReq)) + using (var memStream = new MemoryStream()) + { + // 先把 OSS 流复制到内存流 + getResult.Content.CopyTo(memStream); + memStream.Position = 0; + + // 读取 DICOM 信息 + var dicomFile = DicomFile.Open(memStream); + var studyInstanceUID = dicomFile.Dataset.GetString(DicomTag.StudyInstanceUID); + + var findInfo = await _studyRepository.Where(t => t.StudyInstanceUid == studyInstanceUID && t.TrialId == Guid.Parse("01000000-ac13-0242-6397-08dcd2d2a091")) + .Select(t => new { t.StudyInstanceUid, t.Subject.Code, t.SubjectVisit.VisitName }).FirstOrDefaultAsync(); + + if (findInfo != null) + { + + // 再保存到另一个路径(可以使用 fo-dicom 保存) + var anotherPath = Path.Combine(folder, findInfo.Code, findInfo.VisitName, studyInstanceUID); + Directory.CreateDirectory(Path.GetDirectoryName(anotherPath)); + dicomFile.Save(anotherPath); + } + else + { + await File.AppendAllTextAsync(outputErrorFile2, $"{studyInstanceUID},{prevVersion.Key},{prevVersion.VersionId}" + Environment.NewLine); + } + + Console.WriteLine($"读取到 studyInstanceUID: {studyInstanceUID}"); + + // 保存到原本路径 + memStream.Position = 0; + using (var fs = File.Create(localPath)) + { + memStream.CopyTo(fs); + } + + + } + + + + Console.WriteLine($"✅ 下载成功: {prevVersion.Key} (version={prevVersion.VersionId})"); + } + catch (Exception ex) + { + Console.WriteLine($"❌ 下载失败: {prevVersion.Key}, 错误: {ex.Message}"); + + await File.AppendAllTextAsync(outputErrorFile, $"{prevVersion.Key},{prevVersion.VersionId}" + Environment.NewLine); + } + finally + { + processed++; + double percent = processed * 100.0 / total; + + // 每提升 5% 或完成时输出 + if (percent - lastPercent >= 2.0 || processed == total) + { + lastPercent = percent; + Console.WriteLine($"{DateTime.Now} 进度: {processed}/{total} ({percent:F2}%)"); + } + } + + + // 使用 CopyObject 把历史版本拷贝为最新版本(恢复) + //var copyReq = new CopyObjectRequest + //{ + // Bucket = bucketName, + // Key = prevVersion.Key, + // SourceBucket = bucketName, + // SourceKey = prevVersion.Key, + // SourceVersionId = prevVersion.VersionId + //}; + + //try + //{ + // var copyResult = client.CopyObject(copyReq); + // Console.WriteLine($"✅ 恢复成功: {prevVersion.Key} -> newVersionId={copyResult.VersionId}"); + //} + //catch (Exception ex) + //{ + // Console.WriteLine($"❌ 恢复失败: {prevVersion.Key}, 错误: {ex.Message}"); + //} + } + + + + return ResponseOutput.Ok(); + } + + + + [AllowAnonymous] public async Task UserCreateSourceDeal([FromServices] IRepository _identityUserRepository, [FromServices] IRepository _trialUserRoleRepository) From 84349c19e7851dce4b1e6d51f57b26b78b0bcfca Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 16 Sep 2025 10:18:16 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/TestService.cs | 142 +++++++++++++++++++++---- 1 file changed, 123 insertions(+), 19 deletions(-) diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 634ad7f0d..08f48d8af 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -379,6 +379,7 @@ namespace IRaCIS.Core.Application.Service var folder = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); var outputFile = Path.Combine(folder, $"{Guid.NewGuid()}_deleteKey_info.txt"); + var outputFile2 = Path.Combine(folder, $"{Guid.NewGuid()}_deleteKeyExport_info.txt"); var outputErrorFile = Path.Combine(folder, $"{Guid.NewGuid()}_deleteKeyerror.txt"); var outputErrorFile2 = Path.Combine(folder, $"{Guid.NewGuid()}_deleteKeyerrorStudy.txt"); @@ -408,12 +409,6 @@ namespace IRaCIS.Core.Application.Service do { - //var tt = _ossClient.ListObjects(new Aliyun.OSS.ListObjectsRequest(aliConfig.BucketName) - //{ - // Prefix = "01000000-ac13-0242-6397-08dcd2d2a091/Image/08dd9c04-c1b2-c2da-0242-ac1301000000/01000000-ac13-0242-235b-08dd9c04c1b3", // 根目录,留空即可 - // MaxKeys = 100, - //}); - result = _ossClient.ListObjectVersions(request); if (result.ObjectVersionSummaries != null) @@ -465,9 +460,7 @@ namespace IRaCIS.Core.Application.Service continue; // 没找到可恢复版本 - var localPath = Path.Combine(folder, prevVersion.Key.Trim('/').Replace('/', Path.DirectorySeparatorChar)); - Directory.CreateDirectory(Path.GetDirectoryName(localPath)); - + try { @@ -490,36 +483,44 @@ namespace IRaCIS.Core.Application.Service var studyInstanceUID = dicomFile.Dataset.GetString(DicomTag.StudyInstanceUID); var findInfo = await _studyRepository.Where(t => t.StudyInstanceUid == studyInstanceUID && t.TrialId == Guid.Parse("01000000-ac13-0242-6397-08dcd2d2a091")) - .Select(t => new { t.StudyInstanceUid, t.Subject.Code, t.SubjectVisit.VisitName }).FirstOrDefaultAsync(); + .Select(t => new { t.StudyInstanceUid, t.Subject.Code, t.SubjectVisit.VisitName, t.SubjectId, t.SubjectVisitId }).FirstOrDefaultAsync(); if (findInfo != null) { // 再保存到另一个路径(可以使用 fo-dicom 保存) - var anotherPath = Path.Combine(folder, findInfo.Code, findInfo.VisitName, studyInstanceUID); + + var fileName = Path.GetFileNameWithoutExtension(prevVersion.Key); + var anotherPath = Path.Combine(folder, findInfo.Code, findInfo.VisitName, studyInstanceUID, fileName); + // 去掉 folder 部分,得到相对路径 + var relativePath = Path.GetRelativePath(folder, anotherPath); Directory.CreateDirectory(Path.GetDirectoryName(anotherPath)); dicomFile.Save(anotherPath); + + await File.AppendAllTextAsync(outputFile2, $"{findInfo.SubjectId},{findInfo.SubjectVisitId},{prevVersion.Key},{prevVersion.VersionId},{relativePath},{findInfo.Code},{findInfo.VisitName},{findInfo.StudyInstanceUid},{fileName}" + Environment.NewLine); } else { await File.AppendAllTextAsync(outputErrorFile2, $"{studyInstanceUID},{prevVersion.Key},{prevVersion.VersionId}" + Environment.NewLine); } - Console.WriteLine($"读取到 studyInstanceUID: {studyInstanceUID}"); + //Console.WriteLine($"读取到 studyInstanceUID: {studyInstanceUID}"); - // 保存到原本路径 - memStream.Position = 0; - using (var fs = File.Create(localPath)) - { - memStream.CopyTo(fs); - } + //var localPath = Path.Combine(folder, prevVersion.Key.Trim('/').Replace('/', Path.DirectorySeparatorChar)); + //Directory.CreateDirectory(Path.GetDirectoryName(localPath)); + //// 保存到原本路径 + //memStream.Position = 0; + //using (var fs = File.Create(localPath)) + //{ + // memStream.CopyTo(fs); + //} } - Console.WriteLine($"✅ 下载成功: {prevVersion.Key} (version={prevVersion.VersionId})"); + //Console.WriteLine($"✅ 下载成功: {prevVersion.Key} (version={prevVersion.VersionId})"); } catch (Exception ex) { @@ -569,6 +570,109 @@ namespace IRaCIS.Core.Application.Service + public async Task OSSDeleteReStorre([FromServices] IOSSService _oSSService, [FromServices] IWebHostEnvironment _hostEnvironment) + { + var aliConfig = _oSSService.ObjectStoreServiceOptions.AliyunOSS; + + var tempToken = _oSSService.GetObjectStoreTempToken(); + + var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, + tempToken.AliyunOSS.AccessKeyId, + tempToken.AliyunOSS.AccessKeySecret, + tempToken.AliyunOSS.SecurityToken); + + + var allVersions = new List(); + var allDeleteMarkers = new List(); + + var request = new ListObjectVersionsRequest(tempToken.AliyunOSS.BucketName) + { + Prefix = "test-delete-restore", + //Prefix = "01000000-ac13-0242-6397-08dcd2d2a091/Image/08dd9c04-c1b2-c2da-0242-ac1301000000/01000000-ac13-0242-235b-08dd9c04c1b3", + MaxKeys = 1000, + }; + + ObjectVersionList result; + do + { + + result = _ossClient.ListObjectVersions(request); + + if (result.ObjectVersionSummaries != null) + allVersions.AddRange(result.ObjectVersionSummaries); + + if (result.DeleteMarkerSummaries != null) + allDeleteMarkers.AddRange(result.DeleteMarkerSummaries); + + request.KeyMarker = result.NextKeyMarker; + request.VersionIdMarker = result.NextVersionIdMarker; + + } while (result.IsTruncated); + + Console.WriteLine($"共找到 {allDeleteMarkers.Count} 个删除标记"); + + var versionsByKey = allVersions + .GroupBy(v => v.Key) + .ToDictionary(g => g.Key, g => g.OrderByDescending(x => x.LastModified).ToList()); + + + foreach (var del in allDeleteMarkers) + { + #region 防止阿里云过期 + if (tempToken.AliyunOSS.Expiration.AddSeconds(10) <= DateTime.Now) + { + tempToken = _oSSService.GetObjectStoreTempToken(); + + _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, + tempToken.AliyunOSS.AccessKeyId, + tempToken.AliyunOSS.AccessKeySecret, + tempToken.AliyunOSS.SecurityToken); + } + + #endregion + + if (!versionsByKey.TryGetValue(del.Key, out var versions)) + continue; // 没有历史版本无法恢复 + + var prevVersion = versions.FirstOrDefault(v => v.LastModified < del.LastModified); + if (prevVersion == null) + continue; // 没找到可恢复版本 + + + + + // 创建 CopyObject 请求 + // 先用构造函数指定源和目标 + var copyReq = new CopyObjectRequest( + sourceBucketName: tempToken.AliyunOSS.BucketName, + sourceKey: prevVersion.Key, + destinationBucketName: tempToken.AliyunOSS.BucketName, + destinationKey: prevVersion.Key // 覆盖到同名 Key,达到“恢复”的效果 + ); + + // 再设置版本号 + copyReq.SourceVersionId = prevVersion.VersionId; + + + + try + { + var copyResult = _ossClient.CopyObject(copyReq); + Console.WriteLine($"✅ 恢复成功: {prevVersion.Key}, 新版本ID={copyResult.VersionId}"); + } + catch (Exception ex) + { + Console.WriteLine($"❌ 恢复失败: {prevVersion.Key}, 错误: {ex.Message}"); + } + + + } + + return ResponseOutput.Ok(); + + + } + [AllowAnonymous] public async Task UserCreateSourceDeal([FromServices] IRepository _identityUserRepository, From b115dd525378d2548bd98962be4acad4545190ea Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 16 Sep 2025 10:35:22 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E9=9D=9Edicom=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/TestService.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 08f48d8af..bce8743b1 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -459,12 +459,15 @@ namespace IRaCIS.Core.Application.Service if (prevVersion == null) continue; // 没找到可恢复版本 + if (Path.GetExtension(prevVersion.Key).IsNotNullOrEmpty()) + { + continue;//不是dicom 文件 + } - try { - await File.AppendAllTextAsync(outputFile, $"{prevVersion.Key},{prevVersion.VersionId}" + Environment.NewLine); + //await File.AppendAllTextAsync(outputFile, $"{prevVersion.Key},{prevVersion.VersionId}" + Environment.NewLine); var getReq = new GetObjectRequest(tempToken.AliyunOSS.BucketName, prevVersion.Key) { From 4b011ee727649e652e0bfbdea14ff0ea06127334 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 16 Sep 2025 14:07:35 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/appsettings.Event_IRC.json | 10 +++++----- IRaCIS.Core.Application/IRaCIS.Core.Application.xml | 2 +- .../Service/ImageAndDoc/DownloadAndUploadService.cs | 7 +++++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.API/appsettings.Event_IRC.json b/IRaCIS.Core.API/appsettings.Event_IRC.json index 0fdcbc7d4..392b55d49 100644 --- a/IRaCIS.Core.API/appsettings.Event_IRC.json +++ b/IRaCIS.Core.API/appsettings.Event_IRC.json @@ -16,11 +16,11 @@ "RegionId": "cn-shanghai", "InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", "EndPoint": "https://oss-cn-shanghai.aliyuncs.com", - "AccessKeyId": "LTAI5tNRTsqL6aWmHkDmTwoH", - "AccessKeySecret": "7mtGz3qrYWI6JMMBZiLeC119VWicZH", - "RoleArn": "acs:ram::1899121822495495:role/irc-oss-access", - "BucketName": "zy-irc-store", - "ViewEndpoint": "https://zy-irc-cache.oss-cn-shanghai.aliyuncs.com", + "AccessKeyId": "LTAI5tFUCCmz5TwghZHsj45Y", + "AccessKeySecret": "8evrBy1fVfzJG25i67Jm0xqn9Xcw2T", + "RoleArn": "acs:ram::1078130221702011:role/uat-oss-access", + "BucketName": "tl-med-irc-event-store", + "ViewEndpoint": "https://tl-med-irc-event-store.oss-cn-shanghai.aliyuncs.com", "Region": "oss-cn-shanghai", "DurationSeconds": 7200 }, diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index e1b06291f..9e041e0e6 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -5395,7 +5395,7 @@ - 修改上一次访视结果 并且计算是不是PD + 修改上一次访视结果 diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index 7e185716c..d858c96f1 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -986,6 +986,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc subjectCode = inQuery.SubjectCode; } + //下载这里查看也需要维护编号,维护的时候不会处理一致性分析任务 + if (inQuery.SubjectId != null && inQuery.TrialReadingCriterionId != null) + { + await SubejctRandomReadingTaskNameDeal((Guid)subjectId, inQuery.TrialReadingCriterionId); + } + + TaskState? taskState = null; if (inQuery.VisitTaskId != null) {