| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.yssh.entity.SuYuan; |
| | | import com.yssh.service.SuYuanService; |
| | | |
| | | import com.github.biyanwen.impl.AbstractCsvFileParser; |
| | | import com.yssh.entity.SuYuan; |
| | | import com.yssh.service.ISuYuanService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | public class CsvParser extends AbstractCsvFileParser<SuYuan> { |
| | | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | |
| | | */ |
| | | private List<SuYuan> cachedData = new ArrayList<>(BATCH_COUNT); |
| | | |
| | | private ISuYuanService suYuanService; |
| | | private SuYuanService suYuanService; |
| | | |
| | | private String time; |
| | | |
| | | public CsvParser(ISuYuanService suYuanService, String time) { |
| | | public CsvParser(SuYuanService suYuanService, String time) { |
| | | this.suYuanService = suYuanService; |
| | | this.time = time; |
| | | } |
| | |
| | | /** |
| | | * 所有数据解析完成了 会来调用,防止有数据没有被保存 |
| | | */ |
| | | @Override |
| | | protected void doAfterAllAnalysed() { |
| | | try { |
| | | saveSuYuanData(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void invoke(SuYuan t) { |
| | | t.setId(t.getX() + "_" + t.getY() + "_" + t.getZ()); |
| | | if ("0_0_0".equals(t.getId())) { |