From 0a3dd0fe6b2cce7a6ae3a881fd67f3a63e484047 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Sun, 8 Sep 2019 18:59:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E5=80=BC=E7=9A=84=E6=97=B6=E5=80=99=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E4=BA=86=E9=A2=9D=E5=A4=96=E5=80=BC=E5=AF=BC=E8=87=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BD=AC=E6=8D=A2=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/question.md | 2 +- .../excel/analysis/v07/handlers/DefaultCellHandler.java | 3 +++ .../java/com/alibaba/easyexcel/test/temp/simple/HgTest.java | 2 +- update.md | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index f546e71a..06adf1ae 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -12,5 +12,5 @@ assignees: '' 这里写你的代码 ``` **异常提示** -请提供完整的异常提示 +请提供完整的异常提示,记住是全部异常! **建议描述** diff --git a/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java b/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java index 0ee8ab3a..92b19097 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java @@ -148,6 +148,9 @@ public class DefaultCellHandler implements XlsxCellHandler, XlsxRowResultHolder currentCellData.setFormulaValue(currentCellValue); return; } + if (!CELL_VALUE_TAG.equals(currentTag) && !CELL_INLINE_STRING_VALUE_TAG.equals(currentTag)) { + return; + } CellDataTypeEnum oldType = currentCellData.getType(); switch (oldType) { case DIRECT_STRING: diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java b/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java index 62e5b154..b588a11c 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java @@ -24,7 +24,7 @@ public class HgTest { @Test public void hh() throws IOException { List list = - EasyExcel.read(new FileInputStream("D:\\test\\原文件.xlsx")).headRowNumber(0).sheet().doReadSync(); + EasyExcel.read(new FileInputStream("D:\\test\\20190906192340.xlsx")).headRowNumber(0).sheet().doReadSync(); for (Object data : list) { LOGGER.info("返回数据:{}", JSON.toJSONString(data)); } diff --git a/update.md b/update.md index 88df3f9c..6450894d 100644 --- a/update.md +++ b/update.md @@ -1,3 +1,6 @@ +# 2.0.0-beta5 +* 修复在读取值的时候读取了额外值导致数据转换异常 + # 2.0.0-beta4 * 修改在传入List>判断行数错误 [Issue #526](https://github.com/alibaba/easyexcel/issues/526) * 修复在mac 2016 2017导出的excel 可能存在多余字段的问题 From a91cb48d2f226079e79daafd06486addecf16c83 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Sun, 8 Sep 2019 19:09:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E5=80=BC=E7=9A=84=E6=97=B6=E5=80=99=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E4=BA=86=E9=A2=9D=E5=A4=96=E5=80=BC=E5=AF=BC=E8=87=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BD=AC=E6=8D=A2=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3241410a..cd5f0fe2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.alibaba easyexcel - 2.0.0-beta4 + 2.0.0-beta5 jar easyexcel