|  |  | @ -293,9 +293,12 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 					logger.info("fetchData-->解析失败"); |  |  |  | 					logger.info("fetchData-->解析失败"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			} else { |  |  |  | 			} else { | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if(json.get("code")!=null) { |  |  |  | 				if(json.get("code")!=null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					 | 
			
		
	
		
		
			
				
					
					|  |  |  | 					syncAddTaskStatus(json.getJSONObject("data"),false,success); |  |  |  | 					syncAddTaskStatus(json.getJSONObject("data"),false,success); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					analyMiddle(host,json.getJSONObject("data"),files,false,false); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} else { |  |  |  | 				} else { | 
			
		
	
		
		
			
				
					
					|  |  |  | 					syncAddTaskStatus(json,false,success); |  |  |  | 					syncAddTaskStatus(json,false,success); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					analyMiddle(host,json,files,false,false); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  | 			 |  |  |  | 			 | 
			
		
	
	
		
		
			
				
					|  |  | @ -362,14 +365,16 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		 |  |  |  | 		 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		FileUtils.SaveFileAs(content, fileName); |  |  |  | 		FileUtils.SaveFileAs(content, fileName); | 
			
		
	
		
		
			
				
					
					|  |  |  |         FileUtils.SaveFileAs(content, backFileName); |  |  |  |         FileUtils.SaveFileAs(content, backFileName); | 
			
		
	
		
		
			
				
					
					|  |  |  |         String[] saveFiles= {}; |  |  |  |         ArrayList<String> saveFiles = new ArrayList<>(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       | 
			
		
	
		
		
			
				
					
					|  |  |  |         if(files!=null) { |  |  |  |         if(files!=null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         	saveFiles = new String[files.length]; |  |  |  |          | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         	int n=0; |  |  |  |         	int n=0; | 
			
		
	
		
		
			
				
					
					|  |  |  |             try { |  |  |  |             try { | 
			
		
	
		
		
			
				
					
					|  |  |  |         		for(MultipartFile file:files) { |  |  |  |         		for(MultipartFile file:files) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         			String imageName = filePath +filePathSlash+"register/file/image2/"+file.getOriginalFilename(); |  |  |  |         			String imageName = filePath +filePathSlash+"register/file/image2/"+file.getOriginalFilename(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         			saveFiles[n] = imageName; |  |  |  |         			saveFiles.add(imageName); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         		 | 
			
		
	
		
		
			
				
					
					|  |  |  |         			writeFile(file.getBytes(), filePath +filePathSlash+"register/file/image2/", file.getOriginalFilename()); |  |  |  |         			writeFile(file.getBytes(), filePath +filePathSlash+"register/file/image2/", file.getOriginalFilename()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         			writeFile(file.getBytes(), backFilePath +backFileSlash+datePath+"register/file/image2/", file.getOriginalFilename()); |  |  |  |         			writeFile(file.getBytes(), backFilePath +backFileSlash+datePath+"register/file/image2/", file.getOriginalFilename()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         			n++; |  |  |  |         			n++; | 
			
		
	
	
		
		
			
				
					|  |  | @ -425,11 +430,13 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		OutputStream os; |  |  |  | 		OutputStream os; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		String filePathSlash = filePath.substring(filePath.length() -1).equals("/") ? "" : fileName.substring(0,1).equals("/") ? "" : "/"; |  |  |  | 		String filePathSlash = filePath.substring(filePath.length() -1).equals("/") ? "" : fileName.substring(0,1).equals("/") ? "" : "/"; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		try { |  |  |  | 		try { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			if(FileUtils.isFileExist(filePath+filePathSlash+fileName)) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 				byte[] bytes = FileUtils.readFileByBytes(filePath+filePathSlash+fileName); |  |  |  | 				byte[] bytes = FileUtils.readFileByBytes(filePath+filePathSlash+fileName); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				os = response.getOutputStream(); |  |  |  | 				os = response.getOutputStream(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				os.write(bytes); |  |  |  | 				os.write(bytes); | 
			
		
	
		
		
			
				
					
					|  |  |  | 	            os.flush(); |  |  |  | 	            os.flush(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 	            os.close(); |  |  |  | 	            os.close(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} catch (IOException e) { |  |  |  | 		} catch (IOException e) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			// TODO Auto-generated catch block
 |  |  |  | 			// TODO Auto-generated catch block
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 			e.printStackTrace(); |  |  |  | 			e.printStackTrace(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -519,7 +526,8 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		 |  |  |  | 		 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		String isEnd = params.get("isEnd")!=null ? params.get("isEnd").toString() : "0"; |  |  |  | 		String isEnd = params.get("isEnd")!=null ? params.get("isEnd").toString() : "0"; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		int limit = 50; |  |  |  | 		int limit = 50; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		String[] files = new String[limit]; |  |  |  | 		ArrayList<String> files = new ArrayList<>(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		String filePathColumn = params.get("filePathColumn")!=null ? params.get("filePathColumn").toString() : ""; |  |  |  | 		String filePathColumn = params.get("filePathColumn")!=null ? params.get("filePathColumn").toString() : ""; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		orderNum++; |  |  |  | 		orderNum++; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		String messageType = params.get("messageType").toString(); |  |  |  | 		String messageType = params.get("messageType").toString(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -547,7 +555,7 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 					if(list!=null&&list.size()>0) { |  |  |  | 					if(list!=null&&list.size()>0) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 						for(int m=0;m<list.size();m++) { |  |  |  | 						for(int m=0;m<list.size();m++) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 							if(!StringUtils.isEmpty(filePathColumn)&&list.get(m).get(filePathColumn)!=null) { |  |  |  | 							if(!StringUtils.isEmpty(filePathColumn)&&list.get(m).get(filePathColumn)!=null) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 								files[m] = filePath+filePathSlash+"register/file/image2/"+list.get(m).get(filePathColumn).toString(); |  |  |  | 								files.add(filePath+filePathSlash+"register/file/image2/"+list.get(m).get(filePathColumn).toString()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 							} |  |  |  | 							} | 
			
		
	
		
		
			
				
					
					|  |  |  | 							recordSql+=!StringUtils.isEmpty(recordSql) ? "," : ""; |  |  |  | 							recordSql+=!StringUtils.isEmpty(recordSql) ? "," : ""; | 
			
		
	
		
		
			
				
					
					|  |  |  | 							recordSql+="('"+UUID.randomUUID().toString().replaceAll("-", "")+"','"+tableName+"','"+list.get(m).get(keyColumn)+"','"+isEnd+"',now())"; |  |  |  | 							recordSql+="('"+UUID.randomUUID().toString().replaceAll("-", "")+"','"+tableName+"','"+list.get(m).get(keyColumn)+"','"+isEnd+"',now())"; | 
			
		
	
	
		
		
			
				
					|  |  | @ -560,7 +568,15 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 										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); | 
			
		
	
		
		
			
				
					
					|  |  |  | 										list.get(m).put("tableName"+z, chidTnames[2]); |  |  |  | 										list.get(m).put("tableName"+z, chidTnames[2]); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 										list.get(m).put("filePathColumn"+z, chidTnames[7]); | 
			
		
	
		
		
			
				
					
					|  |  |  | 										list.get(m).put("data"+z, childList); |  |  |  | 										list.get(m).put("data"+z, childList); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 										if(!StringUtils.isEmpty(chidTnames[7])&&childList.size()>0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 											for(int x=0;x<childList.size();x++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 												if(childList.get(i).get(chidTnames[7])!=null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 													files.add(filePath+filePathSlash+"register/file/image2/"+childList.get(i).get(chidTnames[7])); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 												} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 											} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 										} | 
			
		
	
		
		
			
				
					
					|  |  |  | 									} |  |  |  | 									} | 
			
		
	
		
		
			
				
					
					|  |  |  | 								} |  |  |  | 								} | 
			
		
	
		
		
			
				
					
					|  |  |  | 							} |  |  |  | 							} | 
			
		
	
	
		
		
			
				
					|  |  | @ -821,18 +837,14 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if(!result) |  |  |  | 				if(!result) | 
			
		
	
		
		
			
				
					
					|  |  |  | 					logger.error(tableName+"-->fetchSave Fail"); |  |  |  | 					logger.error(tableName+"-->fetchSave Fail"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  | 			if(!isUpload&&!StringUtils.isEmpty(filePathColumn)) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 				logger.info("downloadFile-->"+files.toString()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 			batchDownloadFile(host,files); |  |  |  | 			batchDownloadFile(host,files); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 		return result; |  |  |  | 		return result; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	/*转发下级或上级中继服务*/ |  |  |  | 	/*转发下级或上级中继服务*/ | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private String relay(String reqNo,String content,String[] files,String ip) { |  |  |  | 	private String relay(String reqNo,String content,ArrayList<String> files,String ip) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		String host = ip; |  |  |  | 		String host = ip; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		String result=""; |  |  |  | 		String result=""; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		if(StringUtils.isEmpty(reqNo)) |  |  |  | 		if(StringUtils.isEmpty(reqNo)) | 
			
		
	
	
		
		
			
				
					|  |  | @ -848,13 +860,15 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			MultipartBody.Builder builder = new MultipartBody.Builder(); |  |  |  | 			MultipartBody.Builder builder = new MultipartBody.Builder(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			builder.setType(MultipartBody.FORM); |  |  |  | 			builder.setType(MultipartBody.FORM); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			String fileType = "application/octet-stream"; |  |  |  | 			String fileType = "application/octet-stream"; | 
			
		
	
		
		
			
				
					
					|  |  |  | 			for (int i = 0; i < files.length; i++) { |  |  |  | 			if(files!=null&&files.size()>0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				if(!StringUtils.isEmpty(files[i])) { |  |  |  | 				for (int i = 0; i < files.size(); i++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 					File file = new File(files[i]); |  |  |  | 					if(!StringUtils.isEmpty(files.get(i))) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				    builder.addFormDataPart("files",files[i], |  |  |  | 						File file = new File(files.get(i)); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					    builder.addFormDataPart("files",files.get(i), | 
			
		
	
		
		
			
				
					
					|  |  |  | 					           RequestBody.create(MediaType.parse(fileType), file)); |  |  |  | 					           RequestBody.create(MediaType.parse(fileType), file)); | 
			
		
	
		
		
			
				
					
					|  |  |  | 					} |  |  |  | 					} | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  | 			builder.addFormDataPart("content", content); |  |  |  | 			builder.addFormDataPart("content", content); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			RequestBody body = builder.build(); |  |  |  | 			RequestBody body = builder.build(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -1092,13 +1106,15 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private void initTable() { |  |  |  | 	private void initTable() { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		alterTable("idc_var","create table idc_var (code varchar(60),content varchar(200),PRIMARY KEY (code))"); |  |  |  | 		alterTable("idc_var","create table idc_var (code varchar(60),content varchar(200),PRIMARY KEY (code))"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		alterTable("idc_status","create table idc_status (id varchar(36),statusTime datetime,PRIMARY KEY (id))"); |  |  |  | 		alterTable("idc_status","create table idc_status (id varchar(100),statusTime datetime,PRIMARY KEY (id))"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		alterTable("idc_record","create table idc_record (id varchar(36),type varchar(60),fkId varchar(36),isEnd char(1),createTime datetime,primary key (id),INDEX i_idc_record_fk_id (fkId),INDEX i_idc_record_create_time (createTime))"); |  |  |  | 		alterTable("idc_record","create table idc_record (id varchar(36),type varchar(60),fkId varchar(36),isEnd char(1),createTime datetime,primary key (id),INDEX i_idc_record_fk_id (fkId),INDEX i_idc_record_create_time (createTime))"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		alterTable("idc_log","create table idc_log (id varchar(36),orderNum int,taskId varchar(60),type varchar(60),content varchar(2000),offset int,total int,createTime datetime,PRIMARY KEY (id))"); |  |  |  | 		alterTable("idc_log","create table idc_log (id varchar(36),orderNum int,taskId varchar(60),type varchar(60),content varchar(2000),offset int,total int,createTime datetime,PRIMARY KEY (id))"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		dbDao.delete("delete from idc_record where createTime<date_sub(now(),interval 2 day) and isEnd='0'"); |  |  |  | 		dbDao.delete("delete from idc_record where createTime<date_sub(now(),interval 2 day) and isEnd='0'"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		try { |  |  |  | 		try { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			jdbcTemplate.execute("alter table basic_export_status add column cacheFilePath varchar(255)"); |  |  |  | 			jdbcTemplate.execute("alter table basic_export_status add column cacheFilePath varchar(255)"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			jdbcTemplate.execute("alter table basic_upload_status add column cacheFilePath varchar(255)"); |  |  |  | 			jdbcTemplate.execute("alter table basic_upload_status add column cacheFilePath varchar(255)"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			jdbcTemplate.execute("alter table idc_status modify column id varchar(100)"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			jdbcTemplate.execute("delete from idc_log where createTime<date_sub(now(),interval 3 day)"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} catch (Exception e) { |  |  |  | 		} catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			 |  |  |  | 			 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
	
		
		
			
				
					|  |  | 
 |