|  |  | @ -86,6 +86,7 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  |     private ScheduledDao scheduledDao; |  |  |  |     private ScheduledDao scheduledDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     private String imagePath = "register/file/image2/"; |  |  |  |     private String imagePath = "register/file/image2/"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private String devImagePath = "register/file/device/"; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     /*获取拉取任务列表*/ |  |  |  |     /*获取拉取任务列表*/ | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  |     @Override | 
			
		
	
	
		
		
			
				
					|  |  | @ -627,24 +628,45 @@ public class IdcServiceImpl implements IdcService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |     public void downloadFile(String fileName, HttpServletResponse response) { |  |  |  |     public void downloadFile(String fileName, HttpServletResponse response) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         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("/") ? "" : "/"; | 
			
		
	
		
		
			
				
					
					|  |  |  |         String sourceFileName = filePath + filePathSlash + imagePath + fileName; |  |  |  |         String sourceFileName = filePath + filePathSlash + imagePath + fileName; | 
			
		
	
		
		
			
				
					
					|  |  |  | //        String sourceFileName = fileName;
 |  |  |  |         String sourceFileName2 = filePath + filePathSlash + devImagePath + fileName; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         try { |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             if (FileUtils.isFileExist(sourceFileName)) { |  |  |  |         try (OutputStream os = response.getOutputStream()) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 byte[] bytes = FileUtils.readFileByBytes(sourceFileName); |  |  |  |             String targetFile = null; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 os = response.getOutputStream(); |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 os.write(bytes); |  |  |  |             // 优先级检查文件列表(按优先级顺序)
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 os.flush(); |  |  |  |             String[] checkFiles = {sourceFileName2, sourceFileName}; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 os.close(); |  |  |  |             for (String file : checkFiles) { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (FileUtils.isFileExist(file)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     targetFile = file; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     break; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (targetFile != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 // 读取文件并写入响应流
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 byte[] bytes = FileUtils.readFileByBytes(targetFile); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (bytes != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     os.write(bytes); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     os.flush(); // 强制刷新缓冲区
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     response.setStatus(HttpServletResponse.SC_NOT_FOUND); // 404
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     logger.error("文件内容为空: {}", targetFile); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             } else { |  |  |  |             } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 logger.error("file not exists:" + sourceFileName); |  |  |  |                 // 处理文件不存在的情况(示例)
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 response.setStatus(HttpServletResponse.SC_NOT_FOUND); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 os.write("File not found".getBytes()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } catch (IOException e) { |  |  |  |         } catch (IOException e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             // TODO Auto-generated catch block
 |  |  |  |             response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); // 500
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             e.printStackTrace(); |  |  |  |             logger.error("写入响应流失败: ", e); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     private void saveUploadStatus(Map<String, Object> params) { |  |  |  |     private void saveUploadStatus(Map<String, Object> params) { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |