修改存储路径
							parent
							
								
									72d84b18d4
								
							
						
					
					
						commit
						b5f09e9774
					
				| 
						 | 
					@ -197,7 +197,7 @@ namespace IRaCIS.Core.API.Controllers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void DealCommonStorePath(/*string fileType, string moduleType,*/ string fileRealName, out string serverFilePath, out string relativePath)
 | 
					        private void DealCommonStorePath(/*string fileType, string moduleType,*/ string fileRealName, out string serverFilePath, out string relativePath)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).FullName;
 | 
					            var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment) ;
 | 
				
			||||||
            //上传根路径
 | 
					            //上传根路径
 | 
				
			||||||
            var _fileStorePath = Path.Combine(rootPath, StaticData.SystemDataFolder);
 | 
					            var _fileStorePath = Path.Combine(rootPath, StaticData.SystemDataFolder);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -218,7 +218,7 @@ namespace IRaCIS.Core.API.Controllers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void DealSystemNoticePath(string fileRealName, out string serverFilePath, out string relativePath)
 | 
					        private void DealSystemNoticePath(string fileRealName, out string serverFilePath, out string relativePath)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).FullName;
 | 
					            var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
 | 
				
			||||||
            //上传根路径
 | 
					            //上传根路径
 | 
				
			||||||
            var _fileStorePath = Path.Combine(rootPath, StaticData.SystemDataFolder);
 | 
					            var _fileStorePath = Path.Combine(rootPath, StaticData.SystemDataFolder);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -239,7 +239,7 @@ namespace IRaCIS.Core.API.Controllers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void DealSysTemStorePath(  string fileRealName,  out string serverFilePath, out string relativePath)
 | 
					        private void DealSysTemStorePath(  string fileRealName,  out string serverFilePath, out string relativePath)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).FullName;
 | 
					            var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
 | 
				
			||||||
            //上传根路径
 | 
					            //上传根路径
 | 
				
			||||||
            var _fileStorePath = Path.Combine(rootPath, StaticData.SystemDataFolder);
 | 
					            var _fileStorePath = Path.Combine(rootPath, StaticData.SystemDataFolder);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -261,7 +261,7 @@ namespace IRaCIS.Core.API.Controllers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void DealTrialStorePath(Guid trialId,string fileRealName,  out string serverFilePath, out string relativePath)
 | 
					        private void DealTrialStorePath(Guid trialId,string fileRealName,  out string serverFilePath, out string relativePath)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).FullName;
 | 
					            var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
 | 
				
			||||||
            //上传根路径
 | 
					            //上传根路径
 | 
				
			||||||
            var _fileStorePath = Path.Combine(rootPath, StaticData.TrialDataFolder);
 | 
					            var _fileStorePath = Path.Combine(rootPath, StaticData.TrialDataFolder);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -334,7 +334,7 @@ namespace IRaCIS.Core.API.Controllers
 | 
				
			||||||
        private  void DealStorePath(Guid subjectVisitId, string realName, UploadFileTypeEnum typeEnum, out string serverFilePath, out string relativePath, IRepository<SubjectVisit> _subjectVisitRepository)
 | 
					        private  void DealStorePath(Guid subjectVisitId, string realName, UploadFileTypeEnum typeEnum, out string serverFilePath, out string relativePath, IRepository<SubjectVisit> _subjectVisitRepository)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).FullName;
 | 
					            var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //上传根路径
 | 
					            //上传根路径
 | 
				
			||||||
            var _fileStorePath = Path.Combine(rootPath, StaticData.TrialDataFolder);
 | 
					            var _fileStorePath = Path.Combine(rootPath, StaticData.TrialDataFolder);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,8 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using IRaCIS.Core.Domain.Share;
 | 
				
			||||||
 | 
					using Microsoft.AspNetCore.Hosting;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace IRaCIS.Core.Application.Helper;
 | 
					namespace IRaCIS.Core.Application.Helper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public static class FileStoreHelper
 | 
					public static class FileStoreHelper
 | 
				
			||||||
| 
						 | 
					@ -25,5 +28,18 @@ public static class FileStoreHelper
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return (trustedFileNameForFileStorage, fileName);
 | 
					        return (trustedFileNameForFileStorage, fileName);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static  string GetIRaCISRootDataFolder(IWebHostEnvironment _hostEnvironment)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        var root = (Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))).IfNullThrowException().FullName;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        var rootFolder =Path.Combine(root, StaticData.IRaCISDataFolder)    ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return rootFolder;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Hosting;
 | 
				
			||||||
using Microsoft.Extensions.Logging;
 | 
					using Microsoft.Extensions.Logging;
 | 
				
			||||||
using IRaCIS.Core.Domain.Share;
 | 
					using IRaCIS.Core.Domain.Share;
 | 
				
			||||||
using IRaCIS.Core.Infrastructure.Extention;
 | 
					using IRaCIS.Core.Infrastructure.Extention;
 | 
				
			||||||
 | 
					using IRaCIS.Core.Application.Helper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace IRaCIS.Core.Application
 | 
					namespace IRaCIS.Core.Application
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -20,10 +21,10 @@ namespace IRaCIS.Core.Application
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _logger = logger;
 | 
					            _logger = logger;
 | 
				
			||||||
            _hostEnvironment = hostEnvironment;
 | 
					            _hostEnvironment = hostEnvironment;
 | 
				
			||||||
            var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName;
 | 
					            var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //上传根路径
 | 
					            //上传根路径
 | 
				
			||||||
             _fileStorePath = Path.Combine(rootPath, StaticData.TrialDataFolder);
 | 
					            _fileStorePath = Path.Combine(rootPath, StaticData.TrialDataFolder);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -58,7 +58,7 @@ namespace IRaCIS.Core.Application.Contracts
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            await QCCommonVerify.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);  
 | 
					            await QCCommonVerify.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName;
 | 
					            var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //上传根路径
 | 
					            //上传根路径
 | 
				
			||||||
            var _fileStorePath = Path.Combine(rootPath, StaticData.TrialDataFolder);
 | 
					            var _fileStorePath = Path.Combine(rootPath, StaticData.TrialDataFolder);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -187,7 +187,7 @@ namespace IRaCIS.Core.Application.Contracts
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            await QCCommonVerify.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);
 | 
					            await QCCommonVerify.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName;
 | 
					            var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //上传根路径
 | 
					            //上传根路径
 | 
				
			||||||
            var _fileStorePath = Path.Combine(rootPath, StaticData.TrialDataFolder);
 | 
					            var _fileStorePath = Path.Combine(rootPath, StaticData.TrialDataFolder);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue