From 2454d84919007c6e11e4f2a3f88bb9552bb598c8 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Tue, 15 Jul 2025 13:48:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/njcn/web/utils/ExcelUtil.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/njcn-springboot/spingboot2.3.12/src/main/java/com/njcn/web/utils/ExcelUtil.java b/njcn-springboot/spingboot2.3.12/src/main/java/com/njcn/web/utils/ExcelUtil.java index eab4c69..53e437a 100644 --- a/njcn-springboot/spingboot2.3.12/src/main/java/com/njcn/web/utils/ExcelUtil.java +++ b/njcn-springboot/spingboot2.3.12/src/main/java/com/njcn/web/utils/ExcelUtil.java @@ -158,13 +158,11 @@ public class ExcelUtil { //没有表格标题,只有表格头 for (int i = 0; i < headerRowNumber; i++) { //获取列数 - int physicalNumberOfCells = sheetAt.getRow(i).getPhysicalNumberOfCells(); - //获取行 Row row = sheetAt.getRow(i); if (Objects.isNull(row)) { continue; } - for (int j = 0; j < physicalNumberOfCells; j++) { + for (int j = row.getFirstCellNum(); j < row.getLastCellNum(); j++) { //获取单元格对象 Cell cell = row.getCell(j); //获取单元格样式对象