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.ByteArrayOutputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@ -269,9 +270,10 @@ public class EmisWaybillController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/realGetWaybillPrintData")
|
@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",
|
"billCode":"T123213",
|
||||||
@ -295,20 +297,26 @@ public class EmisWaybillController extends BaseController
|
|||||||
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
|
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
|
||||||
JSONObject printItem = new JSONObject();
|
JSONObject printItem = new JSONObject();
|
||||||
printItem.put("billCode",billCodeItem);
|
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("isEncrpt",false);
|
||||||
printItem.put("printCount",1);
|
printItem.put("printCount",1);
|
||||||
printItem.put("printDate", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date()));
|
printItem.put("printDate", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date()));
|
||||||
|
|
||||||
if(order!=null) {
|
if(order!=null) {
|
||||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
||||||
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
if("1".equals(isNeedPdf)) {
|
||||||
tplPrint.genPDF(order, os);
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||||
// 生成pdf base64
|
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
||||||
byte[] pdfBytes = os.toByteArray();
|
tplPrint.genPDF(order, os);
|
||||||
String pdfBase64Str = Base64.getEncoder().encodeToString(pdfBytes);
|
// 生成pdf base64
|
||||||
System.out.println(pdfBase64Str);
|
byte[] pdfBytes = os.toByteArray();
|
||||||
printItem.put("pdfInfo",pdfBase64Str);
|
String pdfBase64Str = Base64.getEncoder().encodeToString(pdfBytes);
|
||||||
|
System.out.println(pdfBase64Str);
|
||||||
|
printItem.put("pdfInfo", pdfBase64Str);
|
||||||
|
}else{
|
||||||
|
printItem.put("pdfInfo", "");
|
||||||
|
}
|
||||||
|
|
||||||
printItem.put("result","success");
|
printItem.put("result","success");
|
||||||
printItem.put("message","success");
|
printItem.put("message","success");
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user