md
This commit is contained in:
parent
08e05d61f0
commit
85e243872e
@ -13,6 +13,7 @@ package com.xdadan.erp.web.emis;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -269,9 +270,10 @@ public class EmisWaybillController extends BaseController
|
||||
}
|
||||
|
||||
@RequestMapping("/realGetWaybillPrintData")
|
||||
public AjaxResult realGetWaybillPrintData(String billCode, String billCodeRange, String lang, String printType, HttpServletRequest request, HttpServletResponse response)
|
||||
public AjaxResult realGetWaybillPrintData(String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
||||
{
|
||||
/*
|
||||
, HttpServletRequest request, HttpServletResponse response
|
||||
[
|
||||
{
|
||||
"billCode":"T123213",
|
||||
@ -295,20 +297,26 @@ public class EmisWaybillController extends BaseController
|
||||
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
|
||||
JSONObject printItem = new JSONObject();
|
||||
printItem.put("billCode",billCodeItem);
|
||||
printItem.put("billDetail",order);
|
||||
printItem.put("billDetail",Base64.getEncoder().encodeToString(JSONObject.toJSONString(order).getBytes(Charset.forName("UTF-8"))));
|
||||
printItem.put("isEncrpt",false);
|
||||
printItem.put("printCount",1);
|
||||
printItem.put("printDate", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date()));
|
||||
|
||||
if(order!=null) {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
||||
tplPrint.genPDF(order, os);
|
||||
// 生成pdf base64
|
||||
byte[] pdfBytes = os.toByteArray();
|
||||
String pdfBase64Str = Base64.getEncoder().encodeToString(pdfBytes);
|
||||
System.out.println(pdfBase64Str);
|
||||
printItem.put("pdfInfo",pdfBase64Str);
|
||||
|
||||
if("1".equals(isNeedPdf)) {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
||||
tplPrint.genPDF(order, os);
|
||||
// 生成pdf base64
|
||||
byte[] pdfBytes = os.toByteArray();
|
||||
String pdfBase64Str = Base64.getEncoder().encodeToString(pdfBytes);
|
||||
System.out.println(pdfBase64Str);
|
||||
printItem.put("pdfInfo", pdfBase64Str);
|
||||
}else{
|
||||
printItem.put("pdfInfo", "");
|
||||
}
|
||||
|
||||
printItem.put("result","success");
|
||||
printItem.put("message","success");
|
||||
}else{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user