Browse Source

合同问题修改

master
dimengzhe 3 years ago
parent
commit
b261921bcc
  1. 13
      yxt-common/yxt-common-base/src/main/java/com/yxt/common/base/config/component/DocPdfComponent.java

13
yxt-common/yxt-common-base/src/main/java/com/yxt/common/base/config/component/DocPdfComponent.java

@ -38,9 +38,9 @@ public class DocPdfComponent {
/** /**
* 根据ftl模板生成word * 根据ftl模板生成word
* *
* @param map 数据 * @param map 数据
* @param typeName 模板名称 * @param typeName 模板名称
* @param fileName 文件名 * @param fileName 文件名
* @return 返回word文件路径和链接路径 * @return 返回word文件路径和链接路径
*/ */
public Map<String, String> creatWord(Map<String, Object> map, String typeName, String fileName) { public Map<String, String> creatWord(Map<String, Object> map, String typeName, String fileName) {
@ -79,6 +79,7 @@ public class DocPdfComponent {
/** /**
* 图片文件转换 * 图片文件转换
*
* @param imgPath * @param imgPath
* @return * @return
*/ */
@ -99,6 +100,7 @@ public class DocPdfComponent {
/** /**
* word转换为pdf * word转换为pdf
*
* @param wordFile word的路径 * @param wordFile word的路径
* @param pdfName pdf名称 * @param pdfName pdf名称
* @return 返回pdf文件路径和链接路径 * @return 返回pdf文件路径和链接路径
@ -129,8 +131,10 @@ public class DocPdfComponent {
Dispatch.call(document, "SaveAs", pdfFile, 17); Dispatch.call(document, "SaveAs", pdfFile, 17);
// 关闭文档 // 关闭文档
Dispatch.call(document, "Close", false); Dispatch.call(document, "Close", false);
String prefixUrl = prefixTemplateUrl + pdfFile.replace(uploadTemplateUrl, ""); // String prefixUrl = prefixTemplateUrl + pdfFile.replace(uploadTemplateUrl, "");
resultMap.put("uploadTemplateUrl", pdfFile); // 文件路径 resultMap.put("uploadTemplateUrl", pdfFile); // 文件路径
pdfFile = targetPath + "/" + pdfName;
String prefixUrl = prefixTemplateUrl + pdfFile.replace(uploadTemplateUrl, "");
resultMap.put("prefixTemplateUrl", prefixUrl); // 链接路径 resultMap.put("prefixTemplateUrl", prefixUrl); // 链接路径
} catch (Exception e) { } catch (Exception e) {
log.error("转换失败" + e.getMessage()); log.error("转换失败" + e.getMessage());
@ -143,6 +147,7 @@ public class DocPdfComponent {
/** /**
* 根据ftl模板生成word并转为pdf * 根据ftl模板生成word并转为pdf
*
* @param map * @param map
* @param typeName * @param typeName
* @param docName * @param docName

Loading…
Cancel
Save