|
|
@ -52,6 +52,7 @@ import org.apache.commons.lang3.StringEscapeUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
|
|
|
|
import org.apache.http.util.TextUtils;
|
|
|
|
import org.apache.poi.hssf.usermodel.*;
|
|
|
|
import org.apache.poi.hssf.usermodel.*;
|
|
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
@ -832,9 +833,12 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
: "-";
|
|
|
|
: "-";
|
|
|
|
item.put("debit", debit);
|
|
|
|
item.put("debit", debit);
|
|
|
|
item.put("credit", credit);
|
|
|
|
item.put("credit", credit);
|
|
|
|
|
|
|
|
if(item.get("settle_amount")==null){
|
|
|
|
|
|
|
|
item.put("settle_amount","-");
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
System.out.println("------>dataList:"+dataList);
|
|
|
|
|
|
|
|
System.out.println("------>parmerters:"+parmerters);
|
|
|
|
ctx.setVariable("parmerters",parmerters);
|
|
|
|
ctx.setVariable("parmerters",parmerters);
|
|
|
|
ctx.setVariable("dataList",dataList);
|
|
|
|
ctx.setVariable("dataList",dataList);
|
|
|
|
final String html = thymeleaf.process("app/invoice.html", ctx);
|
|
|
|
final String html = thymeleaf.process("app/invoice.html", ctx);
|
|
|
@ -844,14 +848,14 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
String fileName = client.getString("client_moniker") + "_Cross_Border_" + parmerters.getString("dateRange").replaceAll("/", "");
|
|
|
|
String fileName = client.getString("client_moniker") + "_Cross_Border_" + parmerters.getString("dateRange").replaceAll("/", "");
|
|
|
|
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf");
|
|
|
|
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf");
|
|
|
|
OutputStream outs = response.getOutputStream();
|
|
|
|
OutputStream outs = response.getOutputStream();
|
|
|
|
JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城");
|
|
|
|
// JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城");
|
|
|
|
// InputStream jasper = clientIncrement == null ? trans_flow.getInputStream() : incremental_trans_flow.getInputStream();
|
|
|
|
// InputStream jasper = clientIncrement == null ? trans_flow.getInputStream() : incremental_trans_flow.getInputStream();
|
|
|
|
// byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource);
|
|
|
|
// byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource);
|
|
|
|
System.out.println("------>content:"+html);
|
|
|
|
System.out.println("------>content:"+html);
|
|
|
|
|
|
|
|
|
|
|
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
|
ITextRenderer renderer = new ITextRenderer();
|
|
|
|
ITextRenderer renderer = new ITextRenderer();
|
|
|
|
ITextFontResolver fontResolver = (ITextFontResolver) renderer.getSharedContext().getFontResolver();
|
|
|
|
// ITextFontResolver fontResolver = (ITextFontResolver) renderer.getSharedContext().getFontResolver();
|
|
|
|
//添加字体库 begin
|
|
|
|
//添加字体库 begin
|
|
|
|
// File f = new File(fontDir);
|
|
|
|
// File f = new File(fontDir);
|
|
|
|
// if (f.isDirectory()) {
|
|
|
|
// if (f.isDirectory()) {
|
|
|
@ -875,24 +879,6 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
outs.flush();
|
|
|
|
outs.flush();
|
|
|
|
outs.close();
|
|
|
|
outs.close();
|
|
|
|
|
|
|
|
|
|
|
|
// final String html = thymeleaf.process("invoice.html", ctx);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// response.setContentType("application/pdf");
|
|
|
|
|
|
|
|
// String fileName = client.getString("client_moniker") + "_" + parmerters.getString("dateRange").replaceAll("/", "");
|
|
|
|
|
|
|
|
// response.setHeader("Content-Disposition", "attachment;fileName=123.pdf");
|
|
|
|
|
|
|
|
// OutputStream outs = null;
|
|
|
|
|
|
|
|
// try {
|
|
|
|
|
|
|
|
// outs = response.getOutputStream();
|
|
|
|
|
|
|
|
//// JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城");
|
|
|
|
|
|
|
|
//// InputStream jasper = clientIncrement == null ? trans_flow.getInputStream() : incremental_trans_flow.getInputStream();
|
|
|
|
|
|
|
|
//// byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource);
|
|
|
|
|
|
|
|
// outs.write(buff, 0, buff.length);
|
|
|
|
|
|
|
|
// outs.flush();
|
|
|
|
|
|
|
|
// outs.close();
|
|
|
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|