diff --git a/pom.xml b/pom.xml index 056f845..607b508 100755 --- a/pom.xml +++ b/pom.xml @@ -62,12 +62,12 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> - <version>3.6</version> + <version>4.1.0</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> - <version>3.17</version> + <version>4.1.0</version> </dependency> <dependency> @@ -82,6 +82,12 @@ <version>5.2.0.BUILD-SNAPSHOT</version> <scope>compile</scope> </dependency> + <dependency> + <groupId>org.apache.tomcat.embed</groupId> + <artifactId>tomcat-embed-core</artifactId> + <version>9.0.56</version> + <scope>compile</scope> + </dependency> </dependencies> <build> @@ -98,4 +104,4 @@ </plugins> </build> -</project> \ No newline at end of file +</project> diff --git a/src/main/java/com/tianbo/util/ExcelUtils/ExcelUtils.java b/src/main/java/com/tianbo/util/ExcelUtils/ExcelUtils.java index 42172c7..ce5f049 100644 --- a/src/main/java/com/tianbo/util/ExcelUtils/ExcelUtils.java +++ b/src/main/java/com/tianbo/util/ExcelUtils/ExcelUtils.java @@ -18,6 +18,8 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.List; +import static org.apache.poi.ss.usermodel.CellType.STRING; + /** * shenhailong * 2020/4/27/14:29 @@ -143,7 +145,7 @@ public class ExcelUtils { if (hssfCell == null) { rowList.add(""); } else { - hssfCell.setCellType(Cell.CELL_TYPE_STRING); + hssfCell.setCellType(STRING); rowList.add(String.valueOf(hssfCell.getStringCellValue())); } }