销售订单增加导出PI功能

This commit is contained in:
Mrking 2024-11-02 11:45:47 +08:00
parent 294c4e5d6e
commit 0c40437c74
1 changed files with 6 additions and 4 deletions

View File

@ -486,16 +486,18 @@ public class SaleOrderServiceImpl implements SaleOrderService {
SaleContractDO saleContract = BeanUtils.toBean(saleContractVO, SaleContractDO.class);
List<SaleContractEntryDO> saleContractEntrys = BeanUtils.toBean(saleContractVO.getSaleContractEntrys(), SaleContractEntryDO.class);
String htmlContent = generateHtmlContent(saleContract,saleContractEntrys);
String fileName = StrUtil.format(pdfPath+"/销售合约_{}", saleOrder.getBillno());
String pdfPath2 = System.getProperty("user.dir") + "/pdffile";
String fileName = StrUtil.format(pdfPath2+"/销售合约_{}", saleOrder.getBillno());
String templatePath = fileName + ".html";
String pdfPath = fileName + ".pdf";
FileUtil.writeString(htmlContent,templatePath, "UTF-8");
log.info("已生成HTML文件111"+System.getProperty("user.dir")+"/padfile");
log.info("已生成HTML文件"+templatePath);
//请求wkapp
JSONObject params = new JSONObject();
params.put("input_html_path",templatePath);
String fileName2 = StrUtil.format(pdfPath+"/销售合约_{}", saleOrder.getBillno());
String input_html_path = fileName2 + ".html";
params.put("input_html_path",input_html_path);
params.put("output_pdf_path",pdfPath);
String result = HttpUtil.post(wkappUrl + "/exehtmltopdf", params, 5 * 60 * 1000);
log.info("请求wkapp接口返回结果"+result);