This commit is contained in:
Looly
2023-09-27 10:15:56 +08:00
parent 7230b074ac
commit 997f2af8cd
12 changed files with 21 additions and 20 deletions

View File

@@ -187,7 +187,7 @@ public class ExcelSaxUtil {
try {
xmlReader = XMLHelper.newXMLReader();
} catch (final SAXException | ParserConfigurationException e) {
if (e.getMessage().contains("org.mina.xerces.parsers.SAXParser")) {
if (e.getMessage().contains("org.apache.xerces.parsers.SAXParser")) {
throw new DependencyException(e, "You need to add 'xerces:xercesImpl' to your project and version >= 2.11.0");
} else {
throw new POIException(e);

View File

@@ -12,11 +12,12 @@
package org.dromara.hutool.poi.excel;
import org.dromara.hutool.poi.excel.cell.values.NumericCellValue;
import java.util.Date;
import org.apache.poi.ss.usermodel.Cell;
import org.dromara.hutool.poi.excel.cell.values.NumericCellValue;
import org.junit.jupiter.api.Test;
import java.util.Date;
public class NumericCellValueTest {
@Test
@@ -25,7 +26,7 @@ public class NumericCellValueTest {
final ExcelWriter writer = ExcelUtil.getWriter("1899bug_write.xlsx");
final Cell cell = reader.getCell(0, 0);
// 直接取值
// 和CellUtil.getCellValue(org.mina.poi.ss.usermodel.Cell)方法的结果一样
// 和CellUtil.getCellValue(org.apache.poi.ss.usermodel.Cell)方法的结果一样
// 1899-12-31 04:39:00
final Date cellValue = cell.getDateCellValue();
// 将这个值写入EXCEL中自定义样式的单元格结果会是-1