diff --git a/pom.xml b/pom.xml
index fe46977f..c590f8f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
com.alibaba
easyexcel
- 2.1.6
+ 2.1.7
jar
easyexcel
diff --git a/src/main/java/com/alibaba/excel/ExcelReader.java b/src/main/java/com/alibaba/excel/ExcelReader.java
index 07a373b7..39479e14 100644
--- a/src/main/java/com/alibaba/excel/ExcelReader.java
+++ b/src/main/java/com/alibaba/excel/ExcelReader.java
@@ -136,6 +136,8 @@ public class ExcelReader {
readWorkbook.setReadCache(new MapCache());
readWorkbook.setConvertAllFiled(Boolean.FALSE);
readWorkbook.setDefaultReturnMap(Boolean.FALSE);
+ // The previous logic was that Article 0 started reading
+ readWorkbook.setHeadRowNumber(0);
excelAnalyser = new ExcelAnalyserImpl(readWorkbook);
}
diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java b/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
index b046d143..38eecb00 100644
--- a/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
+++ b/src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
@@ -1,6 +1,7 @@
package com.alibaba.easyexcel.test.temp.read;
import java.io.File;
+import java.io.FileInputStream;
import org.junit.Ignore;
import org.junit.Test;
@@ -8,7 +9,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.cache.Ehcache;
+import com.alibaba.excel.support.ExcelTypeEnum;
/**
* 临时测试
@@ -18,6 +21,13 @@ import com.alibaba.excel.cache.Ehcache;
@Ignore
public class HeadReadTest {
private static final Logger LOGGER = LoggerFactory.getLogger(HeadReadTest.class);
+ @Test
+ public void testread() throws Exception {
+ FileInputStream fileInputStream = new FileInputStream("D://test/t1.xlsx");
+
+ ExcelReader excelReader = new ExcelReader(fileInputStream, ExcelTypeEnum.XLSX, null, new TestListener());
+ excelReader.read();
+ }
@Test
public void test() throws Exception {
diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/read/TestListener.java b/src/test/java/com/alibaba/easyexcel/test/temp/read/TestListener.java
new file mode 100644
index 00000000..fb80a9a4
--- /dev/null
+++ b/src/test/java/com/alibaba/easyexcel/test/temp/read/TestListener.java
@@ -0,0 +1,27 @@
+package com.alibaba.easyexcel.test.temp.read;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.alibaba.fastjson.JSON;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * TODO
+ *
+ * @author JiaJu Zhuang
+ * @date 2020/4/9 16:33
+ **/
+@Slf4j
+public class TestListener extends AnalysisEventListener {
+
+ @Override
+ public void invoke(Object o, AnalysisContext analysisContext) {
+ log.info("解析一条:{}", JSON.toJSONString(o));
+ }
+
+ @Override
+ public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+
+ }
+}
diff --git a/update.md b/update.md
index 46258104..c1e4517d 100644
--- a/update.md
+++ b/update.md
@@ -1,3 +1,6 @@
+# 2.1.7
+* 修复使用1+版本的写法,第1条开始读修改为第0条开始读
+
# 2.1.6
* 修复填充只有`sheetName`会抛异常