From 17ac23e93792f1403297dfa783c85db0c10abb20 Mon Sep 17 00:00:00 2001 From: linzhijie <19970921lzj> Date: 星期五, 06 八月 2021 16:15:38 +0800 Subject: [PATCH] PAQ 模板支持 --- src/main/java/com/ots/common/utils/poi/WordUtil.java | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ots/common/utils/poi/WordUtil.java b/src/main/java/com/ots/common/utils/poi/WordUtil.java index 961d8e8..8ca167f 100644 --- a/src/main/java/com/ots/common/utils/poi/WordUtil.java +++ b/src/main/java/com/ots/common/utils/poi/WordUtil.java @@ -9,6 +9,7 @@ import com.ots.project.exam.domain.TReportTemplate; import com.ots.project.exam.dto.JAQTableStyle; import com.ots.project.exam.dto.WordParam; +import com.ots.project.tool.PdfUtil; import com.ots.project.tool.ShellTool; import com.ots.project.tool.exam.ExamUtil; import com.ots.project.tool.exam.ImageUtil; @@ -767,7 +768,12 @@ setChageWord(fileName, out, textMap, tReportTemplate.getReportType(), templateType, autoTableMap); out.flush(); changColorIfJAQ(textMap, out, reportName, tReportTemplate.getReportType()); - ShellTool.execLibreofficeCommand("pdf", EssConfig.getProfile() + "/" + reportName, EssConfig.getProfile() + "/"); + //PAQ閲囩敤鏂扮殑doc杞琾df + if(!ReportTypeEnum.PAQ.getCode().equals(reportType)){ + ShellTool.execLibreofficeCommand("pdf", EssConfig.getProfile() + "/" + reportName, EssConfig.getProfile() + "/"); + }else{ + PdfUtil.convertPDF(EssConfig.getProfile() + "/" + reportName); + } zipFilePath = getPdfPath(reportName); deleteFileStrList.add(EssConfig.getProfile() + "/" + reportName); @@ -857,7 +863,7 @@ changeTextBox(document, textMap); //璁剧疆鍥捐〃 - if (Objects.equals(reportType, ReportTypeEnum.SAQ.getCode())) { + if (Objects.equals(reportType, ReportTypeEnum.SAQ.getCode()) || Objects.equals(reportType, ReportTypeEnum.PAQ.getCode())) { SAQChart.changeChart(document, textMap); } @@ -868,7 +874,7 @@ changeTable(document, textMap); //璁剧疆鍥捐〃鎺т欢 - changChar(textMap, document, reportType, templateType); + //changChar(textMap, document, reportType, templateType); document.write(out); } private static void changeTextBox(XWPFDocument document, Map<String, Object> textMap) throws DocumentException { -- Gitblit v1.9.1