@@ -18,6 +18,7 @@ using Minio.DataModel.Args;
|
||||
using Minio.Exceptions;
|
||||
using System.Reactive.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Web;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper;
|
||||
|
||||
@@ -1022,9 +1023,10 @@ public class OSSService : IOSSService
|
||||
|
||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, AliyunOSSTempToken.AccessKeyId, AliyunOSSTempToken.AccessKeySecret, AliyunOSSTempToken.SecurityToken);
|
||||
|
||||
var metadata = _ossClient.GetObjectMetadata(aliConfig.BucketName, objectkey);
|
||||
var key = HttpUtility.UrlDecode(objectkey);
|
||||
var metadata = _ossClient.GetObjectMetadata(aliConfig.BucketName, key);
|
||||
|
||||
long fileSize = metadata.ContentLength; // 文件大小(字节)
|
||||
long fileSize = metadata?.ContentLength??0; // 文件大小(字节)
|
||||
|
||||
return fileSize;
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
[FromServices] IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository,
|
||||
[FromServices] IRepository<ReadingClinicalDataPDF> _readingClinicalDataPDFRepository)
|
||||
{
|
||||
var noneDicomList = _noneDicomStudyFileRepository.Where(t => t.FileSize == 0 || t.FileSize == null).Select(t => new { t.Path, t.Id }).ToList();
|
||||
var noneDicomList = _noneDicomStudyFileRepository/*.Where(t=>t.NoneDicomStudy.TrialId==Guid.Parse("01000000-ac13-0242-3ae4-08dc9b0495c6"))*/.Where(t => t.FileSize == 0 || t.FileSize == null).Select(t => new { t.Path, t.Id }).ToList();
|
||||
|
||||
var clinicalDataPDFList = _readingClinicalDataPDFRepository.Where(t => t.Size == 0).Select(t => new { t.Path, t.Id }).ToList();
|
||||
|
||||
@@ -409,9 +409,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
await _noneDicomStudyFileRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new NoneDicomStudyFile() { FileSize = fileSize });
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Console.WriteLine(item.Path+" : " + ex.Message);
|
||||
}
|
||||
|
||||
|
||||
@@ -427,9 +427,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
await _readingClinicalDataPDFRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new ReadingClinicalDataPDF() { Size = (int)fileSize });
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Console.WriteLine(item.Path + " : " + ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user