From 0c045df28935e21879b8c0b58b58311c011294c5 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期五, 09 五月 2025 16:42:52 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- 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