工单打印功能修改,直接打印BarTender标签
This commit is contained in:
@@ -385,23 +385,30 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
}
|
||||
|
||||
//TODO 打印机打印工单
|
||||
|
||||
[HttpPost("print")]
|
||||
[AllowAnonymous]
|
||||
[HttpGet("print")]
|
||||
public async Task<IActionResult> ExportWorkorderPDF(string[] workorderArray,string? path)
|
||||
public async Task<IActionResult> ExportWorkorderPDF([FromBody] ProWorkorderExportDto param)
|
||||
{
|
||||
if(workorderArray==null||workorderArray.Length<1)
|
||||
try
|
||||
{
|
||||
throw new CustomException("workorderArray");
|
||||
}
|
||||
if (path==null)
|
||||
{
|
||||
path ="./Resources/gxassembly_production_label.btw";
|
||||
}
|
||||
//Task<(string, Stream)> conntext = _ProWorkorderService.ExportPDFByQuestPDFDemo(workorderArray);
|
||||
var exception = await _ProWorkorderService.PrintTicketsByTemplate(workorderArray,path);
|
||||
if (param.WorkorderArray == null || param.WorkorderArray.Length < 1)
|
||||
{
|
||||
return ToResponse(500, "工单列表为空");
|
||||
}
|
||||
param.Path = "D:/mes/Label/Trace.btw";
|
||||
//Task<(string, Stream)> conntext = _ProWorkorderService.ExportPDFByQuestPDFDemo(workorderArray);
|
||||
var exception = await _ProWorkorderService.PrintTicketsByTemplate(param);
|
||||
|
||||
return (IActionResult)exception;
|
||||
//return File(conntext.Result.Item2, "application/pdf", HttpUtility.UrlEncode(conntext.Result.Item1));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ToResponse(500, ex.Message);
|
||||
}
|
||||
|
||||
|
||||
return (IActionResult)exception;
|
||||
//return File(conntext.Result.Item2, "application/pdf", HttpUtility.UrlEncode(conntext.Result.Item1));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user