k94314517
2025-05-09 f49ead8710e093ee1d2d3ed50870497f07dee9fa
server/system_service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java
@@ -447,13 +447,16 @@
                List<String> rowList = dataList.get(i);
                for (int j = 0; j < rowList.size(); j++) {
                    Cell cell = row.createCell(j);
                    cell.setCellValue(rowList.get(j));
                    if(i ==0 || j==0){
                        // 列宽设置
                        sheet.setColumnWidth(i, rowList.get(i).length() * 2 * 256);
                        // 设置列头单元格
                        cell.setCellStyle(hstyle);
                    if(i==0&&j==0){
                        cell.setCellValue("数据日期");
                    }else{
                        cell.setCellValue(rowList.get(j));
                    }
                    if(i==0){
                        sheet.setColumnWidth(i, rowList.get(i).length() * 2 * 256);
                        cell.setCellStyle(hstyle);
                    }else if(j==0){
                        cell.setCellStyle(rowStyle);
                    }
                }
@@ -473,6 +476,7 @@
        }
    }
    private static CellStyle configHeaderCellStatic (SXSSFWorkbook workbook)  {
        CellStyle style = workbook.createCellStyle();
        style.setAlignment(HorizontalAlignment.CENTER);
@@ -482,7 +486,7 @@
        style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
        // 字体
        Font font = workbook.createFont();
        font.setFontHeightInPoints((short) 12);
        font.setFontHeightInPoints((short) 10);
        style.setFont(font);
        // 设置边框
        configCellBorder(style);