作者 shenhailong

更改 poi 版本

优化代码
@@ -62,12 +62,12 @@ @@ -62,12 +62,12 @@
62 <dependency> 62 <dependency>
63 <groupId>org.apache.poi</groupId> 63 <groupId>org.apache.poi</groupId>
64 <artifactId>poi</artifactId> 64 <artifactId>poi</artifactId>
65 - <version>3.6</version> 65 + <version>4.1.0</version>
66 </dependency> 66 </dependency>
67 <dependency> 67 <dependency>
68 <groupId>org.apache.poi</groupId> 68 <groupId>org.apache.poi</groupId>
69 <artifactId>poi-ooxml</artifactId> 69 <artifactId>poi-ooxml</artifactId>
70 - <version>3.17</version> 70 + <version>4.1.0</version>
71 </dependency> 71 </dependency>
72 72
73 <dependency> 73 <dependency>
@@ -82,6 +82,12 @@ @@ -82,6 +82,12 @@
82 <version>5.2.0.BUILD-SNAPSHOT</version> 82 <version>5.2.0.BUILD-SNAPSHOT</version>
83 <scope>compile</scope> 83 <scope>compile</scope>
84 </dependency> 84 </dependency>
  85 + <dependency>
  86 + <groupId>org.apache.tomcat.embed</groupId>
  87 + <artifactId>tomcat-embed-core</artifactId>
  88 + <version>9.0.56</version>
  89 + <scope>compile</scope>
  90 + </dependency>
85 </dependencies> 91 </dependencies>
86 92
87 <build> 93 <build>
@@ -18,6 +18,8 @@ import java.io.InputStream; @@ -18,6 +18,8 @@ import java.io.InputStream;
18 import java.util.ArrayList; 18 import java.util.ArrayList;
19 import java.util.List; 19 import java.util.List;
20 20
  21 +import static org.apache.poi.ss.usermodel.CellType.STRING;
  22 +
21 /** 23 /**
22 * shenhailong 24 * shenhailong
23 * 2020/4/27/14:29 25 * 2020/4/27/14:29
@@ -143,7 +145,7 @@ public class ExcelUtils { @@ -143,7 +145,7 @@ public class ExcelUtils {
143 if (hssfCell == null) { 145 if (hssfCell == null) {
144 rowList.add(""); 146 rowList.add("");
145 } else { 147 } else {
146 - hssfCell.setCellType(Cell.CELL_TYPE_STRING); 148 + hssfCell.setCellType(STRING);
147 rowList.add(String.valueOf(hssfCell.getStringCellValue())); 149 rowList.add(String.valueOf(hssfCell.getStringCellValue()));
148 } 150 }
149 } 151 }