|
@@ -185,9 +185,6 @@ public class CommonFileController {
|
|
|
@PostMapping(value = "/uploadData", headers = "content-type=multipart/form-data")
|
|
|
public AjaxResult uploadDataFile(@RequestPart("file") MultipartFile file) throws Exception {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
-
|
|
|
- System.out.println(file.getOriginalFilename().substring(0, file.getOriginalFilename().indexOf(".")));
|
|
|
-
|
|
|
map.put("tableName", file.getOriginalFilename().substring(0, file.getOriginalFilename().indexOf(".")));
|
|
|
map.put("databaseType", SecurityUtils.getDatabaseType());
|
|
|
map.put("databaseName", SecurityUtils.getDatabaseName());
|
|
@@ -211,24 +208,19 @@ public class CommonFileController {
|
|
|
// 新增 // 删除当前map中的k/v
|
|
|
item.put(listMap.get(0).get(mKey), item.remove(mKey));
|
|
|
});
|
|
|
- System.out.println(listMap);
|
|
|
- System.out.println("-----------------");
|
|
|
});
|
|
|
listMap.remove(0);
|
|
|
Map<String, Object> endMap = new HashMap<>();
|
|
|
endMap.put("tableName", "test");
|
|
|
endMap.put("field", listMap);
|
|
|
- commonService.batchInsert(endMap);
|
|
|
- for (Map<String, String> data : listMap) {
|
|
|
- log.info(JSON.toJSONString(data));
|
|
|
- }
|
|
|
+ return success(commonService.batchInsert(endMap));
|
|
|
} catch (Exception e) {
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
}
|
|
|
- return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
+ // map类型转换
|
|
|
public static List<Map<String, String>> convertList(List<Map<Integer, String>> inputList) {
|
|
|
List<Map<String, String>> resultList = new ArrayList<>();
|
|
|
for (Map<Integer, String> inputMap : inputList) {
|