添加pdf工具使用

This commit is contained in:
yangjun 2024-05-25 16:16:58 +08:00
parent 0cade225f1
commit 83d9a7f79a
1 changed files with 6 additions and 4 deletions

View File

@ -320,10 +320,12 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
Global global = SpringContextHolder.getBean(Global.class);
FileUtil.mkdir(global.getContractDickPath());
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
String docPath = upLoadPath+ File.separator+ zyJxdg.getFilePath();
// String docPath = upLoadPath+ File.separator+ zyJxdg.getFilePath();
String docPath = zyJxdg.getFilePath();
String namePath = dd + ".pdf";
String pdfPath = global.getContractDickPath() + namePath;
PDFUtil.office2PDF(docPath,pdfPath);
Map<String,String> map = zykService.downloadRemoteFile(docPath);
PDFUtil.office2PDF(map.get("data"),pdfPath);
zyJxdg.setPdfPath("contract/"+namePath);
}
}else{
@ -340,8 +342,8 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
zykInfo.setFileName(zyJxdg.getFilePath());
zykInfo.setPdfName(zyJxdg.getPdfPath());
Map<String,String> map = zykService.saveToZyk(zykInfo);
String fileName = map.get("fileName");
String pdfName = map.get("pdfName");
String fileName = map.get("data");
String pdfName = map.get("pdfData");
zyJxdg.setFilePath(fileName);
zyJxdg.setPdfPath(pdfName);
}