| | |
| | | import com.ots.project.tool.report.JAQ.condition.Table2; |
| | | import com.ots.project.tool.report.JAQ.condition.Table3; |
| | | import com.ots.project.tool.report.JAQ.condition.Table4; |
| | | import com.ots.project.tool.report.SAQ.chart.SAQChart; |
| | | import org.apache.commons.collections.map.HashedMap; |
| | | import org.apache.poi.ooxml.POIXMLDocument; |
| | | import org.apache.poi.openxml4j.exceptions.InvalidFormatException; |
| | |
| | | if (run.toString().indexOf("%TTime%") != -1) { |
| | | run.setText(textMap.get("reportGenerationDate").toString(), 0); |
| | | } |
| | | if (run.toString().indexOf("%LIBSAQGS0018%") != -1) { |
| | | run.setText(textMap.get("LIBSAQGS0018").toString(), 0); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | public static CTAnchor getAnchorWithGraphic(CTGraphicalObject ctGraphicalObject, |
| | | String deskFileName, int width, int height, |
| | | int leftOffset, int topOffset, boolean behind, int topPosition) { |
| | | long relativeHeight = 251649024l + topPosition; |
| | | long relativeHeight = 251649024L + topPosition; |
| | | String anchorXML = |
| | | "<wp:anchor xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" " |
| | | + "simplePos=\"0\" relativeHeight=\"" + relativeHeight + "\" behindDoc=\"" + ((behind) ? 1 : 0) + "\" locked=\"0\" layoutInCell=\"1\" allowOverlap=\"1\">" |
| | |
| | | } |
| | | |
| | | public static String changeValue(String runValue, Map<String, Object> textMap, XWPFRun run, XWPFParagraph paragraph, XWPFDocument document, int runPosition) throws IOException, org.apache.poi.openxml4j.exceptions.InvalidFormatException { |
| | | |
| | | log.debug("changeText:{}",runValue); |
| | | Set<Map.Entry<String, Object>> textSets = textMap.entrySet(); |
| | | for (Map.Entry<String, Object> textSet : textSets) { |
| | | |
| | |
| | | //设置文本 |
| | | changeText(document, textMap); |
| | | |
| | | //更改文本框 |
| | | if (Objects.equals(reportType, ReportTypeEnum.MAQV2.getCode())) { |
| | | changeTextBox(document, textMap); |
| | | } |
| | | //设置文本框 |
| | | changeTextBox(document, textMap); |
| | | |
| | | //CAQ更改文本框,wzp测试.2021.4.27 |
| | | if (Objects.equals(reportType, ReportTypeEnum.CAQ.getCode())) { |
| | | changeTextBox(document, textMap); |
| | | //设置图表 |
| | | if (Objects.equals(reportType, ReportTypeEnum.SAQ.getCode())) { |
| | | SAQChart.changeChart(document, textMap); |
| | | } |
| | | |
| | | //插入表格 |
| | |
| | | } |
| | | } |
| | | private static String getValByKey(String text, Map<String, Object> textMap) { |
| | | log.debug("changeTextBox:{}",text); |
| | | if (!checkText(text)) { |
| | | return text; |
| | | } |