| | |
| | | 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; |
| | |
| | | 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.PAQ.chart.PAQChart; |
| | | import com.ots.project.tool.report.SAQ.chart.SAQChart; |
| | | import org.apache.commons.collections.map.HashedMap; |
| | | import org.apache.poi.ooxml.POIXMLDocument; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //校验文本是否需要替换 |
| | | public static boolean checkText(String text) { |
| | | //替换文本包含% |
| | | if (text.indexOf("%") != -1 || StringUtils.equals(text, "N/A NONE")) { |
| | | return true; |
| | | //只有%大于1 才通过 |
| | | if(getCount(text) > 1){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //判断%出现的次数 |
| | | public static int getCount(String text){ |
| | | //旧长度 |
| | | int oldLength = text.length(); |
| | | text = text.replace("%", ""); |
| | | //新长度 |
| | | int newLength = text.length(); |
| | | //出现次数 = 旧长度 - 新长度 |
| | | int count = oldLength - newLength; |
| | | return count; |
| | | } |
| | | |
| | | 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 { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | private static void changOtherPicture(XWPFParagraph paragraph) { |
| | | |
| | | String paragraphText = paragraph.getText(); |
| | |
| | | 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转pdf |
| | | 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); |
| | |
| | | changeTextBox(document, textMap); |
| | | |
| | | //设置图表 |
| | | if (Objects.equals(reportType, ReportTypeEnum.SAQ.getCode())) { |
| | | SAQChart.changeChart(document, textMap); |
| | | if (Objects.equals(reportType, ReportTypeEnum.PAQ.getCode())) { |
| | | PAQChart.changeChart(document, textMap); |
| | | } |
| | | |
| | | //插入表格 |
| | |
| | | } |
| | | if (StringUtils.equals(reportType, ReportTypeEnum.MAQ.getCode())) { |
| | | setMAQCompleteChars(textMap, charts); |
| | | } else if (StringUtils.equals(reportType, ReportTypeEnum.MAQV2.getCode())) { |
| | | } else if (StringUtils.equals(reportType, ReportTypeEnum.MAQV2.getCode()) || StringUtils.equals(reportType, ReportTypeEnum.MAQ_IAR.getCode())) { |
| | | setMAQ_V2CompleteChars(textMap, charts); |
| | | } else if (StringUtils.equals(reportType, ReportTypeEnum.RuiLin.getCode())) { |
| | | setRuiLinChar(textMap, charts); |
| | |
| | | } |
| | | return result.size(); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | if (!checkText("人才选拔的目的就是找到能够胜任工作、愿意承担工作,且与组织的需求、文化、价值观相匹配的人。PAQ报告是根据候选人对PAQ问卷中题目的作答信息而生成的,测量的是候选人在工作中偏好的行为风格。PAQ也包括了对作答真实性的测量,同时也装入了TAI专有的作假防范程序,可以有效降低候选人的伪装好倾向(全球30%的自评问卷中都出现了伪装好现象)。")) { |
| | | System.out.println("11"); |
| | | } |
| | | } |
| | | } |