修改配置文件
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
e38a3e5f53
commit
558ed48874
|
@ -14,7 +14,7 @@
|
|||
|
||||
"ObjectStoreService": {
|
||||
|
||||
"ObjectStoreUse": "AliyunOSS",
|
||||
"ObjectStoreUse": "MinIO",
|
||||
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
|
|
|
@ -84,17 +84,16 @@
|
|||
<param name="type"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSS(System.IO.Stream,System.String,System.String)">
|
||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.IO.Stream,System.String,System.String)">
|
||||
<summary>
|
||||
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||
</summary>
|
||||
<param name="fileStream"></param>
|
||||
<param name="oosFolderPath"></param>
|
||||
<param name="fileRealName"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSS(System.String,System.String)">
|
||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSSAsync(System.String,System.String)">
|
||||
<summary>
|
||||
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||
</summary>
|
||||
|
@ -1023,6 +1022,11 @@
|
|||
阅读片人
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.RoleName">
|
||||
<summary>
|
||||
角色
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.IsSign">
|
||||
<summary>
|
||||
是否有签名
|
||||
|
@ -13927,12 +13931,6 @@
|
|||
<param name="outEnrollTime"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.TestService.OldLocalImageResizeJpg(IRaCIS.Core.Application.Helper.IOSSService,IRaCIS.Core.Infra.EFCore.IRepository,Microsoft.AspNetCore.Hosting.IWebHostEnvironment)">
|
||||
<summary>
|
||||
维护OSS 影像数据
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.TestService.ModifyClinicalDataTable">
|
||||
<summary>
|
||||
维护临床数据 --一定要在同步表前同步数据才行
|
||||
|
|
|
@ -69,80 +69,6 @@ namespace IRaCIS.Application.Services
|
|||
//_cache = cache;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 维护OSS 影像数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> OldLocalImageResizeJpg([FromServices] IOSSService oSSService, [FromServices] IRepository _repository, [FromServices] IWebHostEnvironment _hostEnvironment)
|
||||
{
|
||||
|
||||
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
|
||||
var studyList = _repository.Where<DicomStudy>(t => t.SeriesList.Any(t => t.ImageResizePath.Length < 10)).Select(t => new { t.TrialId, t.SiteId, t.SubjectId, t.SubjectVisitId, t.Id }).ToList();
|
||||
|
||||
foreach (var studyitem in studyList)
|
||||
{
|
||||
|
||||
var relativePath = $"{studyitem.TrialId}/{studyitem.SiteId}/{studyitem.SubjectId}/{studyitem.SubjectVisitId}/{StaticData.Folder.DicomFolder}/{studyitem.Id}/";
|
||||
|
||||
try
|
||||
{
|
||||
string nextMarker = null;
|
||||
do
|
||||
{
|
||||
// 使用 prefix 模拟目录结构,设置 MaxKeys 和 NextMarker
|
||||
var objectListing = oSSService._ossClient.ListObjects(new ListObjectsRequest(oSSService._OSSConfig.bucketName)
|
||||
{
|
||||
Prefix = relativePath,
|
||||
MaxKeys = 1000,
|
||||
Marker = nextMarker
|
||||
});
|
||||
|
||||
var jpgInfoList = objectListing.ObjectSummaries
|
||||
.Where(summary => summary.Key.EndsWith(".jpg"))
|
||||
.Select(summary =>
|
||||
{
|
||||
string fileName = summary.Key.Split('/').Last(); // 提取文件夹名
|
||||
return new
|
||||
{
|
||||
|
||||
Key = summary.Key,
|
||||
InstanceId = Guid.TryParse(
|
||||
fileName.Split('.')[0],
|
||||
out Guid instanceId)
|
||||
? instanceId
|
||||
: Guid.Empty
|
||||
};
|
||||
})
|
||||
.Where(info => info.InstanceId != Guid.Empty)
|
||||
.ToList();
|
||||
|
||||
foreach (var jpg in jpgInfoList)
|
||||
{
|
||||
var seriesId = _repository.Where<DicomInstance>(t => t.Id == jpg.InstanceId).Select(t => t.SeriesId).FirstOrDefault();
|
||||
|
||||
await _repository.BatchUpdateAsync<DicomSeries>(t => t.Id == seriesId, t => new DicomSeries() { ImageResizePath = "/" + jpg.Key });
|
||||
}
|
||||
|
||||
// 设置 NextMarker 以获取下一页的数据
|
||||
nextMarker = objectListing.NextMarker;
|
||||
|
||||
} while (!string.IsNullOrEmpty(nextMarker));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error: {ex.Message}");
|
||||
}
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
public async Task<IResponseOutput> TestEFcore8()
|
||||
|
@ -160,26 +86,14 @@ namespace IRaCIS.Application.Services
|
|||
// 设置 Ne
|
||||
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> TestMinIO([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||
public async Task<IResponseOutput> TestMinIO([FromServices] IOSSService oSSService)
|
||||
{
|
||||
|
||||
await _repository.BatchUpdateAsync<Subject>(t => t.Id == Guid.Empty, t => new Subject() { Id = Guid.Empty });
|
||||
await oSSService.UploadToOSSAsync("C:\\Users\\Administrator\\Desktop\\TrialSiteUserImportTemplate.xlsx", "myfolder");
|
||||
|
||||
var minIO = options.CurrentValue.MinIO;
|
||||
await oSSService.DownLoadFromOSSAsync("myfolder/TrialSiteUserImportTemplate.xlsx", "C:\\Users\\Administrator\\Desktop\\TrialSiteUserImportTemplateoss.xlsx");
|
||||
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIO.endpoint}:{minIO.port}")
|
||||
.WithCredentials(minIO.accessKey, minIO.secretKey).WithSSL(false)
|
||||
.Build();
|
||||
|
||||
var putObjectArgs = new PutObjectArgs()
|
||||
.WithBucket(minIO.bucketName)
|
||||
.WithObject("myfolder/test.txt")
|
||||
.WithFileName("C:\\Users\\Administrator\\Desktop\\TrialSiteUserImportTemplate.xlsx");
|
||||
|
||||
await minioClient.PutObjectAsync(putObjectArgs);
|
||||
|
||||
return await Task.FromResult<IResponseOutput>(ResponseOutput.Ok(options));
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
|
@ -310,24 +224,6 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
|
||||
private static Dictionary<string, string> _replacePatterns = new Dictionary<string, string>()
|
||||
{
|
||||
{ "test", "Atlanta Knight" },
|
||||
{ "GAME_TIME", "7:30pm" },
|
||||
{ "GAME_NUMBER", "161" },
|
||||
{ "DATE", "October 18 2018" },
|
||||
};
|
||||
|
||||
private static string ReplaceFunc(string findStr)
|
||||
{
|
||||
if (_replacePatterns.ContainsKey(findStr))
|
||||
{
|
||||
return _replacePatterns[findStr];
|
||||
}
|
||||
return findStr;
|
||||
}
|
||||
|
||||
|
||||
[AllowAnonymous]
|
||||
public async Task testwwwww([FromServices] IWebHostEnvironment env)
|
||||
{
|
||||
|
@ -433,11 +329,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
|
||||
public string PostData(TestModel testModelList)
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
#region 历史维护
|
||||
/// <summary>
|
||||
/// 维护临床数据 --一定要在同步表前同步数据才行
|
||||
/// </summary>
|
||||
|
@ -477,6 +369,86 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 维护OSS 影像数据
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[AllowAnonymous]
|
||||
//[UnitOfWork]
|
||||
//public async Task<IResponseOutput> OldLocalImageResizeJpg([FromServices] IOSSService oSSService, [FromServices] IRepository _repository, [FromServices] IWebHostEnvironment _hostEnvironment)
|
||||
//{
|
||||
|
||||
// var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
|
||||
// var studyList = _repository.Where<DicomStudy>(t => t.SeriesList.Any(t => t.ImageResizePath.Length < 10)).Select(t => new { t.TrialId, t.SiteId, t.SubjectId, t.SubjectVisitId, t.Id }).ToList();
|
||||
|
||||
// foreach (var studyitem in studyList)
|
||||
// {
|
||||
|
||||
// var relativePath = $"{studyitem.TrialId}/{studyitem.SiteId}/{studyitem.SubjectId}/{studyitem.SubjectVisitId}/{StaticData.Folder.DicomFolder}/{studyitem.Id}/";
|
||||
|
||||
// try
|
||||
// {
|
||||
// string nextMarker = null;
|
||||
// do
|
||||
// {
|
||||
// // 使用 prefix 模拟目录结构,设置 MaxKeys 和 NextMarker
|
||||
// var objectListing = oSSService._ossClient.ListObjects(new ListObjectsRequest(oSSService._OSSConfig.bucketName)
|
||||
// {
|
||||
// Prefix = relativePath,
|
||||
// MaxKeys = 1000,
|
||||
// Marker = nextMarker
|
||||
// });
|
||||
|
||||
// var jpgInfoList = objectListing.ObjectSummaries
|
||||
// .Where(summary => summary.Key.EndsWith(".jpg"))
|
||||
// .Select(summary =>
|
||||
// {
|
||||
// string fileName = summary.Key.Split('/').Last(); // 提取文件夹名
|
||||
// return new
|
||||
// {
|
||||
|
||||
// Key = summary.Key,
|
||||
// InstanceId = Guid.TryParse(
|
||||
// fileName.Split('.')[0],
|
||||
// out Guid instanceId)
|
||||
// ? instanceId
|
||||
// : Guid.Empty
|
||||
// };
|
||||
// })
|
||||
// .Where(info => info.InstanceId != Guid.Empty)
|
||||
// .ToList();
|
||||
|
||||
// foreach (var jpg in jpgInfoList)
|
||||
// {
|
||||
// var seriesId = _repository.Where<DicomInstance>(t => t.Id == jpg.InstanceId).Select(t => t.SeriesId).FirstOrDefault();
|
||||
|
||||
// await _repository.BatchUpdateAsync<DicomSeries>(t => t.Id == seriesId, t => new DicomSeries() { ImageResizePath = "/" + jpg.Key });
|
||||
// }
|
||||
|
||||
// // 设置 NextMarker 以获取下一页的数据
|
||||
// nextMarker = objectListing.NextMarker;
|
||||
|
||||
// } while (!string.IsNullOrEmpty(nextMarker));
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Console.WriteLine($"Error: {ex.Message}");
|
||||
// }
|
||||
|
||||
// await _repository.SaveChangesAsync();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// return ResponseOutput.Ok();
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class TestModel
|
||||
|
|
Loading…
Reference in New Issue