diff --git a/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java b/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java index 9fa6b85ca0..74d045d614 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java @@ -351,7 +351,7 @@ public class ExcelUtils { ReadCellData cellData = headMap.get(key); String value = cellData.getStringValue(); if (StringUtils.isEmpty(value)) { - DEException.throwException(context.readSheetHolder().getSheetName() + ", 首行行中不允许有空单元格!"); + continue; } headerKey.add(key); header.add(value); diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index d6550acdba..3e07e263b4 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -755,7 +755,7 @@ public class DatasourceServer implements DatasourceApi { } } } - if (CollectionUtils.isEmpty(excelSheetDataList)) { + if (CollectionUtils.isEmpty(excelSheetDataList) || excelSheetDataList.size() != datasetTableDTOS.size()) { DEException.throwException("上传文件与源文件不一致,请检查文件!"); } excelFileData.setSheets(excelSheetDataList);