|  |  | @ -1163,68 +1163,129 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return success; |  |  |  |         return success; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  | //    @Override
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     public boolean signleDownloadFile(String syncIp, String fileName) { |  |  |  | //    public boolean signleDownloadFile(String syncIp, String fileName) {
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/"; |  |  |  | //        String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/";
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if(!FileUtils.makeDirectory(filePath + filePathSlash + imagePath)) |  |  |  | //        if(!FileUtils.makeDirectory(filePath + filePathSlash + imagePath))
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             IDCUtils.createDirectory(filePath + filePathSlash + imagePath); |  |  |  | //            IDCUtils.createDirectory(filePath + filePathSlash + imagePath);
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         OkHttpClient client = new OkHttpClient().newBuilder() |  |  |  | //        OkHttpClient client = new OkHttpClient().newBuilder()
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 .build(); |  |  |  | //                .build();
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         ; |  |  |  | //        ;
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |  |  |  | //        MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         RequestBody body = RequestBody.create(mediaType, "fileName=" + fileName); |  |  |  | //        RequestBody body = RequestBody.create(mediaType, "fileName=" + fileName);
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         Request request = new Request.Builder() |  |  |  | //        Request request = new Request.Builder()
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 .url(syncIp + "/spssync/common/downloadFile") |  |  |  | //                .url(syncIp + "/spssync/common/downloadFile")
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 .post(body) |  |  |  | //                .post(body)
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 .addHeader("Content-Type", "application/x-www-form-urlencoded") |  |  |  | //                .addHeader("Content-Type", "application/x-www-form-urlencoded")
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 .build(); |  |  |  | //                .build();
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         int total=0;  |  |  |  | //        int total=0;
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         try { |  |  |  | //        try {
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             Response result = client.newCall(request).execute(); |  |  |  | //            Response result = client.newCall(request).execute();
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : ""; |  |  |  | //            String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : "";
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |              |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { |  |  |  | //            if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) {
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 try (InputStream inputStream = result.body().byteStream()) { |  |  |  | //                try (InputStream inputStream = result.body().byteStream()) {
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                          |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |      |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName); |  |  |  | //                        FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName);
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |      |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         byte b[] = new byte[1024]; |  |  |  | //                        byte b[] = new byte[1024];
 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        int len = 0;
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        while ((len = inputStream.read(b)) != -1) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                            total += len;
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                            outputStream.write(b, 0, len);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        outputStream.flush();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        outputStream.close();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        if(!(total>0)) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                            new File(filePath + filePathSlash + imagePath+fileName).delete();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                            executeSql("delete from idc_file where filePath='"+fileName+"'");
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                } catch (Exception e) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            if(!(total>0)) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                String sql = "replace idc_file (filePath,createTime,msg) values ('"+fileName+"',now(),'"+msg+"')";
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                executeSql(sql);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        } catch (IOException e) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            // TODO Auto-generated catch block
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            e.printStackTrace();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        return (total>0);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //    }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | public boolean signleDownloadFile(String syncIp, String fileFullName) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     OkHttpClient client = new OkHttpClient().newBuilder() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             .build(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     ; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     RequestBody body = RequestBody.create(mediaType, "fileName=" + fileFullName); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     Request request = new Request.Builder() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             .url(syncIp + "/spssync/common/downloadFile") | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             .post(body) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             .addHeader("Content-Type", "application/x-www-form-urlencoded") | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             .build(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     int total = 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     try { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         Response result = client.newCall(request).execute(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : ""; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             try (InputStream inputStream = result.body().byteStream()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 String path = fileFullName.substring(0,fileFullName.lastIndexOf("/")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if(!FileUtils.makeDirectory(path)) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     IDCUtils.createDirectory(path); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 FileOutputStream outputStream = new FileOutputStream(fileFullName); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 byte b[] = new byte[1024]; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 int len = 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 while ((len = inputStream.read(b)) != -1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     total += len; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     outputStream.write(b, 0, len); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         int len = 0; |  |  |  |                 } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         while ((len = inputStream.read(b)) != -1) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                             total += len; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                             outputStream.write(b, 0, len); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |      |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         outputStream.flush(); |  |  |  |                 outputStream.flush(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         outputStream.close(); |  |  |  |                 outputStream.close(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         if(!(total>0)) { |  |  |  |                 if(!(total>0)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             new File(filePath + filePathSlash + imagePath+fileName).delete(); |  |  |  |                     new File(fileFullName).delete(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             executeSql("delete from idc_file where filePath='"+fileName+"'"); |  |  |  |                     executeSql("delete from idc_file where filePath='"+fileFullName+"'"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |                 } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } catch (Exception e) { |  |  |  |             } catch (Exception e) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             if(!(total>0)) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 String sql = "replace idc_file (filePath,createTime,msg) values ('"+fileName+"',now(),'"+msg+"')"; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 executeSql(sql); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |         } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         } catch (IOException e) { |  |  |  |         if(!(total>0)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             // TODO Auto-generated catch block
 |  |  |  |             String sql = "replace idc_file (filePath,createTime,msg) values ('"+fileFullName+"',now(),'"+msg+"')"; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             e.printStackTrace(); |  |  |  |             executeSql(sql); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         return (total>0); |  |  |  |     } catch (IOException e) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         // TODO Auto-generated catch block
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         e.printStackTrace(); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     return (total>0); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     /*获取转发服务地址,当前值允许单向,只使用参数upper_server_ip*/ |  |  |  |     /*获取转发服务地址,当前值允许单向,只使用参数upper_server_ip*/ | 
			
		
	
		
		
			
				
					
					|  |  |  |     private String getNextHost() { |  |  |  |     private String getNextHost() { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |