| | |
| | | |
| | | //自我认知准确度 |
| | | private static String p_sdecepT1; |
| | | private static String p_sdecept10; |
| | | private static String p_sdecep10; |
| | | //自我阐述的真实度 |
| | | private static String p_impmgT1; |
| | | private static String p_impmg11; |
| | |
| | | textMap.put("P_Emotct07","60"); |
| | | textMap.put("P_Stress08","61"); |
| | | textMap.put("P_SdecepT1","62"); |
| | | textMap.put("P_Sdecept10","63"); |
| | | textMap.put("P_Sdecep10","63"); |
| | | textMap.put("P_ImpmgT1","64"); |
| | | textMap.put("P_Impmg11","65"); |
| | | textMap.put("BST1","66"); |
| | |
| | | return false; |
| | | } |
| | | //图表数据 |
| | | changePAQChart(document,seriesDatas); |
| | | changeAPIFanChart(document,seriesDatas); |
| | | return true; |
| | | } |
| | | |
| | |
| | | p_stress08 = (String) textMap.get("P_Stress08"); |
| | | |
| | | p_sdecepT1 = (String) textMap.get("P_SdecepT1"); |
| | | p_sdecept10 = (String) textMap.get("P_Sdecept10"); |
| | | p_sdecep10 = (String) textMap.get("P_Sdecep10"); |
| | | p_impmgT1 = (String) textMap.get("P_ImpmgT1"); |
| | | p_impmg11 = (String) textMap.get("P_Impmg11"); |
| | | bst1 = (String) textMap.get("BST1"); |
| | | bst2 = (String) textMap.get("BST2"); |
| | | |
| | | String[] paramValue = new String[]{p_total, p_retent09, p_social01,p_cooper02,p_analth03,p_initia04, |
| | | p_persis05,p_depend06,p_emotct07,p_stress08,p_sdecepT1, p_sdecept10,p_impmgT1,p_impmg11,bst1,bst2}; |
| | | p_persis05,p_depend06,p_emotct07,p_stress08,p_sdecepT1, p_sdecep10,p_impmgT1,p_impmg11,bst1,bst2}; |
| | | |
| | | //判断是否为空 |
| | | if (checkParamsIsNull(paramValue)) |
| | |
| | | Double P_Emotct07 = Double.valueOf(p_emotct07); |
| | | Double P_Stress08 = Double.valueOf(p_stress08); |
| | | Double P_SdecepT1 = Double.valueOf(p_sdecepT1); |
| | | Double P_Sdecept10 = Double.valueOf(p_sdecept10); |
| | | Double P_Sdecep10 = Double.valueOf(p_sdecep10); |
| | | Double P_ImpmgT1 = Double.valueOf(p_impmgT1); |
| | | Double P_Impmg11 = Double.valueOf(p_impmg11); |
| | | Double BST1 = Double.valueOf(bst1); |
| | |
| | | |
| | | )), |
| | | new SeriesData("自我认知的准确度", Arrays.asList( |
| | | new RowData("自我认知的准确度", P_Sdecept10),//顺序要倒置 |
| | | new RowData("自我认知的准确度", P_Sdecep10),//顺序要倒置 |
| | | new RowData("自我认知的准确度", P_SdecepT1)//顺序要倒置 |
| | | |
| | | )), |
| | |
| | | * @param doc |
| | | * @param seriesDatas |
| | | */ |
| | | public static void changePAQChart(XWPFDocument doc,List<SeriesData> seriesDatas) { |
| | | public static void changeAPIFanChart(XWPFDocument doc,List<SeriesData> seriesDatas) { |
| | | try { |
| | | //动态刷新图表 |
| | | List<POIXMLDocumentPart> relations = doc.getRelations(); |
| | |
| | | // excel内置表格 |
| | | XSSFWorkbook workbook = chart.getWorkbook(); |
| | | XSSFSheet sheet = workbook.getSheetAt(0); |
| | | |
| | | String sheetName = sheet.getSheetName(); |
| | | |
| | | //柱形图 |
| | | if (!plot.getBarChartList().isEmpty()) { |
| | | CTBarChart barChart = plot.getBarChartArray(0); |
| | | //刷新内置excel数据 |
| | | List<SeriesData> excelData = new ArrayList<>(); |
| | | excelData.add(seriesDatas.get(k)); |
| | | //excelData.add(seriesDatas.get(k)); |
| | | |
| | | //通过sheetName来解决匹配多表的问题 |
| | | SeriesData seriesData = seriesDatas.stream() |
| | | .filter(item -> item.getName().equals(sheetName)) |
| | | .findFirst() |
| | | .orElse(null); |
| | | excelData.add(seriesData); |
| | | refreshExcel(excelData, workbook, sheet); |
| | | workbook.write(chart.getPackagePart().getOutputStream()); |
| | | |
| | | //柱形图数据源 |
| | | List<SeriesData> barDatas = seriesDatas; |
| | | // List<SeriesData> barDatas = seriesDatas; |
| | | int i = 0; |
| | | for (CTBarSer ser : barChart.getSerList()) { |
| | | //更新柱形图数据缓存 |
| | | updateBarChart(barDatas.get(k), ser.getVal()); |
| | | updateBarChart(seriesData, ser.getVal()); |
| | | ++i; |
| | | } |
| | | |