修复 文件导出

This commit is contained in:
yf 2025-01-20 10:29:14 +08:00
parent bd2c1ccd6b
commit 4f061b363d
1 changed files with 6 additions and 9 deletions

View File

@ -1241,20 +1241,17 @@ public class SaleOrderServiceImpl implements SaleOrderService {
+"-"+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();
}
try {
FileUtil.touch(templatePath2);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("templatePath2"+templatePath2);
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", "file://" + templatePath2);
params.put("input_html_path", templatePath2);
params.put("output_pdf_path", ouput);
System.out.println("params"+params);
log.info("稿件导出 请求wkapp接口url" + wkappUrl + "/exehtmltopdf");