md
This commit is contained in:
parent
d1e262ef40
commit
4a56bdaaa7
@ -340,68 +340,68 @@ public class EmisWaybillController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
@RequestMapping("/realGetWaybillPdf")
|
@RequestMapping("/realGetWaybillPdf")
|
||||||
public void realGetWaybillPdf(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
public AjaxResult realGetWaybillPdf(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
||||||
{
|
{
|
||||||
if(!StringUtils.isEmpty(billCode)){
|
if(StringUtils.isEmpty(billCode)){
|
||||||
try {
|
return AjaxResult.error("参数错误");
|
||||||
JSONArray jArr = new JSONArray();
|
}
|
||||||
String[] billCodeArr = billCode.split(",");
|
|
||||||
|
try {
|
||||||
for(String billCodeItem:billCodeArr) {
|
response.setCharacterEncoding("UTF-8");
|
||||||
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
|
response.setContentType("application/pdf");
|
||||||
if(order!=null) {
|
response.setHeader("Content-Disposition", "filename=" + billCode+".pdf");
|
||||||
response.setCharacterEncoding("UTF-8");
|
OutputStream os=response.getOutputStream();
|
||||||
response.setContentType("application/pdf");
|
|
||||||
response.setHeader("Content-Disposition", "filename=" + billCodeItem+".pdf");
|
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
|
||||||
OutputStream os=response.getOutputStream();
|
if(order!=null) {
|
||||||
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
||||||
tplPrint.genPDF(order, os);
|
tplPrint.genPDF(order, os);
|
||||||
|
}else{
|
||||||
}else{
|
return AjaxResult.error("运单不存在");
|
||||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("未获取到数据")));
|
}
|
||||||
}
|
|
||||||
}
|
return null;
|
||||||
}catch (Exception ex){
|
}catch (Exception ex){
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("获取异常")));
|
return AjaxResult.error("获取异常");
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("获取失败")));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/realGetWaybillPng")
|
@RequestMapping("/realGetWaybillPng")
|
||||||
public void realGetWaybillPng(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
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) {
|
if(StringUtils.isEmpty(billCode)){
|
||||||
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
|
return AjaxResult.error("参数错误");
|
||||||
if(order!=null) {
|
}
|
||||||
response.setCharacterEncoding("UTF-8");
|
|
||||||
response.setContentType(MediaType.IMAGE_PNG_VALUE);
|
try {
|
||||||
response.setHeader("Content-Disposition", "filename=" + billCodeItem+".png");
|
response.setCharacterEncoding("UTF-8");
|
||||||
OutputStream os=response.getOutputStream();
|
response.setContentType(MediaType.IMAGE_PNG_VALUE);
|
||||||
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
response.setHeader("Content-Disposition", "filename=" + billCode+".png");
|
||||||
tplPrint.genPNG(order, os);
|
OutputStream os=response.getOutputStream();
|
||||||
|
|
||||||
}else{
|
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
|
||||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("未获取到数据")));
|
if(order!=null) {
|
||||||
}
|
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
||||||
}
|
tplPrint.genPNG(order, os);
|
||||||
|
}else{
|
||||||
}catch (Exception ex){
|
return AjaxResult.error("运单不存在");
|
||||||
ex.printStackTrace();
|
// 忽略错误
|
||||||
|
}
|
||||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("获取异常")));
|
|
||||||
}
|
// String[] billCodeArr = billCode.split(",");
|
||||||
|
// for(String billCodeItemStr:billCodeArr) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}catch (Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
return AjaxResult.error("系统异常");
|
||||||
}
|
}
|
||||||
|
|
||||||
responseJson(response,JSONObject.toJSONString(AjaxResult.error("获取失败")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user