[测评系统]--测评系统核心代码库
wzp
2024-01-31 ad58ba3d20b080ef113cbd196000028f83308bb3
src/main/java/com/ots/common/utils/poi/WordUtil.java
@@ -18,7 +18,9 @@
import com.ots.project.tool.exam.ImageUtil;
import com.ots.project.tool.exam.ZipUtil;
import com.ots.project.tool.libreoffice.LibreOfficeUtil;
import com.ots.project.tool.report.APIFan.chart.APIFanChart;
import com.ots.project.tool.report.CIAQ.chart.CIAQChart;
import com.ots.project.tool.report.LAQ.chart.LAQChart;
import com.ots.project.tool.report.MAQTR.chart.MAQTRChart;
import com.ots.project.tool.report.PAQ.chart.PAQChart;
import org.apache.commons.collections.map.HashedMap;
@@ -1180,12 +1182,12 @@
                changColorIfJAQ(textMap, out, reportName, tReportTemplate.getReportType());
            //}
            //PAQ、MAQTR采用、CIAQ新的doc转pdf
            //PAQ、MAQTR采用、CIAQ、APIFan新的doc转pdf
            if(ReportTypeEnum.PAQ.getCode().equals(reportType) || ReportTypeEnum.MAQTR.getCode().equals(reportType)
                    || ReportTypeEnum.CIAQ.getCode().equals(reportType)){
                    || ReportTypeEnum.CIAQ.getCode().equals(reportType) ||ReportTypeEnum.APIFan.getCode().equals(reportType)){
                PdfUtil.convertPDF(EssConfig.getProfile() + "/" + reportName);
            }else if(ReportTypeEnum.LAQ.getCode().equals(reportType)){
                PdfUtil.convertPythonPDF(EssConfig.getDocx2pdf(),EssConfig.getProfile() + "/" + reportName);
                PdfUtil.dockerConvertPDF(EssConfig.getProfile(),EssConfig.getDocx2pdfPath(),reportName);
            }else{
                ShellTool.execLibreofficeCommand("pdf", EssConfig.getProfile() + "/" + reportName, EssConfig.getProfile() + "/");
                // ShellTool shellTool = ShellTool.builder();
@@ -1289,11 +1291,27 @@
        XWPFDocument document = new XWPFDocument(POIXMLDocument.openPackage(getTemplateDownLoadPathByUpLoad(fileName)));
        //设置文本
        changeText(document, textMap);
        if (StringUtils.equals(reportType, ReportTypeEnum.JAQ.getCode())) {
            //设置文本框
            changeTextBox(document, textMap);
        //设置文本框
        changeTextBox(document, textMap);
            //设置文本
            changeText(document, textMap);
        }else {
            //设置文本
            changeText(document, textMap);
            //设置文本框
            changeTextBox(document, textMap);
        }
//        //设置文本框
//        changeTextBox(document, textMap);
//
//        //设置文本
//        changeText(document, textMap);
        //插入表格
        addTableValue(document, autoTableMap);
@@ -1415,7 +1433,13 @@
                MAQTRChart.changeMAQTRChart(document, dataPath);
            } else if (StringUtils.equals(reportType, ReportTypeEnum.CIAQ.getCode())) {
                CIAQChart.changeChart(document, textMap);
            } else {
            } else if (StringUtils.equals(reportType, ReportTypeEnum.LAQ.getCode())) {
                LAQChart.changeChart(document, textMap);
            } else if(StringUtils.equals(reportType, ReportTypeEnum.APIFan.getCode()))
            {
                APIFanChart.changeChart(document,textMap);
            }
            else {
                return;
            }
        }catch (Exception e){