| | |
| | | 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.CIAQ.chart.CIAQChart; |
| | | 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; |
| | | import org.apache.poi.ooxml.POIXMLDocument; |
| | | import org.apache.poi.openxml4j.exceptions.InvalidFormatException; |
| | | import org.apache.poi.openxml4j.util.ZipSecureFile; |
| | | import org.apache.poi.util.Units; |
| | | import org.apache.poi.xwpf.usermodel.*; |
| | | import org.apache.xmlbeans.XmlCursor; |
| | |
| | | |
| | | if (checkText(runValue)) { |
| | | runValue = runValue.replaceAll("%.*%", ""); |
| | | runValue = runValue.replaceAll("N/A NONE", ""); |
| | | |
| | | } |
| | | runValue = runValue.replaceAll("N/A NONE", ""); |
| | | |
| | | return runValue; |
| | | } |
| | |
| | | changColorIfJAQ(textMap, out, reportName, tReportTemplate.getReportType()); |
| | | //} |
| | | |
| | | //PAQ、MAQTR采用新的doc转pdf |
| | | if(ReportTypeEnum.PAQ.getCode().equals(reportType) || ReportTypeEnum.MAQTR.getCode().equals(reportType)){ |
| | | //PAQ、MAQTR采用、CIAQ新的doc转pdf |
| | | if(ReportTypeEnum.PAQ.getCode().equals(reportType) || ReportTypeEnum.MAQTR.getCode().equals(reportType) |
| | | || ReportTypeEnum.CIAQ.getCode().equals(reportType)){ |
| | | PdfUtil.convertPDF(EssConfig.getProfile() + "/" + reportName); |
| | | }else if(ReportTypeEnum.LAQ.getCode().equals(reportType)){ |
| | | PdfUtil.convertPythonPDF(EssConfig.getDocx2pdf(),EssConfig.getProfile() + "/" + reportName); |
| | | }else{ |
| | | ShellTool.execLibreofficeCommand("pdf", EssConfig.getProfile() + "/" + reportName, EssConfig.getProfile() + "/"); |
| | | // ShellTool shellTool = ShellTool.builder(); |
| | |
| | | */ |
| | | private static void setChageWord(String fileName, OutputStream out, Map<String, Object> textMap, String reportType,String dataPath, Map<Integer, Map<Integer, List<String[]>>> autoTableMap) throws IOException, InvalidFormatException, DocumentException { |
| | | //String filePath = getTemplateDownLoadPathByUpLoad(fileName); |
| | | ZipSecureFile.setMinInflateRatio(0.001); |
| | | |
| | | XWPFDocument document = new XWPFDocument(POIXMLDocument.openPackage(getTemplateDownLoadPathByUpLoad(fileName))); |
| | | |
| | |
| | | repText = repText.replaceAll("<BoldText>", ""); |
| | | repText = repText.replaceAll("</BoldText>", ""); |
| | | } |
| | | if (repText.indexOf("N/A NONE") != -1) { |
| | | /* if (repText.indexOf("N/A NONE") != -1) { |
| | | repText = repText.replaceAll("N/A NONE", ""); |
| | | } |
| | | }*/ |
| | | return repText; |
| | | } |
| | | public static void changTableColor(String fileName, OutputStream out, List<JAQTableStyle> jaqTableStyleList) throws IOException { |
| | |
| | | PAQChart.changeChart(document, textMap); |
| | | } else if (StringUtils.equals(reportType, ReportTypeEnum.MAQTR.getCode())) { |
| | | MAQTRChart.changeMAQTRChart(document, dataPath); |
| | | } else if (StringUtils.equals(reportType, ReportTypeEnum.CIAQ.getCode())) { |
| | | CIAQChart.changeChart(document, textMap); |
| | | } else { |
| | | return; |
| | | } |