code==20000

master
admin 2 years ago
parent 3bd393227b
commit d7a1453cfd

@ -174,11 +174,14 @@ public class IdcServiceImpl implements IdcService {
logger.info("fetch from ip:"+host); logger.info("fetch from ip:"+host);
if(!StringUtils.isEmpty(host)) { if(!StringUtils.isEmpty(host)) {
String result = post(host+"/spssync/common/list",null); String result = post(host+"/spssync/common/list",null);
if(IDCUtils.isJson(result)) { if(IDCUtils.isJson(result)) {
JSONObject json = JSON.parseObject(result); JSONObject json = JSON.parseObject(result);
if(json!=null&&json.getInteger("code")==20000&&json.getString("data")!=null) {
List<Map> list = JSON.parseArray(json.getString("data"), Map.class); if(json!=null&&json.getInteger("code")==20000&&json.get("data")!=null) {
List<Map> list = JSON.parseArray(JSON.toJSONString(json.get("data")), Map.class);
if(list!=null) { if(list!=null) {
for(Map map:list) { for(Map map:list) {
Map<String,Object> params = new HashMap<String,Object>(); Map<String,Object> params = new HashMap<String,Object>();
@ -292,9 +295,10 @@ 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")==2000) { 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);
if(!success) if(!success)
logger.info("fetchData-->解析失败"); logger.info("fetchData-->解析失败");
@ -689,6 +693,7 @@ 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 = "";

Loading…
Cancel
Save