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)){