Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
junjie 2021-05-18 16:38:38 +08:00
commit c0e0e617f4
2 changed files with 11 additions and 1 deletions

View File

@ -664,6 +664,7 @@ public class DataSetTableService {
tableFiled.setFieldName(readCell(row.getCell(j))); tableFiled.setFieldName(readCell(row.getCell(j)));
tableFiled.setRemarks(readCell(row.getCell(j))); tableFiled.setRemarks(readCell(row.getCell(j)));
tableFiled.setFieldType("TEXT"); tableFiled.setFieldType("TEXT");
tableFiled.setFieldSize(1024);
if(StringUtils.isEmpty(tableFiled.getFieldName())){ if(StringUtils.isEmpty(tableFiled.getFieldName())){
continue; continue;
} }
@ -698,6 +699,9 @@ public class DataSetTableService {
tableFiled.setRemarks(readCell(row.getCell(j))); tableFiled.setRemarks(readCell(row.getCell(j)));
tableFiled.setFieldType("TEXT"); tableFiled.setFieldType("TEXT");
tableFiled.setFieldSize(1024); tableFiled.setFieldSize(1024);
if(StringUtils.isEmpty(tableFiled.getFieldName())){
continue;
}
fields.add(tableFiled); fields.add(tableFiled);
} else { } else {
r[j] = readCell(row.getCell(j)); r[j] = readCell(row.getCell(j));

View File

@ -497,8 +497,14 @@ public class ExtractDataService {
} }
private StepMeta excelInputStep(String filePath, List<DatasetTableField> datasetTableFields) { private StepMeta excelInputStep(String filePath, List<DatasetTableField> datasetTableFields) {
String suffix = filePath.substring(filePath.lastIndexOf(".") + 1);
ExcelInputMeta excelInputMeta = new ExcelInputMeta(); ExcelInputMeta excelInputMeta = new ExcelInputMeta();
excelInputMeta.setSpreadSheetType(SpreadSheetType.SAX_POI); if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) {
excelInputMeta.setSpreadSheetType(SpreadSheetType.SAX_POI);
}
if (StringUtils.equalsIgnoreCase(suffix, "xls")) {
excelInputMeta.setSpreadSheetType(SpreadSheetType.JXL);
}
excelInputMeta.setPassword("Encrypted"); excelInputMeta.setPassword("Encrypted");
excelInputMeta.setFileName(new String[]{filePath}); excelInputMeta.setFileName(new String[]{filePath});
excelInputMeta.setStartsWithHeader(true); excelInputMeta.setStartsWithHeader(true);