| 
					
				 | 
			
			
				@@ -13,8 +13,8 @@ import java.io.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.nio.ByteBuffer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.nio.channels.FileChannel; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.nio.charset.StandardCharsets; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.ArrayList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.stream.Collectors; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.zip.ZipEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.zip.ZipFile; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.zip.ZipInputStream; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -50,17 +50,17 @@ public class HistoryMessageServiceImpl extends BaseServiceImplWithMongo<String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			zin = new ZipInputStream(new FileInputStream(file), StandardCharsets.UTF_8); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			ZipFile zf = new ZipFile(file); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			ZipEntry ze; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			List<HistoryMessage> historyMessages = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			Set<HistoryMessage> historyMessages = new HashSet<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			while ((ze = zin.getNextEntry()) != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				BufferedReader br = new BufferedReader(new InputStreamReader(zf.getInputStream(ze))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				String line; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				while ((line = br.readLine()) != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 						historyMessages.add(JSONObject.parseObject(line.substring(line.indexOf("{")), HistoryMessage.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-						if(historyMessages.size() >= 2000){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-							historyMessageDao.batchInsert(historyMessages,HistoryMessage.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-							historyMessages.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//						if(historyMessages.size() >= 2000){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//							historyMessageDao.batchInsert(new ArrayList<>(historyMessages),HistoryMessage.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//							historyMessages.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					}catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 						e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					} 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -69,7 +69,7 @@ public class HistoryMessageServiceImpl extends BaseServiceImplWithMongo<String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			if(historyMessages.size() > 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				historyMessageDao.batchInsert(historyMessages,HistoryMessage.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				historyMessageDao.batchInsert(historyMessages.stream().sorted(Comparator.comparing(HistoryMessage::getDateTime)).collect(Collectors.toList()),HistoryMessage.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		} catch (IOException e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			e.printStackTrace(); 
			 |