From 5c49c6f9a7e377bb46f7cb617f72b11fc17d5331 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 24 五月 2023 14:10:14 +0800
Subject: [PATCH] 1

---
 src/main/java/com/yssh/utils/CsvParser.java |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/yssh/utils/CsvParser.java b/src/main/java/com/yssh/utils/CsvParser.java
index 04aadee..abf6a9c 100644
--- a/src/main/java/com/yssh/utils/CsvParser.java
+++ b/src/main/java/com/yssh/utils/CsvParser.java
@@ -12,27 +12,27 @@
 import com.yssh.entity.SuYuan;
 import com.yssh.service.ISuYuanService;
 
-public class CsvParser extends AbstractCsvFileParser<SuYuan>{
+public class CsvParser extends AbstractCsvFileParser<SuYuan> {
 
 	protected final Log logger = LogFactory.getLog(this.getClass());
 	/**
 	 * 姣忛殧3000鏉″瓨鍌ㄦ暟鎹簱锛岀劧鍚庢竻鐞唋ist 锛屾柟渚垮唴瀛樺洖鏀�
 	 */
 	public static final int BATCH_COUNT = 100000;
-	
+
 	/**
 	 * 缂撳瓨鐨勬暟鎹�
 	 */
 	private List<SuYuan> cachedData = new ArrayList<>(BATCH_COUNT);
-	
+
 	private ISuYuanService suYuanService;
 	private String time;
-	
+
 	public CsvParser(ISuYuanService suYuanService, String time) {
 		this.suYuanService = suYuanService;
 		this.time = time;
 	}
-	
+
 	/**
 	 * 鎵�鏈夋暟鎹В鏋愬畬鎴愪簡 浼氭潵璋冪敤,闃叉鏈夋暟鎹病鏈夎淇濆瓨
 	 */
@@ -49,6 +49,10 @@
 	@Override
 	protected void invoke(SuYuan t) {
 		t.setId(t.getX() + "_" + t.getY() + "_" + t.getZ());
+		if ("0_0_0".equals(t.getId())) {
+			return; // 瑙e喅涓婚敭閲嶅
+		}
+
 		//System.err.println(t.getId());
 		cachedData.add(t);
 		// 杈惧埌BATCH_COUNT浜嗭紝闇�瑕佸幓瀛樺偍涓�娆℃暟鎹簱锛岄槻姝㈡暟鎹嚑涓囨潯鏁版嵁鍦ㄥ唴瀛橈紝瀹规槗OOM
@@ -67,5 +71,4 @@
 	private void saveSuYuanData() throws Exception {
 		suYuanService.insertSuYuanDatas(cachedData, time);
 	}
-	
 }

--
Gitblit v1.9.3