|  |  |  | @ -85,6 +85,7 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     private ScheduledDao scheduledDao; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     private String imagePath = "register/file/image2/"; | 
			
		
	
		
			
				
					|  |  |  |  |     /*获取拉取任务列表*/ | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse taskList(HttpServletRequest request, Map<String, Object> params) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -410,7 +411,8 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |             IDCUtils.createDirectory(filePath + filePathSlash + datePath + "/"); | 
			
		
	
		
			
				
					|  |  |  |  |         if (!FileUtils.makeDirectory(backFilePath + backFileSlash + datePath)) | 
			
		
	
		
			
				
					|  |  |  |  |             IDCUtils.createDirectory(filePath + backFileSlash + datePath + "/"); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(!FileUtils.makeDirectory(filePath + filePathSlash + imagePath)) | 
			
		
	
		
			
				
					|  |  |  |  |             IDCUtils.createDirectory(filePath + filePathSlash + imagePath); | 
			
		
	
		
			
				
					|  |  |  |  |         FileUtils.SaveFileAs(content, fileName); | 
			
		
	
		
			
				
					|  |  |  |  |         FileUtils.SaveFileAs(content, backFileName); | 
			
		
	
		
			
				
					|  |  |  |  |         ArrayList<String> saveFiles = new ArrayList<>(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -420,11 +422,11 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |             int n = 0; | 
			
		
	
		
			
				
					|  |  |  |  |             try { | 
			
		
	
		
			
				
					|  |  |  |  |                 for (MultipartFile file : files) { | 
			
		
	
		
			
				
					|  |  |  |  |                     String imageName = filePath + filePathSlash + "register/file/image2/" + file.getOriginalFilename(); | 
			
		
	
		
			
				
					|  |  |  |  |                     String imageName = filePath + filePathSlash + imagePath + file.getOriginalFilename(); | 
			
		
	
		
			
				
					|  |  |  |  |                     saveFiles.add(imageName); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     writeFile(file.getBytes(), filePath + filePathSlash + "register/file/image2/", file.getOriginalFilename()); | 
			
		
	
		
			
				
					|  |  |  |  |                     writeFile(file.getBytes(), backFilePath + backFileSlash + datePath + "register/file/image2/", file.getOriginalFilename()); | 
			
		
	
		
			
				
					|  |  |  |  |                     writeFile(file.getBytes(), filePath + filePathSlash + imagePath, file.getOriginalFilename()); | 
			
		
	
		
			
				
					|  |  |  |  |                     writeFile(file.getBytes(), backFilePath + backFileSlash + datePath + imagePath, file.getOriginalFilename()); | 
			
		
	
		
			
				
					|  |  |  |  |                     n++; | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } catch (IOException e) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -486,14 +488,16 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |     public void downloadFile(String fileName, HttpServletResponse response) { | 
			
		
	
		
			
				
					|  |  |  |  |         OutputStream os; | 
			
		
	
		
			
				
					|  |  |  |  |         String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : fileName.substring(0, 1).equals("/") ? "" : "/"; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         String sourceFileName = filePath +filePathSlash+imagePath +fileName; | 
			
		
	
		
			
				
					|  |  |  |  |         try { | 
			
		
	
		
			
				
					|  |  |  |  |             if (FileUtils.isFileExist(filePath + filePathSlash + fileName)) { | 
			
		
	
		
			
				
					|  |  |  |  |                 byte[] bytes = FileUtils.readFileByBytes(filePath + filePathSlash + fileName); | 
			
		
	
		
			
				
					|  |  |  |  |             if (FileUtils.isFileExist(sourceFileName)) { | 
			
		
	
		
			
				
					|  |  |  |  |                 byte[] bytes = FileUtils.readFileByBytes(sourceFileName); | 
			
		
	
		
			
				
					|  |  |  |  |                 os = response.getOutputStream(); | 
			
		
	
		
			
				
					|  |  |  |  |                 os.write(bytes); | 
			
		
	
		
			
				
					|  |  |  |  |                 os.flush(); | 
			
		
	
		
			
				
					|  |  |  |  |                 os.close(); | 
			
		
	
		
			
				
					|  |  |  |  |             } else { | 
			
		
	
		
			
				
					|  |  |  |  |                 logger.error("file not exists:"+sourceFileName); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } catch (IOException e) { | 
			
		
	
		
			
				
					|  |  |  |  |             // TODO Auto-generated catch block
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -619,8 +623,8 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |                                 String fileNames = list.get(m).get(filePathColumn).toString(); | 
			
		
	
		
			
				
					|  |  |  |  |                                 String[] str = fileNames.split(","); | 
			
		
	
		
			
				
					|  |  |  |  |                                 for (int r = 0; r < str.length; r++) { | 
			
		
	
		
			
				
					|  |  |  |  |                                     if (!StringUtils.isEmpty(str[r]) && FileUtils.isFileExist(filePath + filePathSlash + "register/file/image2/" + str[r])) | 
			
		
	
		
			
				
					|  |  |  |  |                                         files.add(filePath + filePathSlash + "register/file/image2/" + str[r]); | 
			
		
	
		
			
				
					|  |  |  |  |                                     if (!StringUtils.isEmpty(str[r]) && FileUtils.isFileExist(filePath + filePathSlash + imagePath + str[r])) | 
			
		
	
		
			
				
					|  |  |  |  |                                         files.add(filePath + filePathSlash + imagePath + str[r]); | 
			
		
	
		
			
				
					|  |  |  |  |                                 } | 
			
		
	
		
			
				
					|  |  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |  |                             recordSql += !StringUtils.isEmpty(recordSql) ? "," : ""; | 
			
		
	
	
		
			
				
					|  |  |  | @ -642,8 +646,8 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |                                                 if (childList.get(i).get(chidTnames[7]) != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                                                     String[] str = childList.get(i).get(chidTnames[7]).toString().split(","); | 
			
		
	
		
			
				
					|  |  |  |  |                                                     for (int s = 0; s < str.length; s++) { | 
			
		
	
		
			
				
					|  |  |  |  |                                                         if (!StringUtils.isEmpty(str[s]) && FileUtils.isFileExist(filePath + filePathSlash + "register/file/image2/" + str[s])) | 
			
		
	
		
			
				
					|  |  |  |  |                                                             files.add(filePath + filePathSlash + "register/file/image2/" + str[s]); | 
			
		
	
		
			
				
					|  |  |  |  |                                                         if (!StringUtils.isEmpty(str[s]) && FileUtils.isFileExist(filePath + filePathSlash + imagePath + str[s])) | 
			
		
	
		
			
				
					|  |  |  |  |                                                             files.add(filePath + filePathSlash + imagePath + str[s]); | 
			
		
	
		
			
				
					|  |  |  |  |                                                     } | 
			
		
	
		
			
				
					|  |  |  |  |                                                 } | 
			
		
	
		
			
				
					|  |  |  |  |                                             } | 
			
		
	
	
		
			
				
					|  |  |  | @ -808,7 +812,7 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |             filePathColumn, List<Map<String, Object>> list, boolean isUpload) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |          | 
			
		
	
		
			
				
					|  |  |  |  |     	String tName = DBAUtils.tableRealName(tableName); | 
			
		
	
		
			
				
					|  |  |  |  |         String tName = DBAUtils.tableRealName(tableName); | 
			
		
	
		
			
				
					|  |  |  |  |         String sql = "replace " + tName + "("; | 
			
		
	
		
			
				
					|  |  |  |  |         String del = "delete from " + tName + " where "; | 
			
		
	
		
			
				
					|  |  |  |  |         String upd = "update " + tName + " set "; | 
			
		
	
	
		
			
				
					|  |  |  | @ -1009,6 +1013,9 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     private boolean signleDownloadFile(String syncIp, String fileName) { | 
			
		
	
		
			
				
					|  |  |  |  |         String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/"; | 
			
		
	
		
			
				
					|  |  |  |  |         if(!FileUtils.makeDirectory(filePath + filePathSlash + imagePath)) | 
			
		
	
		
			
				
					|  |  |  |  |             IDCUtils.createDirectory(filePath + filePathSlash + imagePath); | 
			
		
	
		
			
				
					|  |  |  |  |         OkHttpClient client = new OkHttpClient().newBuilder() | 
			
		
	
		
			
				
					|  |  |  |  |                 .build(); | 
			
		
	
		
			
				
					|  |  |  |  |         ; | 
			
		
	
	
		
			
				
					|  |  |  | @ -1028,9 +1035,9 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |             if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { | 
			
		
	
		
			
				
					|  |  |  |  |                 try (InputStream inputStream = result.body().byteStream()) { | 
			
		
	
		
			
				
					|  |  |  |  |                     | 
			
		
	
		
			
				
					|  |  |  |  |                         String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/"; | 
			
		
	
		
			
				
					|  |  |  |  |                          | 
			
		
	
		
			
				
					|  |  |  |  |      | 
			
		
	
		
			
				
					|  |  |  |  |                         FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + fileName); | 
			
		
	
		
			
				
					|  |  |  |  |                         FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName); | 
			
		
	
		
			
				
					|  |  |  |  |      | 
			
		
	
		
			
				
					|  |  |  |  |                         byte b[] = new byte[1024]; | 
			
		
	
		
			
				
					|  |  |  |  |      | 
			
		
	
	
		
			
				
					|  |  |  | @ -1044,7 +1051,7 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |                         outputStream.flush(); | 
			
		
	
		
			
				
					|  |  |  |  |                         outputStream.close(); | 
			
		
	
		
			
				
					|  |  |  |  |                         if(!(total>0)) { | 
			
		
	
		
			
				
					|  |  |  |  |                             new File(filePath + filePathSlash + fileName).delete(); | 
			
		
	
		
			
				
					|  |  |  |  |                             new File(filePath + filePathSlash + imagePath+fileName).delete(); | 
			
		
	
		
			
				
					|  |  |  |  |                             executeSql("delete from idc_file where filePath='"+fileName+"'"); | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |  |                  | 
			
		
	
	
		
			
				
					|  |  |  | @ -1058,7 +1065,6 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  |                 executeSql(sql); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         } catch (IOException e) { | 
			
		
	
		
			
				
					|  |  |  |  |             // TODO Auto-generated catch block
 | 
			
		
	
		
			
				
					|  |  |  |  |             e.printStackTrace(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -1246,6 +1252,7 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |      | 
			
		
	
		
			
				
					|  |  |  |  |     private void executeSql(String sql) { | 
			
		
	
		
			
				
					|  |  |  |  |         try { | 
			
		
	
		
			
				
					|  |  |  |  |             jdbcTemplate.execute(sql); | 
			
		
	
	
		
			
				
					|  |  |  | 
 |