md
This commit is contained in:
parent
02769e02f2
commit
cf30ce25d7
@ -337,6 +337,72 @@ public class EmisWaybillController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/realGetWaybillPdf")
|
||||
public AjaxResult realGetWaybillPdf(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
||||
{
|
||||
if(!StringUtils.isEmpty(billCode)){
|
||||
try {
|
||||
JSONArray jArr = new JSONArray();
|
||||
String[] billCodeArr = billCode.split(",");
|
||||
|
||||
for(String billCodeItem:billCodeArr) {
|
||||
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
|
||||
if(order!=null) {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("application/pdf");
|
||||
response.setHeader("Content-Disposition", "filename=" + billCodeItem+".pdf");
|
||||
OutputStream os=response.getOutputStream();
|
||||
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
||||
tplPrint.genPDF(order, os);
|
||||
|
||||
}else{
|
||||
return AjaxResult.success("未获取到数据");
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success("获取成功",jArr);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
return AjaxResult.error("获取失败");
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.error("获取失败");
|
||||
}
|
||||
|
||||
@RequestMapping("/realGetWaybillPng")
|
||||
public AjaxResult realGetWaybillPng(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
||||
{
|
||||
if(!StringUtils.isEmpty(billCode)){
|
||||
try {
|
||||
JSONArray jArr = new JSONArray();
|
||||
String[] billCodeArr = billCode.split(",");
|
||||
|
||||
for(String billCodeItem:billCodeArr) {
|
||||
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
|
||||
if(order!=null) {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("application/pdf");
|
||||
response.setHeader("Content-Disposition", "filename=" + billCodeItem+".pdf");
|
||||
OutputStream os=response.getOutputStream();
|
||||
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
||||
tplPrint.genPNG(order, os);
|
||||
|
||||
}else{
|
||||
return AjaxResult.success("未获取到数据");
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success("获取成功",jArr);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
return AjaxResult.error("获取失败");
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.error("获取失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// /**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user