Browse Source

Merge pull request #561 from alibaba/2.0.0-beta5

修复在读取值的时候读取了额外值导致数据转换异常
bugfix
Jiaju Zhuang 5 years ago committed by GitHub
parent
commit
30cc4a3979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/ISSUE_TEMPLATE/question.md
  2. 2
      pom.xml
  3. 3
      src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java
  4. 2
      src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java
  5. 3
      update.md

2
.github/ISSUE_TEMPLATE/question.md

@ -12,5 +12,5 @@ assignees: ''
这里写你的代码
```
**异常提示**
请提供完整的异常提示
请提供完整的异常提示,记住是全部异常!
**建议描述**

2
pom.xml

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>2.0.0-beta4</version>
<version>2.0.0-beta5</version>
<packaging>jar</packaging>
<name>easyexcel</name>

3
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:

2
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<Object> 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));
}

3
update.md

@ -1,3 +1,6 @@
# 2.0.0-beta5
* 修复在读取值的时候读取了额外值导致数据转换异常
# 2.0.0-beta4
* 修改在传入List<List<Object>>判断行数错误 [Issue #526](https://github.com/alibaba/easyexcel/issues/526)
* 修复在mac 2016 2017导出的excel 可能存在多余字段的问题

Loading…
Cancel
Save