From 9b63799bad0a988ed577384e96d5066b8e614817 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 21 Jul 2023 10:47:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=8E=BB=E6=8E=89=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dataset/DataSetTableService.java | 50 ------------------- 1 file changed, 50 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 9ec95c5178..8bb823aba2 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -2425,56 +2425,6 @@ public class DataSetTableService { return excelFileData; } - // public List parseExcel(String filename, InputStream inputStream, boolean isPreview) throws Exception { -// List excelSheetDataList = new ArrayList<>(); -// try { -// String suffix = filename.substring(filename.lastIndexOf(".") + 1); -// if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) { -// -// } -// -// if (StringUtils.equalsIgnoreCase(suffix, "csv")) { -// List fields = new ArrayList<>(); -// BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); -// String s = reader.readLine();// first line -// String[] split = s.split(","); -// for (String s1 : split) { -// TableField tableFiled = new TableField(); -// tableFiled.setName(s1); -// tableFiled.setOriginName(s1); -// tableFiled.setFieldType("TEXT"); -// fields.add(tableFiled); -// } -// List data = csvData(reader, isPreview); -// ExcelSheetData excelSheetData = new ExcelSheetData(); -// String[] fieldArray = fields.stream().map(TableField::getName).toArray(String[]::new); -// excelSheetData.setFields(fields); -// excelSheetData.setData(data); -// excelSheetData.setExcelLabel(filename.substring(0, filename.lastIndexOf('.'))); -// excelSheetDataList.add(excelSheetData); -// } -// inputStream.close(); -// for (ExcelSheetData excelSheetData : excelSheetDataList) { -// List data = excelSheetData.getData(); -// String[] fieldArray = excelSheetData.getFields().stream().map(TableField::getName).toArray(String[]::new); -// -// List> jsonArray = new ArrayList<>(); -// if (data != null) { -// jsonArray = data.stream().map(ele -> { -// Map map = new HashMap<>(); -// for (int i = 0; i < fieldArray.length; i++) { -// map.put(fieldArray[i], i < ele.length ? ele[i] : ""); -// } -// return map; -// }).collect(Collectors.toList()); -// } -// excelSheetData.setJsonArray(jsonArray); -// }; -// } catch (Exception e) { -// DEException.throwException(e); -// } -// return excelSheetDataList; -// } public List excelSheetDataList(InputStream inputStream, boolean isPreview) { List excelSheetDataList = new ArrayList<>(); NoModelDataListener noModelDataListener = new NoModelDataListener();