Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
金手指1668
easyexcel
提交
ff851219
E
easyexcel
项目概览
金手指1668
/
easyexcel
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
easyexcel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff851219
编写于
4月 09, 2020
作者:
庄家钜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* 修复使用1+版本的写法,第1条开始读修改为第0条开始读
上级
c6f21608
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
43 addition
and
1 deletion
+43
-1
pom.xml
pom.xml
+1
-1
src/main/java/com/alibaba/excel/ExcelReader.java
src/main/java/com/alibaba/excel/ExcelReader.java
+2
-0
src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
...va/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
+10
-0
src/test/java/com/alibaba/easyexcel/test/temp/read/TestListener.java
...va/com/alibaba/easyexcel/test/temp/read/TestListener.java
+27
-0
update.md
update.md
+3
-0
未找到文件。
pom.xml
浏览文件 @
ff851219
...
...
@@ -4,7 +4,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.alibaba
</groupId>
<artifactId>
easyexcel
</artifactId>
<version>
2.1.
6
</version>
<version>
2.1.
7
</version>
<packaging>
jar
</packaging>
<name>
easyexcel
</name>
...
...
src/main/java/com/alibaba/excel/ExcelReader.java
浏览文件 @
ff851219
...
...
@@ -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
);
}
...
...
src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
浏览文件 @
ff851219
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
{
...
...
src/test/java/com/alibaba/easyexcel/test/temp/read/TestListener.java
0 → 100644
浏览文件 @
ff851219
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
)
{
}
}
update.md
浏览文件 @
ff851219
# 2.1.7
*
修复使用1+版本的写法,第1条开始读修改为第0条开始读
# 2.1.6
*
修复填充只有
`sheetName`
会抛异常
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录