[测评系统]--测评系统核心代码库
林致杰
2022-08-02 c0c92ddfa2a626d2794f4b5e184cf9deed4086f3
src/main/java/com/ots/project/tool/report/MAQTR/chart/MAQTRChart.java
@@ -34,9 +34,9 @@
    public static void main(String[] args) throws IOException {
        try {
            OutputStream os = new FileOutputStream("C:\\Users\\大头\\Desktop\\MAQ组别报告\\林_PAQ_IA_CN2.docx");
            XWPFDocument document = new XWPFDocument(POIXMLDocument.openPackage("C:\\Users\\大头\\Desktop\\MAQ组别报告\\终稿【0607中文版】MAQ组别对比报告.docx"));
            XWPFDocument document = new XWPFDocument(POIXMLDocument.openPackage("C:\\Users\\大头\\Desktop\\MAQ组别报告\\终稿【0607中文版】MAQ组别对比报告(1).docx"));
            String fileName = "C:\\Users\\大头\\Desktop\\MAQ组别报告\\组别对比报告测试数据.xlsx";
            String fileName = "C:\\Users\\大头\\Desktop\\MAQ组别报告\\MAQ组别导入数据模板 (2).xlsx";
            //变更图表数据
            changeMAQTRChart(document,fileName);
            document.write(os);
@@ -65,9 +65,15 @@
                //行
                for (int j = 1; j <= sheet.getLastRowNum(); j++) {
                    XSSFRow row = sheet.getRow(j);
                    if(row == null){
                        continue;
                    }
                    //列
                    for (int k = 1; k < row.getLastCellNum(); k++) {
                        XSSFCell cell = row.getCell(k);
                        if(cell == null){
                            continue;
                        }
/*
                        if (CellType.NUMERIC == cell.getCellType()) {
                            System.out.println(cell.getNumericCellValue());
@@ -75,6 +81,10 @@
                            System.out.println(cell.getStringCellValue());
                        }
*/
                        switch (cell.getCellType()) {
                            case STRING:
                                continue;
                        }
                        //table1 多个答题结果处理
                        if(map.get(k) != null){
                            map.get(k).add(cell.getNumericCellValue());
@@ -495,9 +505,12 @@
            }
            //删除多余行数
            int lastRowNum = sheet.getLastRowNum();
            //log.error("lastRowNum:{},size:{}",lastRowNum,size);
            log.error("lastRowNum:{},size:{}",lastRowNum,size);
            if (lastRowNum > size) {
                for (int idx = lastRowNum; idx > size; idx--) {
                    if(sheet.getRow(idx) == null){
                        continue;
                    }
                    sheet.removeRow(sheet.getRow(idx));
                }
            }