|  |  |  | @ -108,9 +108,9 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  | 		if(map==null) | 
			
		
	
		
			
				
					|  |  |  |  | 			ResultVOUtils.error(9000, "下载任务不存在"); | 
			
		
	
		
			
				
					|  |  |  |  | 		String json = FileUtils.readFileAll(map.get("cacheFilePath").toString()); | 
			
		
	
		
			
				
					|  |  |  |  | 		logger.info("download-->"+json); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 		JSONObject object = JSON.parseObject(json); | 
			
		
	
		
			
				
					|  |  |  |  | 		if(object!=null&&object.getInteger("code")==20000) { | 
			
		
	
		
			
				
					|  |  |  |  | 		if(object!=null&&object.getInteger("code")!=null) { | 
			
		
	
		
			
				
					|  |  |  |  | 			BaseResponse response = JSON.parseObject(json,BaseResponse.class); | 
			
		
	
		
			
				
					|  |  |  |  | 			return response; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
	
		
			
				
					|  |  |  | @ -157,7 +157,7 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  | 		logger.info("fetch from ip:"+host); | 
			
		
	
		
			
				
					|  |  |  |  | 		if(!StringUtils.isEmpty(host)) { | 
			
		
	
		
			
				
					|  |  |  |  | 			String result = post(host+"/spssync/common/list",null); | 
			
		
	
		
			
				
					|  |  |  |  | 			logger.info("fetchTask--->"+result); | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 			if(IDCUtils.isJson(result)) { | 
			
		
	
		
			
				
					|  |  |  |  | 				JSONObject json = JSON.parseObject(result); | 
			
		
	
		
			
				
					|  |  |  |  | 				if(json!=null&&json.getInteger("code")==20000&&json.getString("data")!=null) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -166,7 +166,7 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  | 						for(Map map:list) { | 
			
		
	
		
			
				
					|  |  |  |  | 							Map<String,Object> params = new HashMap<String,Object>(); | 
			
		
	
		
			
				
					|  |  |  |  | 							params.put("taskId", map.get("taskId")); | 
			
		
	
		
			
				
					|  |  |  |  | 							fetchData(host+"/spssync/common/download",params); | 
			
		
	
		
			
				
					|  |  |  |  | 							fetchData(host,params); | 
			
		
	
		
			
				
					|  |  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
	
		
			
				
					|  |  |  | @ -254,13 +254,13 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	private String fetchData(String url,Map<String,Object> params) { | 
			
		
	
		
			
				
					|  |  |  |  | 	private String fetchData(String host,Map<String,Object> params) { | 
			
		
	
		
			
				
					|  |  |  |  | 		OkHttpClient client = new OkHttpClient().newBuilder() | 
			
		
	
		
			
				
					|  |  |  |  | 				  .build(); | 
			
		
	
		
			
				
					|  |  |  |  | 		MediaType mediaType = MediaType.parse("application/json"); | 
			
		
	
		
			
				
					|  |  |  |  | 		RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(params)); | 
			
		
	
		
			
				
					|  |  |  |  | 		Request request = new Request.Builder() | 
			
		
	
		
			
				
					|  |  |  |  | 		  .url(url) | 
			
		
	
		
			
				
					|  |  |  |  | 		  .url(host+"/spssync/common/download") | 
			
		
	
		
			
				
					|  |  |  |  | 		  .method("POST", body) | 
			
		
	
		
			
				
					|  |  |  |  | 		  .addHeader("Content-Type", "application/json") | 
			
		
	
		
			
				
					|  |  |  |  | 		  .build(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -270,7 +270,6 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  | 			boolean success=true; | 
			
		
	
		
			
				
					|  |  |  |  | 			Response response = client.newCall(request).execute(); | 
			
		
	
		
			
				
					|  |  |  |  | 			result = response.body().string(); | 
			
		
	
		
			
				
					|  |  |  |  | 			logger.info("fetchData-->"+result); | 
			
		
	
		
			
				
					|  |  |  |  | 			JSONObject json = JSONObject.parseObject(result); | 
			
		
	
		
			
				
					|  |  |  |  | 			if(isLastLevel()) { | 
			
		
	
		
			
				
					|  |  |  |  | 				success = analyToDB(json,files); | 
			
		
	
	
		
			
				
					|  |  |  | @ -280,7 +279,6 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  | 				syncAddTaskStatus(json,false,success); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			 | 
			
		
	
		
			
				
					|  |  |  |  | 			String host = getNextHost(); | 
			
		
	
		
			
				
					|  |  |  |  | 			if(success) { | 
			
		
	
		
			
				
					|  |  |  |  | 				String ret = post(host+"/spssync/common/success",params); | 
			
		
	
		
			
				
					|  |  |  |  | 				 | 
			
		
	
	
		
			
				
					|  |  |  | @ -310,7 +308,6 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  | 		try { | 
			
		
	
		
			
				
					|  |  |  |  | 			Response response = client.newCall(request).execute(); | 
			
		
	
		
			
				
					|  |  |  |  | 			result = response.body().string(); | 
			
		
	
		
			
				
					|  |  |  |  | 			logger.info("post-result-->"+result); | 
			
		
	
		
			
				
					|  |  |  |  | 		} catch (IOException e) { | 
			
		
	
		
			
				
					|  |  |  |  | 			// TODO Auto-generated catch block
 | 
			
		
	
		
			
				
					|  |  |  |  | 			e.printStackTrace(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -607,16 +604,17 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  | 		if(jsonObject.getJSONObject("data")!=null) { | 
			
		
	
		
			
				
					|  |  |  |  | 			JSONObject object = jsonObject.getJSONObject("data"); | 
			
		
	
		
			
				
					|  |  |  |  | 			List<Map<String,Object>> list = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |  | 			 | 
			
		
	
		
			
				
					|  |  |  |  | 			if(object instanceof List<?>) { | 
			
		
	
		
			
				
					|  |  |  |  | 				list = jsonObject.getObject("data", List.class); | 
			
		
	
		
			
				
					|  |  |  |  | 			} else { | 
			
		
	
		
			
				
					|  |  |  |  | 				object = jsonObject; | 
			
		
	
		
			
				
					|  |  |  |  | 				if(object.get("data")!=null) | 
			
		
	
		
			
				
					|  |  |  |  | 				list = object.getObject("data", List.class); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			if(!StringUtils.isEmpty(object.getString("tableName"))) { | 
			
		
	
		
			
				
					|  |  |  |  | 				return analyData(object.getString("tableName"),object.getString("uniqueColumn"),list); | 
			
		
	
		
			
				
					|  |  |  |  | 			} else { | 
			
		
	
		
			
				
					|  |  |  |  | 				logger.error("数据格式错误:无数据标记"); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			if(!StringUtils.isEmpty(object.getString("tableName"))) | 
			
		
	
		
			
				
					|  |  |  |  | 				return analyData(object.getString("tableName"),jsonObject.getString("uniqueColumn"),list); | 
			
		
	
		
			
				
					|  |  |  |  | 			//图片处理
 | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		return false; | 
			
		
	
	
		
			
				
					|  |  |  | @ -738,6 +736,8 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			if(n>0) { | 
			
		
	
		
			
				
					|  |  |  |  | 				result = (dbDao.save(sql)>0); | 
			
		
	
		
			
				
					|  |  |  |  | 				if(!result) | 
			
		
	
		
			
				
					|  |  |  |  | 					logger.error(tableName+"-->fetchSave Fail"); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
	
		
			
				
					|  |  |  | 
 |