fix(数据集): 上传csv文件失败
This commit is contained in:
parent
ec5cec2e21
commit
ccfbc61a07
@ -2375,8 +2375,6 @@ public class DataSetTableService {
|
||||
public List<ExcelSheetData> parseExcel(String filename, InputStream inputStream, boolean isPreview) throws Exception {
|
||||
List<ExcelSheetData> excelSheetDataList = new ArrayList<>();
|
||||
String suffix = filename.substring(filename.lastIndexOf(".") + 1);
|
||||
excelSheetDataList = excelSheetDataList(inputStream, isPreview);
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(suffix, "csv")) {
|
||||
List<TableField> fields = new ArrayList<>();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
|
||||
@ -2418,6 +2416,8 @@ public class DataSetTableService {
|
||||
excelSheetData.setExcelLabel(filename);
|
||||
excelSheetData.setFieldsMd5(Md5Utils.md5(StringUtils.join(fieldArray, ",")));
|
||||
excelSheetDataList.add(excelSheetData);
|
||||
}else {
|
||||
excelSheetDataList = excelSheetDataList(inputStream, isPreview);
|
||||
}
|
||||
|
||||
inputStream.close();
|
||||
|
||||
@ -757,8 +757,6 @@ public class ExtractDataService {
|
||||
for (ExcelSheetData excelSheetData : excelSheetDataList) {
|
||||
String suffix = excelSheetData.getPath().substring(excelSheetData.getPath().lastIndexOf(".") + 1);
|
||||
List<ExcelSheetData> totalSheets = new ArrayList<>();
|
||||
totalSheets = dataSetTableService.excelSheetDataList(new FileInputStream(excelSheetData.getPath()), false);
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(suffix, "csv")) {
|
||||
List<TableField> fields = new ArrayList<>();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(excelSheetData.getPath()), StandardCharsets.UTF_8));
|
||||
@ -796,6 +794,8 @@ public class ExtractDataService {
|
||||
csvSheetData.setExcelLabel(excelSheetData.getExcelLabel());
|
||||
csvSheetData.setFieldsMd5(Md5Utils.md5(StringUtils.join(fieldArray, ",")));
|
||||
totalSheets = Arrays.asList(csvSheetData);
|
||||
}else {
|
||||
totalSheets = dataSetTableService.excelSheetDataList(new FileInputStream(excelSheetData.getPath()), false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user