精确打印文件名

optimize
whm 2 years ago
parent 99da78f02e
commit 7ca66a8ccb

@ -2595,7 +2595,16 @@ namespace Myshipping.Application
{ {
Directory.CreateDirectory(fileFullPath); Directory.CreateDirectory(fileFullPath);
} }
fileName = $"{order.MBLNO}_{DateTime.Now.Ticks}" + ".xls";//名称
//2023-4-3根据河川操作要求文件名只带提单号
if (!string.IsNullOrEmpty(order.MBLNO))
{
fileName = $"{order.MBLNO}.xls";//名称
}
else
{
fileName = $"{order.Id}_{DateTime.Now.Ticks}.xls";//名称
}
_logger.LogInformation("导出excel:" + Path.Combine(fileFullPath, fileName)); _logger.LogInformation("导出excel:" + Path.Combine(fileFullPath, fileName));
var filestream = new FileStream(Path.Combine(fileFullPath, fileName), FileMode.OpenOrCreate, FileAccess.ReadWrite); var filestream = new FileStream(Path.Combine(fileFullPath, fileName), FileMode.OpenOrCreate, FileAccess.ReadWrite);
excelwork.Write(filestream); excelwork.Write(filestream);

Loading…
Cancel
Save