master
admin 2 years ago
parent d7a1453cfd
commit fe94e808db

@ -295,8 +295,7 @@ public class IdcServiceImpl implements IdcService {
Response response = client.newCall(request).execute(); Response response = client.newCall(request).execute();
result = response.body().string(); result = response.body().string();
JSONObject json = JSONObject.parseObject(result); JSONObject json = JSONObject.parseObject(result);
logger.info("taskId-->"+isLastLevel()+params.get("taskId"));
logger.info("result-->"+JSON.toJSONString(json));
if(isLastLevel()) { if(isLastLevel()) {
if(json.get("code")!=null&&json.getInteger("code")==20000) { if(json.get("code")!=null&&json.getInteger("code")==20000) {
success = analyMiddle(host,json.getJSONObject("data"),files,false,true); success = analyMiddle(host,json.getJSONObject("data"),files,false,true);
@ -591,7 +590,7 @@ public class IdcServiceImpl implements IdcService {
for(int z=0;z<childNum+1;z++) { for(int z=0;z<childNum+1;z++) {
String[] chidTnames = childs[z].split("/"); String[] chidTnames = childs[z].split("/");
if(!StringUtils.isEmpty(chidTnames[4])&&!StringUtils.isEmpty(chidTnames[5])) { if(!StringUtils.isEmpty(chidTnames[4])&&!StringUtils.isEmpty(chidTnames[5])) {
String keyValue = list.get(i).get(chidTnames[4]).toString(); String keyValue = list.get(m).get(chidTnames[4]).toString();
Map<String,Object> childMap = new HashMap<>(); Map<String,Object> childMap = new HashMap<>();
childMap.put(chidTnames[5], keyValue); childMap.put(chidTnames[5], keyValue);
List<Map<String,Object>> childList = getList(chidTnames[2],childMap); List<Map<String,Object>> childList = getList(chidTnames[2],childMap);
@ -693,7 +692,6 @@ public class IdcServiceImpl implements IdcService {
} }
private boolean analyMiddle(String host,JSONObject jsonObject,MultipartFile[] files,boolean isUpload,boolean isToDB) { private boolean analyMiddle(String host,JSONObject jsonObject,MultipartFile[] files,boolean isUpload,boolean isToDB) {
logger.info("middle-->"+JSON.toJSONString(jsonObject));
if(jsonObject.get("data")!=null) { if(jsonObject.get("data")!=null) {
String tableName = ""; String tableName = "";
String uniqueColumn = ""; String uniqueColumn = "";
@ -867,6 +865,7 @@ public class IdcServiceImpl implements IdcService {
for (Object o : (List<?>) obj) { for (Object o : (List<?>) obj) {
chList.add((Map<String,Object>)o); chList.add((Map<String,Object>)o);
} }
//logger.info("childList-->"+list.get(i).get("tableName"+m)+"-->"+JSON.toJSONString(chList));
analyToDB(host,list.get(i).get("tableName"+m).toString(),"","",chList,isUpload); analyToDB(host,list.get(i).get("tableName"+m).toString(),"","",chList,isUpload);
} else { } else {
break; break;
@ -875,6 +874,8 @@ public class IdcServiceImpl implements IdcService {
} }
if(n>0) { if(n>0) {
if(tableName.equals("basic_products"))
logger.info("sql-->"+sql);
result = (dbDao.save(sql)>0); result = (dbDao.save(sql)>0);
if(!result) if(!result)
logger.error(tableName+"-->fetchSave Fail"); logger.error(tableName+"-->fetchSave Fail");
@ -1034,6 +1035,8 @@ public class IdcServiceImpl implements IdcService {
String where = DBAUtils.convertWhere(column,params,""); String where = DBAUtils.convertWhere(column,params,"");
sql+=!StringUtils.isEmpty(where) ? " where "+where : ""; sql+=!StringUtils.isEmpty(where) ? " where "+where : "";
if(tableName.equals("basic_products"))
logger.info("where-->"+where);
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
map.putAll(params); map.putAll(params);
map.put("sql", sql); map.put("sql", sql);

Loading…
Cancel
Save