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 cdcfa41..7490823 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 @@ -486,19 +486,25 @@ public class SaleOrderServiceImpl implements SaleOrderService { SaleContractDO saleContract = BeanUtils.toBean(saleContractVO, SaleContractDO.class); List saleContractEntrys = BeanUtils.toBean(saleContractVO.getSaleContractEntrys(), SaleContractEntryDO.class); String htmlContent = generateHtmlContent(saleContract,saleContractEntrys); - String pdfPath2 = System.getProperty("user.dir") + "/pdffile"; - String fileName = StrUtil.format(pdfPath2+"/SaleContract_{}", saleOrder.getBillno()); - String templatePath = fileName + ".html"; + + //docker生成路径 + String pathUrl = System.getProperty("user.dir") + "/pdffile"; + String fileName = StrUtil.format(pathUrl+"/SaleContract_{}", saleOrder.getBillno()); + //主宿机生成路径 + String fileName2 = StrUtil.format(pdfPath+"/SaleContract_{}", saleOrder.getBillno()); + + String templatePath = fileName + ".html"; String pdfPath = fileName + ".pdf"; + String templatePath2 = fileName2 + ".html"; + String pdfPath2 = fileName2 + ".pdf"; FileUtil.writeString(htmlContent,templatePath, "UTF-8"); + log.info("已生成HTML文件:"+templatePath); //请求wkapp JSONObject params = new JSONObject(); - String fileName2 = StrUtil.format(pdfPath+"/SaleContract_{}", saleOrder.getBillno()); - String input_html_path = fileName2 + ".html"; - params.put("input_html_path",input_html_path); - params.put("output_pdf_path",pdfPath); + params.put("input_html_path",templatePath2); + params.put("output_pdf_path",pdfPath2); log.info("请求wkapp接口url:"+wkappUrl+"/exehtmltopdf"); String result = HttpUtil.post(wkappUrl + "/exehtmltopdf", params, 5 * 60 * 1000); log.info("请求wkapp接口返回结果:"+result); @@ -508,7 +514,8 @@ public class SaleOrderServiceImpl implements SaleOrderService { delFiles.add(pdfPath); delFiles.add(templatePath); } - String zipFileName = StrUtil.format(pdfPath + "/SaleContract_{}", new Date().getTime()); + String pathUrl = System.getProperty("user.dir") + "/pdffile"; + String zipFileName = StrUtil.format(pathUrl + "/SaleContract_{}", new Date().getTime()); // 压缩到的位置 File zipFile = new File(zipFileName+".zip");