From a136a0db7a02567e543ca94520cba0b241790879 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 20 Sep 2024 12:07:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/dataset/utils/FieldUtils.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/core-backend/src/main/java/io/dataease/dataset/utils/FieldUtils.java b/core/core-backend/src/main/java/io/dataease/dataset/utils/FieldUtils.java index a4fb50b877..c6f84f2971 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/utils/FieldUtils.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/utils/FieldUtils.java @@ -14,6 +14,22 @@ public class FieldUtils { List num = Arrays.asList("INT", "SMALLINT", "MEDIUMINT", "INTEGER", "BIGINT", "LONG", "INT2", "INT4", "INT8", "int2", "int4", "int8", "INT16", "INT32", "INT64", "UINT8", "UINT16", "UINT32", "UINT64"); List doubleList = Arrays.asList("NUMBER", "FLOAT", "DOUBLE", "DECIMAL", "REAL", "MONEY", "NUMERIC", "float4", "float8", "FLOAT4", "FLOAT8", "DECFLOAT", "FLOAT32", "FLOAT64"); List boolType = Arrays.asList("BIT", "TINYINT"); + if (boolType.contains(type)) { + return 4;// 布尔 + } + if (doubleList.contains(type)) { + return 3;// 浮点 + } + if (num.contains(type)) { + return 2;// 整型 + } + if (time.contains(type)) { + return 1;// 时间 + } + if (text.contains(type)) { + return 0;// 文本 + } + if (boolType.stream().anyMatch(l -> type.contains(l))) { return 4;// 布尔 } From dc116ee00c44ecf3e4819e13a42dc11d098398d2 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 20 Sep 2024 12:38:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E9=9B=86=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=88=86=E9=A1=B5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/exportCenter/manage/ExportCenterManage.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java b/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java index bd24f73f09..c4ef77c5fd 100644 --- a/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java +++ b/core/core-backend/src/main/java/io/dataease/exportCenter/manage/ExportCenterManage.java @@ -94,7 +94,7 @@ public class ExportCenterManage { @Value("${dataease.export.max.size:10}") private int max; - @Value("${dataease.export.dataset.limit:20}") + @Value("${dataease.export.dataset.limit:100000}") private int limit; private final static String DATA_URL_TITLE = "data:image/jpeg;base64,"; private static final String exportData_path = "/opt/dataease2.0/data/exportData/"; @@ -424,9 +424,10 @@ public class ExportCenterManage { Workbook wb = new SXSSFWorkbook(); FileOutputStream fileOutputStream = new FileOutputStream(dataPath + "/" + request.getFilename() + ".xlsx"); Sheet detailsSheet = wb.createSheet("数据"); + List> details = new ArrayList<>(); for (Integer p = 0; p < totalPage; p++) { - String querySQL = SQLProvider.createQuerySQLWithLimit(sqlMeta, false, needOrder, false, p * extractPageSize, p * extractPageSize + extractPageSize); + String querySQL = SQLProvider.createQuerySQLWithLimit(sqlMeta, false, needOrder, false, p * extractPageSize + extractPageSize, extractPageSize); if (totalPage == 1) { querySQL = SQLProvider.createQuerySQLWithLimit(sqlMeta, false, needOrder, false, 0, totalCount.intValue()); } @@ -448,7 +449,7 @@ public class ExportCenterManage { for (DatasetTableFieldDTO field : allFields) { header.add(field.getName()); } - List> details = new ArrayList<>(); + details.add(header); for (Map obj : data) { List row = new ArrayList<>(); @@ -477,7 +478,7 @@ public class ExportCenterManage { } } } else { - List> details = new ArrayList<>(); + details.clear(); for (Map obj : data) { List row = new ArrayList<>(); for (DatasetTableFieldDTO field : allFields) {