From d611114f8de16a6024f6dd8b0c00704f61052a10 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 12 Jul 2021 18:39:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A0=B9=E6=8D=AE=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E7=9A=84=E5=89=8D100=E8=A1=8C=E6=8E=A8=E6=96=ADexcel=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dataset/DataSetTableService.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) 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 e3ed924526..836e3b4435 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -951,16 +951,11 @@ public class DataSetTableService { tableFiled.setFieldName(columnName); tableFiled.setRemarks(columnName); fields.add(tableFiled); - } else if (i == 1) { - if (row == null) { - break; - } - r[j] = readCell(row.getCell(j), true, fields.get(j)); } else { if (row == null) { break; } - r[j] = readCell(row.getCell(j), false, null); + r[j] = readCell(row.getCell(j), true, fields.get(j)); } } if (i > 0) { @@ -1005,16 +1000,11 @@ public class DataSetTableService { tableFiled.setFieldName(columnName); tableFiled.setRemarks(columnName); fields.add(tableFiled); - } else if (i == 1) { - if (row == null) { - break; - } - r[j] = readCell(row.getCell(j), true, fields.get(j)); } else { if (row == null) { break; } - r[j] = readCell(row.getCell(j), false, null); + r[j] = readCell(row.getCell(j), true, fields.get(j)); } } if (i > 0) { @@ -1083,7 +1073,9 @@ public class DataSetTableService { double eps = 1e-10; if (value - Math.floor(value) < eps) { if (cellType) { - tableFiled.setFieldType("LONG"); + if (StringUtils.isEmpty(tableFiled.getFieldType()) || tableFiled.getFieldType().equalsIgnoreCase("TEXT")){ + tableFiled.setFieldType("LONG"); + } } return value.longValue() + ""; } else { @@ -1132,7 +1124,9 @@ public class DataSetTableService { double eps = 1e-10; if (value - Math.floor(value) < eps) { if (cellType) { - tableFiled.setFieldType("LONG"); + if (StringUtils.isEmpty(tableFiled.getFieldType()) || tableFiled.getFieldType().equalsIgnoreCase("TEXT")){ + tableFiled.setFieldType("LONG"); + } } return value.longValue() + ""; } else {