|
|
@ -71,9 +71,9 @@ public class UpgradeHandler extends HWAbstractHandler { |
|
|
|
JSONObject finalResult = JSONObject.create(); |
|
|
|
JSONObject finalResult = JSONObject.create(); |
|
|
|
|
|
|
|
|
|
|
|
List<FineBusinessTable> allTables = CellCreator.getCellProvider().tableCell().getAllTableWithoutAuth(); |
|
|
|
List<FineBusinessTable> allTables = CellCreator.getCellProvider().tableCell().getAllTableWithoutAuth(); |
|
|
|
allTables.forEach(fineBusinessTable -> { |
|
|
|
|
|
|
|
|
|
|
|
allTables.stream().filter(fineBusinessTable -> fineBusinessTable instanceof FineExcelBusinessTable).limit(15).forEach(fineBusinessTable -> { |
|
|
|
Map<String, List> values = new HashMap<String, List>(); |
|
|
|
Map<String, List> values = new HashMap<String, List>(); |
|
|
|
if (fineBusinessTable instanceof FineExcelBusinessTable) { |
|
|
|
|
|
|
|
JSONArray items = JSONArray.create(); |
|
|
|
JSONArray items = JSONArray.create(); |
|
|
|
FineAttachment sheetInfo = ((FineExcelBusinessTable) fineBusinessTable).getBaseAttach(); |
|
|
|
FineAttachment sheetInfo = ((FineExcelBusinessTable) fineBusinessTable).getBaseAttach(); |
|
|
|
String attachId = sheetInfo.getId(); |
|
|
|
String attachId = sheetInfo.getId(); |
|
|
@ -82,6 +82,7 @@ public class UpgradeHandler extends HWAbstractHandler { |
|
|
|
|
|
|
|
|
|
|
|
List<FineBusinessField> fields = ((FineExcelBusinessTable) fineBusinessTable).getExcelFields(); |
|
|
|
List<FineBusinessField> fields = ((FineExcelBusinessTable) fineBusinessTable).getExcelFields(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
if (fileName.endsWith(".xlsx")) { |
|
|
|
if (fileName.endsWith(".xlsx")) { |
|
|
|
XSSFWorkbook excelWork = HWUtils.getExcelWork(attachId); |
|
|
|
XSSFWorkbook excelWork = HWUtils.getExcelWork(attachId); |
|
|
|
if(excelWork != null){ |
|
|
|
if(excelWork != null){ |
|
|
@ -92,7 +93,7 @@ public class UpgradeHandler extends HWAbstractHandler { |
|
|
|
tableCol.put(field.getName(), i); |
|
|
|
tableCol.put(field.getName(), i); |
|
|
|
|
|
|
|
|
|
|
|
JSONObject item = new JSONObject(); |
|
|
|
JSONObject item = new JSONObject(); |
|
|
|
item.put("colLength", "255"); |
|
|
|
item.put("colLength", "8000"); |
|
|
|
item.put("colName", field.getName()); |
|
|
|
item.put("colName", field.getName()); |
|
|
|
item.put("colType", this.getFieldSqlType(field.getType())); |
|
|
|
item.put("colType", this.getFieldSqlType(field.getType())); |
|
|
|
item.put("excelCol", i); |
|
|
|
item.put("excelCol", i); |
|
|
@ -112,7 +113,7 @@ public class UpgradeHandler extends HWAbstractHandler { |
|
|
|
tableCol.put(field.getName(), i); |
|
|
|
tableCol.put(field.getName(), i); |
|
|
|
|
|
|
|
|
|
|
|
JSONObject item = new JSONObject(); |
|
|
|
JSONObject item = new JSONObject(); |
|
|
|
item.put("colLength", "255"); |
|
|
|
item.put("colLength", "8000"); |
|
|
|
item.put("colName", field.getName()); |
|
|
|
item.put("colName", field.getName()); |
|
|
|
item.put("colType", this.getFieldSqlType(field.getType())); |
|
|
|
item.put("colType", this.getFieldSqlType(field.getType())); |
|
|
|
item.put("excelCol", i); |
|
|
|
item.put("excelCol", i); |
|
|
@ -123,8 +124,11 @@ public class UpgradeHandler extends HWAbstractHandler { |
|
|
|
values = HWUtils.get2003SheetContent(sheetAt,0, tableCol); |
|
|
|
values = HWUtils.get2003SheetContent(sheetAt,0, tableCol); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e){ |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
String schema = ""; |
|
|
|
String schema = "guest"; |
|
|
|
String tableName = fineBusinessTable.getName(); |
|
|
|
String tableName = fineBusinessTable.getName(); |
|
|
|
|
|
|
|
|
|
|
|
ExcelDmlAction excelDmlAction = ActionFactory.getInstance().create("add"); |
|
|
|
ExcelDmlAction excelDmlAction = ActionFactory.getInstance().create("add"); |
|
|
@ -176,8 +180,6 @@ public class UpgradeHandler extends HWAbstractHandler { |
|
|
|
} catch(Exception e){ |
|
|
|
} catch(Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
WebUtils.printAsJSON(res, finalResult.put("importDbResult", importDbResult).put("addDbResult", addDbResult)); |
|
|
|
WebUtils.printAsJSON(res, finalResult.put("importDbResult", importDbResult).put("addDbResult", addDbResult)); |
|
|
|