|
|
|
@ -98,6 +98,17 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
result.msg = "批量下载BC成功";
|
|
|
|
|
|
|
|
|
|
var downResultList = taskList.Select(x => x.Result);
|
|
|
|
|
|
|
|
|
|
if (downResultList.Any(x => !x.succ))
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = "BC下载失败";
|
|
|
|
|
//result.ext =
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//result.ext = id;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
@ -187,10 +198,14 @@ namespace Myshipping.Application
|
|
|
|
|
string relativePath = $"{fileCfg.relativePath}\\bcfiles\\{bookingOrder.Id}";
|
|
|
|
|
string filePath = $"{(!string.IsNullOrWhiteSpace(fileCfg.basePath) ? fileCfg.basePath : App.WebHostEnvironment.WebRootPath)}\\{relativePath}";
|
|
|
|
|
|
|
|
|
|
string fileFullName = $"{filePath}\\{new System.IO.FileInfo(currFilePath).Name}";
|
|
|
|
|
|
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
|
|
|
|
{
|
|
|
|
|
relativePath = relativePath.Replace("\\", "/");
|
|
|
|
|
filePath = filePath.Replace("\\", "/");
|
|
|
|
|
|
|
|
|
|
fileFullName = fileFullName.Replace("\\", "/");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 生成文件保存路径完成 路由={filePath} 服务器系统={system}", batchNo, filePath, RuntimeInformation.OSDescription);
|
|
|
|
@ -202,8 +217,24 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
var bcStream = await currFilePath.GetAsStreamAsync();
|
|
|
|
|
|
|
|
|
|
using (var fileStream = File.Create(fileFullName))
|
|
|
|
|
{
|
|
|
|
|
await bcStream.CopyToAsync(fileStream);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string bookFilePath = string.Empty;
|
|
|
|
|
|
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
|
|
|
|
{
|
|
|
|
|
bookFilePath = System.Text.RegularExpressions.Regex.Match(fileFullName, relativePath.Replace("/", "\\/") + ".*").Value;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bookFilePath = System.Text.RegularExpressions.Regex.Match(fileFullName, relativePath.Replace("\\", "\\\\") + ".*").Value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//这里先写入附件表
|
|
|
|
|
await SaveEDIFile(bookingOrder.Id, currFilePath, new System.IO.FileInfo(currFilePath).Name,
|
|
|
|
|
await SaveEDIFile(bookingOrder.Id, bookFilePath, new System.IO.FileInfo(currFilePath).Name,
|
|
|
|
|
fileTypeCode, fileTypeName);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|