影像上传增加文件大小
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2024-08-26 15:35:02 +08:00
parent 1778d45481
commit 0acb7ca987
13 changed files with 26 additions and 10 deletions

View File

@ -301,7 +301,7 @@ namespace IRaCIS.Core.SCP.Service
{ {
try try
{ {
var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.Dataset, _trialId, _trialSiteId, storeRelativePath, Association.CallingAE, Association.CalledAE); var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.Dataset, _trialId, _trialSiteId, storeRelativePath, Association.CallingAE, Association.CalledAE,fileSize);
if (!_SCPStudyIdList.Contains(scpStudyId)) if (!_SCPStudyIdList.Contains(scpStudyId))
{ {

View File

@ -12,6 +12,7 @@ using IRaCIS.Core.SCP.Service;
using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infra.EFCore;
using MassTransit; using MassTransit;
using System.Runtime.Intrinsics.X86; using System.Runtime.Intrinsics.X86;
using Serilog.Sinks.File;
namespace IRaCIS.Core.SCP.Service namespace IRaCIS.Core.SCP.Service
{ {
@ -51,7 +52,7 @@ namespace IRaCIS.Core.SCP.Service
/// <param name="dataset"></param> /// <param name="dataset"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public async Task<Guid> ArchiveDicomFileAsync(DicomDataset dataset, Guid trialId, Guid trialSiteId, string fileRelativePath, string callingAE, string calledAE) public async Task<Guid> ArchiveDicomFileAsync(DicomDataset dataset, Guid trialId, Guid trialSiteId, string fileRelativePath, string callingAE, string calledAE,long fileSize)
{ {
string studyInstanceUid = dataset.GetString(DicomTag.StudyInstanceUID); string studyInstanceUid = dataset.GetString(DicomTag.StudyInstanceUID);
string seriesInstanceUid = dataset.GetString(DicomTag.SeriesInstanceUID); string seriesInstanceUid = dataset.GetString(DicomTag.SeriesInstanceUID);
@ -270,7 +271,10 @@ namespace IRaCIS.Core.SCP.Service
WindowCenter = dataset.GetSingleValueOrDefault(DicomTag.WindowCenter, string.Empty), WindowCenter = dataset.GetSingleValueOrDefault(DicomTag.WindowCenter, string.Empty),
WindowWidth = dataset.GetSingleValueOrDefault(DicomTag.WindowWidth, string.Empty), WindowWidth = dataset.GetSingleValueOrDefault(DicomTag.WindowWidth, string.Empty),
Path = fileRelativePath Path = fileRelativePath,
FileSize= fileSize,
}; };
++findStudy.InstanceCount; ++findStudy.InstanceCount;
@ -300,7 +304,7 @@ namespace IRaCIS.Core.SCP.Service
} }
else else
{ {
await _instanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == instanceId, u => new SCPInstance() { Path = fileRelativePath }); await _instanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == instanceId, u => new SCPInstance() { Path = fileRelativePath,FileSize=fileSize });
} }
//await _studyRepository.SaveChangesAsync(); //await _studyRepository.SaveChangesAsync();

View File

@ -5,7 +5,7 @@ namespace IRaCIS.Core.SCP.Service
{ {
public interface IDicomArchiveService public interface IDicomArchiveService
{ {
Task<Guid> ArchiveDicomFileAsync(DicomDataset dicomDataset,Guid trialId,Guid trialSiteId, string fileRelativePath,string callingAE,string calledAE); Task<Guid> ArchiveDicomFileAsync(DicomDataset dicomDataset,Guid trialId,Guid trialSiteId, string fileRelativePath,string callingAE,string calledAE,long fileSize);
} }
} }

View File

@ -368,7 +368,7 @@ namespace IRaCIS.Core.API.Controllers
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_RequestError"]); throw new BusinessValidationFailedException(_localizer["UploadDownLoad_RequestError"]);
} }
studyMonitor.FileSize = (decimal)HttpContext.Request.ContentLength; studyMonitor.FileSize = (long)HttpContext.Request.ContentLength;
studyMonitor.FileCount = archiveResult.ReceivedFileCount; studyMonitor.FileCount = archiveResult.ReceivedFileCount;
studyMonitor.FailedFileCount = archiveResult.ErrorFiles.Count; studyMonitor.FailedFileCount = archiveResult.ErrorFiles.Count;
studyMonitor.IsDicomReUpload = archiveStudyCommand.AbandonStudyId != null; studyMonitor.IsDicomReUpload = archiveStudyCommand.AbandonStudyId != null;
@ -471,7 +471,7 @@ namespace IRaCIS.Core.API.Controllers
foreach (var item in incommand.UploadedFileList) foreach (var item in incommand.UploadedFileList)
{ {
await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId,FileType=item.FileType }); await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId,FileType=item.FileType,FileSize=item.FileFize });
} }
var uploadFinishedTime = DateTime.Now; var uploadFinishedTime = DateTime.Now;

View File

@ -184,7 +184,7 @@ namespace IRaCIS.Core.Application.Contracts
[NotDefault] [NotDefault]
public Guid SubjectVisitId { get; set; } public Guid SubjectVisitId { get; set; }
public decimal FileSize { get; set; } public long FileSize { get; set; }
public bool IsDicomReUpload { get; set; } public bool IsDicomReUpload { get; set; }
@ -206,7 +206,7 @@ namespace IRaCIS.Core.Application.Contracts
public Guid SubjectVisitId { get; set; } public Guid SubjectVisitId { get; set; }
public decimal FileSize { get; set; } public long FileSize { get; set; }
public bool IsDicomReUpload { get; set; } public bool IsDicomReUpload { get; set; }
@ -360,5 +360,7 @@ namespace IRaCIS.Core.Application.Contracts
public string Path { get; set; } = string.Empty; public string Path { get; set; } = string.Empty;
public string HtmlPath { get; set; } = string.Empty; public string HtmlPath { get; set; } = string.Empty;
public decimal FileFize { get; set; }
} }
} }

View File

@ -53,5 +53,7 @@ namespace IRaCIS.Core.Domain.Models
public string HtmlPath { get; set; }=string.Empty; public string HtmlPath { get; set; }=string.Empty;
public long? FileSize { get; set; }
} }
} }

View File

@ -93,6 +93,8 @@ namespace IRaCIS.Core.Domain.Models
public bool IsFromPACS { get; set; } public bool IsFromPACS { get; set; }
} }
} }

View File

@ -61,7 +61,7 @@ namespace IRaCIS.Core.Domain.Models
public int FailedFileCount { get; set; } public int FailedFileCount { get; set; }
public decimal FileSize { get; set; } public long FileSize { get; set; }
public string IP { get; set; } public string IP { get; set; }

View File

@ -31,6 +31,8 @@ namespace IRaCIS.Core.Domain.Models
public string FileType { get; set; } public string FileType { get; set; }
public decimal? FileSize { get; set; }
} }
} }

View File

@ -46,6 +46,8 @@ namespace IRaCIS.Core.Domain.Models
public bool Anonymize { get; set; } public bool Anonymize { get; set; }
public string Path { get; set; } = string.Empty; public string Path { get; set; } = string.Empty;
public long? FileSize { get; set; }
} }

View File

@ -52,5 +52,7 @@ namespace IRaCIS.Core.Domain.Models
public string HtmlPath { get; set; }=string.Empty; public string HtmlPath { get; set; }=string.Empty;
public long? FileSize { get; set; }
} }
} }