打印模板下载文件名乱码

optimize
wanghaomei 2 years ago
parent a1f84c3ead
commit 90bce86274

@ -14711,7 +14711,7 @@
</summary>
<param name="taskPKId">任务主键</param>
<param name="model">提单纸登记请求参数</param>
<returns></returns>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.DownloadTaskAttach(System.String)">
<summary>
@ -14720,6 +14720,50 @@
<param name="taskPKId"></param>
<returns>返回文件流</returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.PrintBatch(System.String[])">
<summary>
正本附件批量打印
</summary>
<param name="PKIds">任务主键数组</param>
<returns>返回文件流</returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.AcceptChangeShip(System.String)">
<summary>
接收换船
</summary>
<param name="taskPKId">任务主键</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.AcceptCancelChangeShip(System.String)">
<summary>
取消换船
</summary>
<param name="taskPKId">任务主键</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.SendTelexEmail(System.String,System.String)">
<summary>
转发电放邮件
</summary>
<param name="taskPKId">任务主键</param>
<param name="toMail">指定邮件地址</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.SendShippingOrder(System.String,System.String)">
<summary>
发送下货纸
</summary>
<param name="taskPKId">任务主键</param>
<param name="fileRole">文件功能 (9原始)</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.GetBookingOrderInfo(System.String)">
<summary>
获取订舱详情
</summary>
<param name="taskPKId">任务主键</param>
<returns>返回结果</returns>
</member>
<member name="T:Myshipping.Application.TaskManageService">
<summary>
任务管理
@ -14853,5 +14897,49 @@
<param name="taskPKId"></param>
<returns>返回文件流</returns>
</member>
<member name="M:Myshipping.Application.TaskManageService.PrintBatch(System.String[])">
<summary>
正本附件批量打印
</summary>
<param name="PKIds">任务主键数组</param>
<returns>返回文件流</returns>
</member>
<member name="M:Myshipping.Application.TaskManageService.AcceptChangeShip(System.String)">
<summary>
接收换船
</summary>
<param name="taskPKId">任务主键</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.TaskManageService.AcceptCancelChangeShip(System.String)">
<summary>
取消换船
</summary>
<param name="taskPKId">任务主键</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.TaskManageService.SendTelexEmail(System.String,System.String)">
<summary>
转发电放邮件
</summary>
<param name="taskPKId">任务主键</param>
<param name="toMail">指定邮件地址</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.TaskManageService.SendShippingOrder(System.String,System.String)">
<summary>
发送下货纸
</summary>
<param name="taskPKId">任务主键</param>
<param name="fileRole">文件功能 (9原始)</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.TaskManageService.GetBookingOrderInfo(System.String)">
<summary>
获取订舱详情
</summary>
<param name="taskPKId">任务主键</param>
<returns>返回结果</returns>
</member>
</members>
</doc>

@ -37,14 +37,21 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<SysUser> _repUser;
private readonly ILogger<BookingPrintTemplate> _logger;
private readonly SqlSugarRepository<BookingExcelTemplate> _excelrep;
public BookingPrintTemplateService(SqlSugarRepository<BookingPrintTemplate> rep, SqlSugarRepository<BookingPrinttemplateRight> repRight, SqlSugarRepository<SysUser> repUser, SqlSugarRepository<BookingExcelTemplate> excelrep, ILogger<BookingPrintTemplate> logger)
private readonly IHttpContextAccessor _httpContextAccessor;
public BookingPrintTemplateService(SqlSugarRepository<BookingPrintTemplate> rep,
SqlSugarRepository<BookingPrinttemplateRight> repRight,
SqlSugarRepository<SysUser> repUser,
SqlSugarRepository<BookingExcelTemplate> excelrep,
ILogger<BookingPrintTemplate> logger,
IHttpContextAccessor httpContextAccessor)
{
_rep = rep;
_repRight = repRight;
_repUser = repUser;
_logger = logger;
_excelrep = excelrep;
_httpContextAccessor = httpContextAccessor;
}
/// <summary>
@ -352,8 +359,7 @@ namespace Myshipping.Application
throw Oops.Bah(BookingErrorCode.BOOK115);
}
var fileName = HttpUtility.UrlEncode(printFile.FileName, Encoding.GetEncoding("UTF-8"));
var result = new FileStreamResult(new FileStream(fileFullPath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
var result = new FileStreamResult(new FileStream(fileFullPath, FileMode.Open), "application/octet-stream") { FileDownloadName = printFile.FileName };
return result;
}
/// <summary>

Loading…
Cancel
Save