修改路径
parent
53d29fe79d
commit
0e165a196c
|
@ -296,6 +296,14 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
|
|
||||||
var startTime = DateTime.Now;
|
var startTime = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
|
if (_provider.Exists($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}") && _provider.Get<Guid>($"StudyUid_{trialId}_{studyInstanceUid}").Value == _userInfo.Id)
|
||||||
|
{
|
||||||
|
_provider.Set($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}", _userInfo.Id, TimeSpan.FromMinutes(30));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if (_provider.Exists($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}"))
|
//if (_provider.Exists($"StudyUid_{trialId}_{archiveStudyCommand.StudyInstanceUid}"))
|
||||||
//{
|
//{
|
||||||
// //---当前已有人正在上传和归档该检查!
|
// //---当前已有人正在上传和归档该检查!
|
||||||
|
|
|
@ -59,20 +59,20 @@ namespace IRaCIS.Core.API
|
||||||
|
|
||||||
#region 方式二
|
#region 方式二
|
||||||
|
|
||||||
var defaultFileProvider = new PhysicalFileProvider(iRaCISDefaultDataFolder);
|
//var defaultFileProvider = new PhysicalFileProvider(iRaCISDefaultDataFolder);
|
||||||
|
|
||||||
var staticFileOptions = new StaticFileOptions
|
//var staticFileOptions = new StaticFileOptions
|
||||||
{
|
//{
|
||||||
FileProvider = defaultFileProvider,
|
// FileProvider = defaultFileProvider,
|
||||||
RequestPath = $"/{StaticData.Folder.IRaCISDataFolder}",
|
// RequestPath = $"/{StaticData.Folder.IRaCISDataFolder}",
|
||||||
ServeUnknownFileTypes = true,
|
// ServeUnknownFileTypes = true,
|
||||||
DefaultContentType = "application/octet-stream"
|
// 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);
|
//var staticFileMiddleware = new StaticFileMiddleware(_next, _hostingEnv, Options.Create(staticFileOptions), _loggerFactory);
|
||||||
await staticFileMiddleware.Invoke(context);
|
//await staticFileMiddleware.Invoke(context);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -80,17 +80,18 @@ namespace IRaCIS.Core.API
|
||||||
|
|
||||||
#region 文档上传默认会加wwwroot 奇怪...
|
#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
|
#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)));
|
await context.Response.SendFileAsync( new PhysicalFileInfo(new FileInfo(actrualPath)));
|
||||||
|
|
|
@ -764,6 +764,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
if (_provider.Exists($"StudyUid_{trialId}_{studyInstanceUid}"))
|
if (_provider.Exists($"StudyUid_{trialId}_{studyInstanceUid}"))
|
||||||
{
|
{
|
||||||
|
|
||||||
result.AllowUpload = false;
|
result.AllowUpload = false;
|
||||||
|
|
||||||
result.AllowReUpload = false;
|
result.AllowReUpload = false;
|
||||||
|
@ -829,7 +830,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
{
|
{
|
||||||
lock (lockObj)
|
lock (lockObj)
|
||||||
{
|
{
|
||||||
_provider.Set($"StudyUid_{trialId}_{studyInstanceUid}", _userInfo.Id, TimeSpan.FromMinutes(30));
|
_provider.Set($"StudyUid_{trialId}_{studyInstanceUid}", _userInfo.Id, TimeSpan.FromSeconds(30));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue