[测评系统]--测评系统核心代码库
zhijie
2023-11-15 560e61f5348aa726a19edd1ab380c84938cabd49
新增perfomance参数
2个文件已修改
42 ■■■■ 已修改文件
src/main/java/com/ots/project/tool/report/LAQ/LAQTemplate.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ots/project/tool/report/LAQ/chart/LAQChart.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ots/project/tool/report/LAQ/LAQTemplate.java
@@ -57,4 +57,7 @@
    @Excel(name = "EMOSTA")
    private BigDecimal emosta;
    @Excel(name = "Perfomance")
    private BigDecimal perfomance;
}
src/main/java/com/ots/project/tool/report/LAQ/chart/LAQChart.java
@@ -48,7 +48,7 @@
    public static void main(String[] args) throws Exception {
/*        String dataPath = "D:\\测评系统\\需求\\2023\\5.领导潜力报告\\report\\LAQ表头数据文件.xlsx";
        /*String dataPath = "D:\\测评系统\\需求\\LAQ\\report\\LAQ表头数据文件.xlsx";
        // 获取导入数据
        File file = new File(dataPath);
        InputStream in = new FileInputStream(file);
@@ -60,10 +60,22 @@
        for (int i = 0; i < laqTemplateList.size(); i++) {
            LAQTemplate laqTemplate = laqTemplateList.get(i);
            //组装报告所用数据
            Map<String, String> textMap = new HashMap<>();
            textMap.put("sendEmailFileName",laqTemplate.getName());
            textMap.put("nowDate", DateUtils.getDate());
            MapDataUtil.objectToMap(laqTemplate,textMap);
            Map<String, Object> textMap = new HashMap<>();
//            textMap.put("sendEmailFileName",laqTemplate.getName());
//            textMap.put("nowDate", DateUtils.getDate());
//            MapDataUtil.objectToMap(laqTemplate,textMap);
            textMap.put("olas","50");
            textMap.put("ca","32");
            textMap.put("bla","34");
            textMap.put("nr","3");
            textMap.put("ar","45");
            textMap.put("open","67");
            textMap.put("cons","12");
            textMap.put("extra","48");
            textMap.put("agree","90");
            textMap.put("emosta","23");
            textMap.put("perfomance","80");
            LAQReport report = new LAQReport();
//            ReportResultData resultData = report.getTemplateParameters(textMap, ReportTypeEnum.LAQ, LangTypeEnum.codeOf("English"));
@@ -71,7 +83,7 @@
//            String zipFileName = WordUtil.makeReportFile("D:\\测评系统\\需求\\LAQ\\report\\LAQ英文报告-20230926.docx", template, textMap, new HashMap<>(), deleteStrList);
//            fileNameList.add(zipFileName);
            ZipSecureFile.setMinInflateRatio(0.001);
            try (OutputStream os = new FileOutputStream("D:\\测评系统\\需求\\2023\\5.领导潜力报告\\report\\LAQ编译报告.docx");XWPFDocument document = new XWPFDocument(POIXMLDocument.openPackage("D:\\测评系统\\需求\\2023\\5.领导潜力报告\\report\\LAQ中文模板.docx"))){
            try (OutputStream os = new FileOutputStream("D:\\测评系统\\需求\\LAQ\\report\\LAQ英文模板-wzp-修改版-1.docx");XWPFDocument document = new XWPFDocument(POIXMLDocument.openPackage("D:\\测评系统\\需求\\LAQ\\report\\LAQ英文模板-wzp-修改版.docx"))){
                Map<Integer,List<SeriesData>> seriesDatas = initData(textMap);
                changeChart(document,seriesDatas,textMap);
                document.write(os);
@@ -112,6 +124,7 @@
        Double extra = Double.valueOf((String)textMap.get("extra"));
        Double agree = Double.valueOf((String)textMap.get("agree"));
        Double emosta = Double.valueOf((String)textMap.get("emosta"));
        Double perfomance = Double.valueOf((String)textMap.get("perfomance"));
        // 图表1
        List<SeriesData> seriesDatas = Arrays.asList(
@@ -267,6 +280,17 @@
        );
        seriesDataMap.put(10,seriesDatas);
        // 图表11
        seriesDatas = Arrays.asList(
                new SeriesData("X 值", Arrays.asList(
                        new RowData("X 值", olas.doubleValue())
                )),
                new SeriesData("Y 值", Arrays.asList(
                        new RowData("Y 值", perfomance.doubleValue())
                ))
        );
        seriesDataMap.put(11,seriesDatas);
        return seriesDataMap;
    }
@@ -318,7 +342,7 @@
                    //散点图
                    if (!plot.getScatterChartList().isEmpty()) {
                        List<SeriesData> seriesDatas = seriesDataMap.get(10);
                        List<SeriesData> seriesDatas = seriesDataMap.get(barIndex);
                        CTScatterChart scatterChart = plot.getScatterChartArray(0);
                        //System.out.println("散点图{"+plot.getScatterChartList().size()+"}");
                        //刷新内置excel数据
@@ -335,6 +359,7 @@
                            updateScatterChart(seriesDatas, ser.getXVal(), ser.getYVal());
                            ++i;
                        }
                        barIndex++;
                    }
                }
            }