From 684134f2c779f90e68f6027bfc299f92fd2fff80 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 2 Jul 2021 15:31:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(excel):=20=E8=AF=86=E5=88=AB=20excel=20?= =?UTF-8?q?=E5=88=97=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/service/dataset/DataSetTableService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java index 6ce5e7bb4e..a616ef3c06 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -890,7 +890,7 @@ public class DataSetTableService { if (row == null) { throw new RuntimeException(Translator.get("i18n_excel_header_empty")); } - columnNum = row.getPhysicalNumberOfCells(); + columnNum = row.getLastCellNum(); } String[] r = new String[columnNum]; for (int j = 0; j < columnNum; j++) { @@ -902,6 +902,7 @@ public class DataSetTableService { if (StringUtils.isEmpty(columnName)) { columnName = "NONE_" + String.valueOf(j); } + tableFiled.setFieldName(columnName); tableFiled.setRemarks(columnName); fields.add(tableFiled);