diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index 872135d04..5d0f6bef5 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -23,6 +23,7 @@ using IRaCIS.Core.Infra.EFCore.Common; using Invio.Extensions.Authentication.JwtBearer; using Microsoft.AspNetCore.SignalR; using IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.StaticFiles; namespace IRaCIS.Core.API { @@ -208,7 +209,7 @@ namespace IRaCIS.Core.API app.UseStatusCodePagesWithReExecute("/Error/{0}"); SwaggerSetup.Configure(app, env); - + ////serilog 记录请求的用户信息 diff --git a/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFileStoreConfig.cs b/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/IRacisHostFileStoreConfig.cs similarity index 100% rename from IRaCIS.Core.API/_PipelineExtensions/IRacisHostFileStoreConfig.cs rename to IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/IRacisHostFileStoreConfig.cs diff --git a/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs b/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs new file mode 100644 index 000000000..25780b5c2 --- /dev/null +++ b/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs @@ -0,0 +1,91 @@ +锘縰sing IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.StaticFiles; +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.FileProviders.Physical; +using Microsoft.Extensions.Hosting.Internal; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using Microsoft.VisualBasic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; + +namespace IRaCIS.Core.API +{ + + + public class MultiDiskStaticFilesMiddleware + { + private readonly RequestDelegate _next; + private readonly IWebHostEnvironment _hostingEnv; + private readonly StaticFileOptions _options; + private readonly ILoggerFactory _loggerFactory; + + public MultiDiskStaticFilesMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, StaticFileOptions options, ILoggerFactory loggerFactory) + { + _next = next; + _hostingEnv = hostingEnv; + _options = options; + _loggerFactory = loggerFactory; + } + + public async Task Invoke(HttpContext context) + { + var path = context.Request.Path.Value; + var isIRacisFile = path.StartsWith($"/{StaticData.Folder.IRaCISDataFolder}"); + + var isDicomFile = path.Contains($"{StaticData.Folder.DicomFolder}"); + + var isFind = false; + if (isIRacisFile) + { + + } + if (isDicomFile) + { + + } + + + + // 濡傛灉鎵鏈夌鐩橀兘涓嶅瓨鍦ㄦ墍璇锋眰鐨勬枃浠讹紝鍒欏皢璇锋眰浼犻掔粰涓嬩竴涓腑闂翠欢缁勪欢銆 + await _next.Invoke(context); + } + + private async Task ServeFileAsync(HttpContext context, IFileInfo fileInfo) + { + var response = context.Response; + response.ContentType = GetContentType(fileInfo.PhysicalPath); + + using (var fileStream = fileInfo.CreateReadStream()) + { + await fileStream.CopyToAsync(response.Body); + } + } + + private string[] GetDisks() + { + // 鑾峰彇绯荤粺涓墍鏈夊彲鐢ㄧ殑纾佺洏 + return DriveInfo.GetDrives() + .Where(d => d.IsReady && d.DriveType == DriveType.Fixed) + .Select(d => d.RootDirectory.FullName) + .ToArray(); + } + + private static string GetContentType(string path) + { + var provider = new FileExtensionContentTypeProvider(); + if (!provider.TryGetContentType(path, out var contentType)) + { + contentType = "application/octet-stream"; + } + + return contentType; + } + } + + +} diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 2141ea56c..9c893806a 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -1319,7 +1319,7 @@ namespace IRaCIS.Core.Application.Service IsNeedClinicalDataSign = reReadingVisitTask.IsNeedClinicalDataSign, IsClinicalDataSign = reReadingVisitTask.IsClinicalDataSign, BeforeConvertedTaskId = reReadingVisitTask.BeforeConvertedTaskId, - + ReReadingApplyState= ReReadingApplyState.Default, // TaskAllocationState = reReadingVisitTask.TaskAllocationState, // AllocateTime = DateTime.Now, //DoctorUserId = reReadingVisitTask.DoctorUserId, diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 30e292169..285b7832b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1083,11 +1083,7 @@ namespace IRaCIS.Core.Application.Service.Allocation .WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.ImageFilterState != ImageFilterState.Finished) ? t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Min(t => t.SubjectVisit.VisitNum) : true) - .Where(t => t.TrialReadingCriterion.IsAutoCreate == false && t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.ImageFilterState != ImageFilterState.Finished) ? - t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Min(t => t.SubjectVisit.VisitNum) : true) - - - + .Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true) //婊¤冻鍓嶅簭璁胯涓嶅瓨鍦 闇瑕佺缃蹭絾鏄湭绛剧讲 sql 鐩稿綋澶嶆潅 鍚屾椂鎯虫煡璇㈡墍鏈夋湭璇荤殑缁熻鏁板瓧 灏辨棤娉曠粺璁 byzhouhang //浣嗘槸鍔犲瓧娈 IsFrontTaskNeedSignButNotSign 閭d箞绛惧悕涓村簥鏁版嵁鐨勬椂鍊欙紝瑕佸璇ubject 璇ユ爣鍑嗙殑鏈夋晥鐨勪换鍔 杩欎釜瀛楁闇瑕佸湪绛惧悕鐨勬椂鍊欑淮鎶 閲囧彇杩欑鏂瑰紡 缁熻鏁板瓧鐏垫椿 @@ -1115,7 +1111,7 @@ namespace IRaCIS.Core.Application.Service.Allocation //宸茶浠诲姟閲 HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(), - ExistReadingApply = x.Any(y => y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || y.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed), + ExistReadingApply = x.Any(y => (y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed && y.TrialReadingCriterionId == trialReadingCriterionId) || y.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed), //鏌ュ嚭鎵鏈夋湭璇荤殑 鏈鐨勫彲璇荤殑 鍦ㄨ繖涓垪琛ㄥ熀纭涓 杩囨护涓 y.IsFrontTaskNeedSignButNotSign==false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true) 杩欐牱瀹规槗鎺掗敊 纭杩欎笁涓瓧娈垫槸鍚︾淮鎶ゆ湁璇 UnReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).OrderBy(x => x.VisitTaskNum)