From 2854acf1461830e14401d87fce73d27d9a4b01e5 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 18 May 2023 14:32:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=90=8E=E4=B8=8D=E8=83=BD=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MultiDiskStaticFilesMiddleware.cs | 34 +++++++++++++++---- .../Service/Allocation/VisitTaskService.cs | 2 -- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs b/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs index 053b8d48d..19df10ddf 100644 --- a/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs +++ b/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs @@ -54,7 +54,12 @@ namespace IRaCIS.Core.API //先从默认里面去找 if (isIRacisFile) { - var defaultFileProvider = new PhysicalFileProvider(FileStoreHelper.GetIRaCISRootPath(_hostingEnv)); + + + + #region 方式二 + + var defaultFileProvider = new PhysicalFileProvider(iRaCISDefaultDataFolder); var staticFileOptions = new StaticFileOptions { @@ -64,15 +69,30 @@ namespace IRaCIS.Core.API DefaultContentType = "application/octet-stream" }; - if (defaultFileProvider.GetFileInfo(context.Request.Path).Exists) - { + var a = defaultFileProvider.GetFileInfo(context.Request.Path).Exists; - var actrualPath = defaultFileProvider.GetFileInfo(context.Request.Path).PhysicalPath; + var staticFileMiddleware = new StaticFileMiddleware(_next, _hostingEnv, Options.Create(staticFileOptions), _loggerFactory); + await staticFileMiddleware.Invoke(context); - await context.Response.SendFileAsync(new PhysicalFileInfo(new FileInfo(actrualPath))); + #endregion + + + + #region 文档上传默认会加wwwroot 奇怪... + + //var defaultFileProvider = new PhysicalFileProvider(FileStoreHelper.GetIRaCISRootPath(_hostingEnv)); + + //if (defaultFileProvider.GetFileInfo(path.Trim('/')).Exists) + //{ + + // var actrualPath = defaultFileProvider.GetFileInfo(context.Request.Path).PhysicalPath; + + // await context.Response.SendFileAsync(new PhysicalFileInfo(new FileInfo(actrualPath))); + + // return; + //} + #endregion - return; - } } //没找到 diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 557dc6e88..25ed7197a 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1526,7 +1526,6 @@ namespace IRaCIS.Core.Application.Service.Allocation var criterionConfig = await _trialReadingCriterionRepository.Where(x => x.Id == origenalTask.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.CriterionType, x.IsAdditionalAssessment, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync(); - //更新申请信息 var visitTaskReReadingAppply = await _visitTaskReReadingRepository.FirstOrDefaultAsync(t => t.Id == item.Id); visitTaskReReadingAppply.RequestReReadingConfirmUserId = _userInfo.Id; @@ -1754,7 +1753,6 @@ namespace IRaCIS.Core.Application.Service.Allocation #endregion - //有序阅片 if (criterionConfig.IsReadingTaskViewInOrder) { From 0e165a196cba81c57f6666df31782980fe87e780 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 18 May 2023 15:09:46 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/UploadDownLoadController.cs | 8 ++++ .../MultiDiskStaticFilesMiddleware.cs | 41 ++++++++++--------- .../Service/ImageAndDoc/StudyService.cs | 3 +- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index f56dc38d2..0a4a2ca26 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -296,6 +296,14 @@ namespace IRaCIS.Core.API.Controllers var startTime = DateTime.Now; + + if (_provider.Exists($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}") && _provider.Get($"StudyUid_{trialId}_{studyInstanceUid}").Value == _userInfo.Id) + { + _provider.Set($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}", _userInfo.Id, TimeSpan.FromMinutes(30)); + } + + + //if (_provider.Exists($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}")) //{ // //---当前已有人正在上传和归档该检查! diff --git a/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs b/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs index 19df10ddf..d45350482 100644 --- a/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs +++ b/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs @@ -59,20 +59,20 @@ namespace IRaCIS.Core.API #region 方式二 - var defaultFileProvider = new PhysicalFileProvider(iRaCISDefaultDataFolder); + //var defaultFileProvider = new PhysicalFileProvider(iRaCISDefaultDataFolder); - var staticFileOptions = new StaticFileOptions - { - FileProvider = defaultFileProvider, - RequestPath = $"/{StaticData.Folder.IRaCISDataFolder}", - ServeUnknownFileTypes = true, - DefaultContentType = "application/octet-stream" - }; + //var staticFileOptions = new StaticFileOptions + //{ + // FileProvider = defaultFileProvider, + // RequestPath = $"/{StaticData.Folder.IRaCISDataFolder}", + // ServeUnknownFileTypes = true, + // DefaultContentType = "application/octet-stream" + //}; - var a = defaultFileProvider.GetFileInfo(context.Request.Path).Exists; + //var a = defaultFileProvider.GetFileInfo(context.Request.Path).Exists; - var staticFileMiddleware = new StaticFileMiddleware(_next, _hostingEnv, Options.Create(staticFileOptions), _loggerFactory); - await staticFileMiddleware.Invoke(context); + //var staticFileMiddleware = new StaticFileMiddleware(_next, _hostingEnv, Options.Create(staticFileOptions), _loggerFactory); + //await staticFileMiddleware.Invoke(context); #endregion @@ -80,17 +80,18 @@ namespace IRaCIS.Core.API #region 文档上传默认会加wwwroot 奇怪... - //var defaultFileProvider = new PhysicalFileProvider(FileStoreHelper.GetIRaCISRootPath(_hostingEnv)); + var defaultFileProvider = new PhysicalFileProvider(FileStoreHelper.GetIRaCISRootPath(_hostingEnv)); - //if (defaultFileProvider.GetFileInfo(path.Trim('/')).Exists) - //{ + if (defaultFileProvider.GetFileInfo(path).Exists) + { - // var actrualPath = defaultFileProvider.GetFileInfo(context.Request.Path).PhysicalPath; + var actrualPath = defaultFileProvider.GetFileInfo(path).PhysicalPath; + var actrualPath2 = defaultFileProvider.GetFileInfo(path).PhysicalPath; - // await context.Response.SendFileAsync(new PhysicalFileInfo(new FileInfo(actrualPath))); + await context.Response.SendFileAsync(new PhysicalFileInfo(new FileInfo(actrualPath))); - // return; - //} + return; + } #endregion } @@ -122,10 +123,10 @@ namespace IRaCIS.Core.API - if (otherFileProvider.GetFileInfo(context.Request.Path).Exists) + if (otherFileProvider.GetFileInfo(path).Exists) { - var actrualPath = otherFileProvider.GetFileInfo(context.Request.Path).PhysicalPath; + var actrualPath = otherFileProvider.GetFileInfo(path).PhysicalPath; //方式一 await context.Response.SendFileAsync( new PhysicalFileInfo(new FileInfo(actrualPath))); diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 8e1d4c253..2d37728a0 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -764,6 +764,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc if (_provider.Exists($"StudyUid_{trialId}_{studyInstanceUid}")) { + result.AllowUpload = false; result.AllowReUpload = false; @@ -829,7 +830,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc { lock (lockObj) { - _provider.Set($"StudyUid_{trialId}_{studyInstanceUid}", _userInfo.Id, TimeSpan.FromMinutes(30)); + _provider.Set($"StudyUid_{trialId}_{studyInstanceUid}", _userInfo.Id, TimeSpan.FromSeconds(30)); } } From a754a4fcc638a7081c99150f62854cb7fb7f9f92 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 18 May 2023 15:27:05 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=85=81=E8=AE=B8=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs index 3d473fa80..42c9c3a71 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs @@ -280,7 +280,7 @@ namespace IRaCIS.Core.Application.Contracts public string AcquisitionNumber { get; set; } = string.Empty; public string TriggerTime { get; set; } = string.Empty; - public string IamgeResizePath { get; set; } + public string IamgeResizePath { get; set; }=string.Empty; public List InstanceList { get; set; } From 0c29fcb9bdb02770c77668224320d8da4fdccd86 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 18 May 2023 15:39:05 +0800 Subject: [PATCH 4/4] x --- IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 2d37728a0..ad5b16994 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -276,7 +276,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc else { //该序列掉了instance - dicomSeries.InstanceCount += seriesItem.InstanceCount; + dicomSeries.InstanceCount += seriesItem.InstanceList.Count; } dicomSeries.IamgeResizePath = seriesItem.IamgeResizePath; @@ -298,7 +298,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc // 不管是新的序列 还是 该序列 掉了Instance 重传的时候 检查的instance 数量都会增加 - study.InstanceCount += seriesItem.InstanceCount; + study.InstanceCount += seriesItem.InstanceList.Count; }