From bd2c1ccd6b141761110e2ed22335490ecfec3df5 Mon Sep 17 00:00:00 2001 From: yf <770153798@qq.com> Date: Mon, 20 Jan 2025 10:18:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../saleorder/SaleOrderServiceImpl.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java index 493e6cf..afafe87 100644 --- a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java +++ b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java @@ -1240,10 +1240,21 @@ public class SaleOrderServiceImpl implements SaleOrderService { String name = DateUtil.format(LocalDateTime.now(), "yyyyMMdd") +"-"+IdUtil.simpleUUID().substring(0, 4); String ouput = StrUtil.format(targetPath + "/{}_{}.pdf",(s+"_"+orderQty),name); - + String templatePath2 = StrUtil.format(targetPath + "/{}_{}.html",(s+"_"+orderQty),name); + File file2 = new File(templatePath2); + if(!file2.exists()){ + try { + FileUtil.touch(templatePath2); + } catch (Exception e) { + e.printStackTrace(); + } + } + String htmlText = HttpUtil.get(sourceFile); + System.out.println("htmlText:"+htmlText); + FileUtil.writeString(htmlText, templatePath2, "UTF-8"); //请求wkapp JSONObject params = new JSONObject(); - params.put("input_html_path", sourceFile); + params.put("input_html_path", "file://" + templatePath2); params.put("output_pdf_path", ouput); System.out.println("params"+params); log.info("稿件导出 请求wkapp接口url:" + wkappUrl + "/exehtmltopdf"); @@ -1253,7 +1264,8 @@ public class SaleOrderServiceImpl implements SaleOrderService { File file = FileUtil.file(ouput); System.out.println("ouput:"+ouput); files.add(file); - delFiles.add(ouput); +// delFiles.add(ouput); +// delFiles.add(templatePath2); } } if(FuncUtil.isEmpty(files)){