diff --git a/IRaCIS.Core.API/Controllers/UploadController.cs b/IRaCIS.Core.API/Controllers/UploadController.cs index 95397fab..2c6e322d 100644 --- a/IRaCIS.Core.API/Controllers/UploadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadController.cs @@ -206,7 +206,6 @@ namespace IRaCIS.Core.API.Controllers if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath); - var (trustedFileNameForFileStorage, fileName) = FileStoreHelper.GetStoreFileName(fileRealName); diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index 19390e0c..2b18ccbc 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -22,6 +22,7 @@ using IRaCIS.Core.Application.Service.Inspection.DTO; using Nito.AsyncEx; using System.ComponentModel.DataAnnotations; using IRaCIS.Core.Application.Auth; +using IRaCIS.Core.Application.Helper; namespace IRaCIS.Core.Application.Image.QA { @@ -535,7 +536,7 @@ namespace IRaCIS.Core.Application.Image.QA // return ResponseOutput.NotOk("只有PM/APM具有操作权限!"); //} - var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName; + var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); var fileName = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.ToString().Trim('"').ToLower(); if (!fileName.EndsWith(".xlsx") && !fileName.EndsWith(".csv") && !fileName.EndsWith(".xls")) @@ -544,7 +545,7 @@ namespace IRaCIS.Core.Application.Image.QA } //上传根路径 - string uploadFolderPath = Path.Combine(rootPath, "UploadFile", "Check"); + string uploadFolderPath = Path.Combine(rootPath,StaticData.TrialDataFolder, trialId.ToString(), "CheckExcel"); if (!Directory.Exists(uploadFolderPath)) { @@ -552,7 +553,12 @@ namespace IRaCIS.Core.Application.Image.QA } //存放核对表 - var filePath = Path.Combine(uploadFolderPath, DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss") + fileName); + var (trustedFileNameForFileStorage, fileName) = FileStoreHelper.GetStoreFileName(fileName); + + var filePath = Path.Combine(uploadFolderPath, trustedFileNameForFileStorage); + + + using (FileStream fs = System.IO.File.Create(filePath)) { await file.CopyToAsync(fs);