diff --git a/IRC.Core.Dicom/Service/OSSService.cs b/IRC.Core.Dicom/Service/OSSService.cs index 1ac5e80ee..fe6138055 100644 --- a/IRC.Core.Dicom/Service/OSSService.cs +++ b/IRC.Core.Dicom/Service/OSSService.cs @@ -231,8 +231,8 @@ public class OSSService : IOSSService //提供awsEndPoint(域名)进行访问配置 var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); @@ -320,8 +320,8 @@ public class OSSService : IOSSService //提供awsEndPoint(域名)进行访问配置 var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); @@ -397,8 +397,8 @@ public class OSSService : IOSSService //提供awsEndPoint(域名)进行访问配置 var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); @@ -493,8 +493,8 @@ public class OSSService : IOSSService //提供awsEndPoint(域名)进行访问配置 var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); @@ -625,8 +625,8 @@ public class OSSService : IOSSService //提供awsEndPoint(域名)进行访问配置 var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); diff --git a/IRC.Core.SCP/Service/OSSService.cs b/IRC.Core.SCP/Service/OSSService.cs index efea4770a..7657d8c51 100644 --- a/IRC.Core.SCP/Service/OSSService.cs +++ b/IRC.Core.SCP/Service/OSSService.cs @@ -535,8 +535,8 @@ public class OSSService(IOptionsMonitor options, var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region), - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; using var client = new AmazonS3Client(credentials, clientConfig); @@ -715,8 +715,8 @@ public class OSSService(IOptionsMonitor options, //提供awsEndPoint(域名)进行访问配置 var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); @@ -1134,8 +1134,8 @@ public class OSSService(IOptionsMonitor options, var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); @@ -1391,8 +1391,8 @@ public class OSSService(IOptionsMonitor options, var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); diff --git a/IRaCIS.Core.Application/Helper/OSSService.cs b/IRaCIS.Core.Application/Helper/OSSService.cs index 166f810a6..b17bc2615 100644 --- a/IRaCIS.Core.Application/Helper/OSSService.cs +++ b/IRaCIS.Core.Application/Helper/OSSService.cs @@ -537,8 +537,8 @@ public class OSSService(IOptionsMonitor options, var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region), - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; using var client = new AmazonS3Client(credentials, clientConfig); @@ -717,8 +717,8 @@ public class OSSService(IOptionsMonitor options, //提供awsEndPoint(域名)进行访问配置 var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); @@ -1136,8 +1136,8 @@ public class OSSService(IOptionsMonitor options, var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); @@ -1393,8 +1393,8 @@ public class OSSService(IOptionsMonitor options, var clientConfig = new AmazonS3Config { - RegionEndpoint = RegionEndpoint.USEast1, - UseHttp = true, + RegionEndpoint = RegionEndpoint.GetBySystemName(awsConfig.Region) + //,UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); @@ -1860,6 +1860,8 @@ public class OSSService(IOptionsMonitor options, public ObjectStoreDTO GetObjectStoreTempToken(string? domain = null, bool? isGetAllTempToken = null) { + + string objectStoreUse = string.Empty; //如果传递了域名,并且打开了存储同步,根据域名使用的具体存储覆盖之前的配置,否则就用固定的配置 if (ObjectStoreServiceOptions.IsOpenStoreSync && domain.IsNotNullOrEmpty()) { @@ -1868,13 +1870,17 @@ public class OSSService(IOptionsMonitor options, var find = ObjectStoreServiceOptions.SyncConfigList.FirstOrDefault(t => t.Domain == userDomain); if (find != null) { - ObjectStoreServiceOptions.ObjectStoreUse = find.Primary; + objectStoreUse = find.Primary; } } + else + { + objectStoreUse = ObjectStoreServiceOptions.ObjectStoreUse; + } - var objectStoreDTO = new ObjectStoreDTO() { ObjectStoreUse = ObjectStoreServiceOptions.ObjectStoreUse, IsOpenStoreSync = ObjectStoreServiceOptions.IsOpenStoreSync, SyncConfigList = ObjectStoreServiceOptions.SyncConfigList }; + var objectStoreDTO = new ObjectStoreDTO() { ObjectStoreUse = objectStoreUse, IsOpenStoreSync = ObjectStoreServiceOptions.IsOpenStoreSync, SyncConfigList = ObjectStoreServiceOptions.SyncConfigList }; - if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS" || isGetAllTempToken == true) + if (objectStoreUse == "AliyunOSS" || isGetAllTempToken == true) { var ossOptions = ObjectStoreServiceOptions.AliyunOSS; @@ -1922,11 +1928,11 @@ public class OSSService(IOptionsMonitor options, objectStoreDTO.AliyunOSS = tempToken; } - if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO") + if (objectStoreUse == "MinIO") { objectStoreDTO.MinIO = ObjectStoreServiceOptions.MinIO; } - if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS" || isGetAllTempToken == true) + if (objectStoreUse == "AWS" || isGetAllTempToken == true) { var awsOptions = ObjectStoreServiceOptions.AWS; @@ -1972,6 +1978,10 @@ public class OSSService(IOptionsMonitor options, objectStoreDTO.AWS = tempToken; } + if (objectStoreUse.IsNullOrEmpty()) + { + throw new BusinessValidationFailedException("未定义的存储介质类型"); + } return objectStoreDTO; } @@ -2063,10 +2073,6 @@ public class OSSService(IOptionsMonitor options, throw new BusinessValidationFailedException("未定义的同步类型"); } } - catch (Exception ex) - { - Log.Error($"同步错误:{ex.Message}"); - } finally { // ⭐⭐⭐ 真正释放 HTTP 连接 diff --git a/IRaCIS.Core.Application/Service/Common/Export/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/Export/ExcelExportService.cs index 73a1a527a..e6dd8c787 100644 --- a/IRaCIS.Core.Application/Service/Common/Export/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/Export/ExcelExportService.cs @@ -2774,7 +2774,7 @@ namespace IRaCIS.Core.Application.Service.Common { list.Add(new ExportDocumentDes() { Code = StaticData.Export.IVUS_CDISC_Export, ExportCatogory = ExportResult.IVUS_CDISC_Export }); } - if (criterion.CriterionGroup != CriterionGroup.Tumor && criterion.CriterionType != CriterionType.OCT && criterion.CriterionType != CriterionType.IVUS) + if (criterion.CriterionGroup != CriterionGroup.Tumor /*&& criterion.CriterionType != CriterionType.OCT && criterion.CriterionType != CriterionType.IVUS*/) { list.Add(new ExportDocumentDes() { Code = StaticData.Export.CDISC_Reading_Export, ExportCatogory = ExportResult.NoneTumorCDISC }); }