From f49ead8710e093ee1d2d3ed50870497f07dee9fa Mon Sep 17 00:00:00 2001 From: k94314517 <8417338+k94314517@user.noreply.gitee.com> Date: 星期五, 09 五月 2025 15:04:38 +0800 Subject: [PATCH] 代码初始化 --- server/system_service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/server/system_service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java b/server/system_service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java index 5408db0..c6f70ac 100644 --- a/server/system_service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java +++ b/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); -- Gitblit v1.9.3