销售订单增加导出PI功能

This commit is contained in:
Mrking 2024-11-02 11:10:11 +08:00
parent e930e28373
commit 1d98827bfb
2 changed files with 15 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import cn.hangtag.framework.common.exception.ServiceException;
import cn.hangtag.framework.common.exception.enums.GlobalErrorCodeConstants;
import cn.hangtag.framework.common.pojo.PageResult;
import cn.hangtag.framework.common.util.FuncUtil;
import cn.hangtag.framework.common.util.http.HttpUtils;
import cn.hangtag.framework.common.util.object.BeanUtils;
import cn.hangtag.framework.common.util.validation.AssertUtil;
import cn.hangtag.framework.mybatis.core.dataobject.BaseDO;
@ -60,6 +61,8 @@ import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.ZipUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
@ -137,7 +140,8 @@ public class SaleOrderServiceImpl implements SaleOrderService {
@Value("${pdfPath}")
private String pdfPath;
@Value("${wkappurl}")
private String wkappUrl;
@Override
@ -487,7 +491,14 @@ public class SaleOrderServiceImpl implements SaleOrderService {
String templatePath = fileName + ".html";
String pdfPath = fileName + ".pdf";
FileUtil.writeString(htmlContent,templatePath, "UTF-8");
WKHtmlToPdfUtil.convert(templatePath, pdfPath);
//请求wkapp
JSONObject params = new JSONObject();
params.put("input_html_path",templatePath);
params.put("output_pdf_path",pdfPath);
String result = HttpUtil.post(wkappUrl + "/exehtmltopdf", params, 5 * 60 * 1000);
log.info("请求wkapp接口返回结果"+result);
//WKHtmlToPdfUtil.convert(templatePath, pdfPath);
File file = FileUtil.file(pdfPath);
files.add(file);
delFiles.add(pdfPath);

View File

@ -279,4 +279,5 @@ oms:
partyb: 东莞市网络网纳科技有限公司
partybAddress: 东莞市南城*********
pdfPath: C:\Users\Admin\Desktop\1111111\test
pdfPath: C:\Users\Admin\Desktop\1111111\test
wkappurl: http://127.0.0.1:76/