不压缩打包
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
parent
45db942f66
commit
9b6ddb0f16
|
|
@ -157,6 +157,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
public class DownloadJob
|
public class DownloadJob
|
||||||
{
|
{
|
||||||
|
public bool IsZip { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -367,7 +368,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
foreach (var noneDicomStudy in visitItem.NoneDicomStudyList)
|
foreach (var noneDicomStudy in visitItem.NoneDicomStudyList)
|
||||||
{
|
{
|
||||||
string studyNoneDicomFolderPath = Path.Combine(trialFolderPath, $"{visitItem.SubjectCode}_{visitItem.VisitName}", $"{noneDicomStudy.StudyCode}_{noneDicomStudy.ImageDate.ToString("yyyy-MM-dd")}_{noneDicomStudy.Modality}");
|
string studyNoneDicomFolderPath = Path.Combine(trialFolderPath, $"{visitItem.SubjectCode}_{visitItem.VisitName.Trim()}", $"{noneDicomStudy.StudyCode}_{noneDicomStudy.ImageDate.ToString("yyyy-MM-dd")}_{noneDicomStudy.Modality}");
|
||||||
|
|
||||||
Directory.CreateDirectory(studyNoneDicomFolderPath);
|
Directory.CreateDirectory(studyNoneDicomFolderPath);
|
||||||
|
|
||||||
|
|
@ -376,7 +377,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
string destinationPath = Path.Combine(studyNoneDicomFolderPath, Path.GetFileName(file.FileName));
|
string destinationPath = Path.Combine(studyNoneDicomFolderPath, Path.GetFileName(file.FileName));
|
||||||
|
|
||||||
//加入到下载任务里
|
//加入到下载任务里
|
||||||
downloadJobs.Add(new DownloadJob() { Name = $"{visitItem.SubjectCode}_{visitItem.VisitNum}_{visitItem.VisitName}_NoneDICOM_{destinationPath}", Action = () => _oSSService.DownLoadFromOSSAsync(HttpUtility.UrlDecode(file.Path), destinationPath) });
|
downloadJobs.Add(new DownloadJob() { Name = $"{visitItem.SubjectCode}_{visitItem.VisitNum}_{visitItem.VisitName.Trim()}_NoneDICOM_{destinationPath}", Action = () => _oSSService.DownLoadFromOSSAsync(HttpUtility.UrlDecode(file.Path), destinationPath) });
|
||||||
|
|
||||||
//下载到当前目录
|
//下载到当前目录
|
||||||
//await _oSSService.DownLoadFromOSSAsync(HttpUtility.UrlDecode(file.Path), destinationPath);
|
//await _oSSService.DownLoadFromOSSAsync(HttpUtility.UrlDecode(file.Path), destinationPath);
|
||||||
|
|
@ -391,6 +392,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
Name = $"{visitItem.SubjectCode}_{visitItem.VisitName.Trim()}_Zip",
|
Name = $"{visitItem.SubjectCode}_{visitItem.VisitName.Trim()}_Zip",
|
||||||
|
|
||||||
|
IsZip = true,
|
||||||
|
|
||||||
Action = async () =>
|
Action = async () =>
|
||||||
{
|
{
|
||||||
string zipPath = visitFolderPath + ".zip";
|
string zipPath = visitFolderPath + ".zip";
|
||||||
|
|
@ -403,7 +406,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
ZipFile.CreateFromDirectory(
|
ZipFile.CreateFromDirectory(
|
||||||
visitFolderPath,
|
visitFolderPath,
|
||||||
zipPath,
|
zipPath,
|
||||||
CompressionLevel.Fastest,
|
CompressionLevel.NoCompression,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
Directory.Delete(visitFolderPath, true);
|
Directory.Delete(visitFolderPath, true);
|
||||||
|
|
@ -439,7 +442,18 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await job.Action();
|
if (job.IsZip == false)
|
||||||
|
{
|
||||||
|
await job.Action();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_ = Task.Run(async () =>
|
||||||
|
{
|
||||||
|
await job.Action();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue