|
|
|
@ -552,7 +552,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
success = false;
|
|
|
|
|
saveIdcLog(messageType,"",tableName +">fail:上传地址未连通",i *limit,total);
|
|
|
|
|
saveIdcLog(messageType,"",syncIp+":"+tableName +">fail:上传地址未连通",i *limit,total);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if(!StringUtils.isEmpty(recordSql)) {
|
|
|
|
@ -602,16 +602,22 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
/*解析到数据库*/
|
|
|
|
|
private boolean analyToDB(JSONObject jsonObject,MultipartFile[] files) {
|
|
|
|
|
if(jsonObject.getJSONObject("data")!=null) {
|
|
|
|
|
String tableName = "";
|
|
|
|
|
String uniqueColumn = "";
|
|
|
|
|
JSONObject object = jsonObject.getJSONObject("data");
|
|
|
|
|
List<Map<String,Object>> list = new ArrayList<>();
|
|
|
|
|
if(object instanceof List<?>) {
|
|
|
|
|
list = jsonObject.getObject("data", List.class);
|
|
|
|
|
tableName = jsonObject.getString("tableName");
|
|
|
|
|
uniqueColumn = jsonObject.getString("uniqueColumn");
|
|
|
|
|
} else {
|
|
|
|
|
list = object.getObject("data", List.class);
|
|
|
|
|
|
|
|
|
|
tableName = object.getString("tableName");
|
|
|
|
|
uniqueColumn = object.getString("uniqueColumn");
|
|
|
|
|
}
|
|
|
|
|
if(!StringUtils.isEmpty(object.getString("tableName"))) {
|
|
|
|
|
return analyData(object.getString("tableName"),object.getString("uniqueColumn"),list);
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(tableName)) {
|
|
|
|
|
return analyData(tableName,uniqueColumn,list);
|
|
|
|
|
} else {
|
|
|
|
|
logger.error("数据格式错误:无数据标记");
|
|
|
|
|
}
|
|
|
|
|