| 
					
				 | 
			
			
				@@ -2,6 +2,7 @@ package org.springblade.business.service.impl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.alibaba.fastjson.JSONArray; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.alibaba.fastjson.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.core.toolkit.Wrappers; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import lombok.AllArgsConstructor; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import lombok.Data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import lombok.NoArgsConstructor; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -376,12 +377,13 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public boolean flushArchiveFileSort(Long projectId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void flushArchiveFileSort(Long projectId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<ArchiveFile>archileFileList=baseMapper.selectArchiveFileByProjectId(projectId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Map<String, List<ArchiveFile>> archiveMap = archileFileList.stream().collect(Collectors.groupingBy(ArchiveFile::getNodeId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<Long> NodeIds = archileFileList.stream() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .map(ArchiveFile::getNodeId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .map(Long::parseLong) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .distinct() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<ArchiveTreeContract> sortIds = archiveTreeContractClient.getArchiveTreeContractListByListOrderByTreeSort(NodeIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         int sort=10100001; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -398,7 +400,14 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.updateBatchById(archileFileList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        int i=1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (ArchiveFile file : archileFileList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.update(Wrappers.<ArchiveFile>lambdaUpdate() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .set(ArchiveFile::getSort, file.getSort()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .eq(ArchiveFile::getId, file.getId())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            System.out.println("归档文件排序进度:" + i + "/" + archileFileList.size()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        System.out.println("归档文件排序成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |