Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
99dd1b6f3d
|
@ -23,6 +23,7 @@ using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using Invio.Extensions.Authentication.JwtBearer;
|
using Invio.Extensions.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using Microsoft.AspNetCore.StaticFiles;
|
||||||
|
|
||||||
namespace IRaCIS.Core.API
|
namespace IRaCIS.Core.API
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
using 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1319,7 +1319,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IsNeedClinicalDataSign = reReadingVisitTask.IsNeedClinicalDataSign,
|
IsNeedClinicalDataSign = reReadingVisitTask.IsNeedClinicalDataSign,
|
||||||
IsClinicalDataSign = reReadingVisitTask.IsClinicalDataSign,
|
IsClinicalDataSign = reReadingVisitTask.IsClinicalDataSign,
|
||||||
BeforeConvertedTaskId = reReadingVisitTask.BeforeConvertedTaskId,
|
BeforeConvertedTaskId = reReadingVisitTask.BeforeConvertedTaskId,
|
||||||
|
ReReadingApplyState= ReReadingApplyState.Default,
|
||||||
// TaskAllocationState = reReadingVisitTask.TaskAllocationState,
|
// TaskAllocationState = reReadingVisitTask.TaskAllocationState,
|
||||||
// AllocateTime = DateTime.Now,
|
// AllocateTime = DateTime.Now,
|
||||||
//DoctorUserId = reReadingVisitTask.DoctorUserId,
|
//DoctorUserId = reReadingVisitTask.DoctorUserId,
|
||||||
|
|
|
@ -1083,10 +1083,6 @@ 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) ?
|
.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)
|
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)
|
.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
|
//满足前序访视不存在 需要签署但是未签署 sql 相当复杂 同时想查询所有未读的统计数字 就无法统计 byzhouhang
|
||||||
|
@ -1115,7 +1111,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
//已读任务量
|
//已读任务量
|
||||||
HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
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) 这样容易排错 确认这三个字段是否维护有误
|
//查出所有未读的 未读的可读的 在这个列表基础上 过滤下 y.IsFrontTaskNeedSignButNotSign==false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true) 这样容易排错 确认这三个字段是否维护有误
|
||||||
UnReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).OrderBy(x => x.VisitTaskNum)
|
UnReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).OrderBy(x => x.VisitTaskNum)
|
||||||
|
|
Loading…
Reference in New Issue