|
|
@ -85,24 +85,25 @@ namespace Win.Sfs.SettleAccount.ExcelImporter |
|
|
|
{ |
|
|
|
//保存成物理文件
|
|
|
|
await file.CopyToAsync(memoryStream); |
|
|
|
await _excelImportService.SaveBlobAsync( |
|
|
|
new SaveExcelImportInputDto |
|
|
|
{ |
|
|
|
Name = Path.GetFileName(FileOriginName), |
|
|
|
Content = memoryStream.ToArray() |
|
|
|
} |
|
|
|
); |
|
|
|
//await _excelImportService.SaveBlobAsync(
|
|
|
|
// new SaveExcelImportInputDto
|
|
|
|
// {
|
|
|
|
// Name = Path.GetFileName(FileOriginName),
|
|
|
|
// Content = memoryStream.ToArray()
|
|
|
|
// }
|
|
|
|
// );
|
|
|
|
await fc.SaveAsync(FileOriginName, memoryStream.ToArray()).ConfigureAwait(false); |
|
|
|
} |
|
|
|
//读取文件保存的根目录
|
|
|
|
string fileSaveRootDir = ConfigDirHelper.GetAppSetting("App", "FileRootPath"); |
|
|
|
//读取WMS文件保存的模块的根目录
|
|
|
|
string fileSaveDir = ConfigDirHelper.GetAppSetting("App", "WMSFiles"); |
|
|
|
//文件保存的相对文件夹(保存到wwwroot目录下)
|
|
|
|
string absoluteFileDir = fileSaveRootDir + @"\" + fileSaveDir; |
|
|
|
//文件保存的路径(应用的工作目录+文件夹相对路径);
|
|
|
|
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container" + absoluteFileDir; |
|
|
|
var filePath = fileSavePath + getFileName;//获取到导入的excel
|
|
|
|
var import = await _importer.Import<T>(filePath); |
|
|
|
////读取文件保存的根目录
|
|
|
|
//string fileSaveRootDir = ConfigDirHelper.GetAppSetting("App", "FileRootPath");
|
|
|
|
////读取WMS文件保存的模块的根目录
|
|
|
|
//string fileSaveDir = ConfigDirHelper.GetAppSetting("App", "WMSFiles");
|
|
|
|
////文件保存的相对文件夹(保存到wwwroot目录下)
|
|
|
|
//string absoluteFileDir = fileSaveRootDir + @"\" + fileSaveDir;
|
|
|
|
////文件保存的路径(应用的工作目录+文件夹相对路径);
|
|
|
|
//string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container" + absoluteFileDir;
|
|
|
|
//var filePath = fileSavePath + getFileName;//获取到导入的excel
|
|
|
|
var import = await _importer.Import<T>((await fc.GetAsync(FileOriginName).ConfigureAwait(false))); |
|
|
|
if (import.Exception != null) |
|
|
|
{ |
|
|
|
if (import.Exception.Message.ToString() == "导入文件不存在!") |
|
|
|