md
This commit is contained in:
parent
127a8deb64
commit
d1e262ef40
@ -13,6 +13,7 @@ package com.xdadan.erp.web.emis;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -339,7 +340,7 @@ public class EmisWaybillController extends BaseController
|
||||
|
||||
|
||||
@RequestMapping("/realGetWaybillPdf")
|
||||
public AjaxResult realGetWaybillPdf(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
||||
public void realGetWaybillPdf(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
||||
{
|
||||
if(!StringUtils.isEmpty(billCode)){
|
||||
try {
|
||||
@ -357,22 +358,21 @@ public class EmisWaybillController extends BaseController
|
||||
tplPrint.genPDF(order, os);
|
||||
|
||||
}else{
|
||||
return AjaxResult.success("未获取到数据");
|
||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("未获取到数据")));
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success("获取成功",jArr);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
return AjaxResult.error("获取失败");
|
||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("获取异常")));
|
||||
|
||||
}
|
||||
}
|
||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("获取失败")));
|
||||
|
||||
return AjaxResult.error("获取失败");
|
||||
}
|
||||
|
||||
@RequestMapping("/realGetWaybillPng")
|
||||
public AjaxResult realGetWaybillPng(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
||||
public void realGetWaybillPng(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
||||
{
|
||||
if(!StringUtils.isEmpty(billCode)){
|
||||
try {
|
||||
@ -390,21 +390,37 @@ public class EmisWaybillController extends BaseController
|
||||
tplPrint.genPNG(order, os);
|
||||
|
||||
}else{
|
||||
return AjaxResult.success("未获取到数据");
|
||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("未获取到数据")));
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success("获取成功",jArr);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
return AjaxResult.error("获取失败");
|
||||
|
||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("获取异常")));
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.error("获取失败");
|
||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("获取失败")));
|
||||
}
|
||||
|
||||
|
||||
private void responseJson(HttpServletResponse response,String text){
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("application/json; charset=utf-8");
|
||||
PrintWriter out = null;
|
||||
try {
|
||||
out = response.getWriter();
|
||||
out.append(text);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 导出运单列表列表
|
||||
|
||||
Loading…
Reference in New Issue
Block a user