update ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java.
替换已过时的方法以及类
This commit is contained in:
parent
23b98a3ef8
commit
4309b6cfe0
|
|
@ -905,12 +905,13 @@ public class ExcelUtil<T>
|
||||||
Cell cell = row.getCell(column);
|
Cell cell = row.getCell(column);
|
||||||
if (StringUtils.isNotNull(cell))
|
if (StringUtils.isNotNull(cell))
|
||||||
{
|
{
|
||||||
if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA)
|
if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA)
|
||||||
{
|
{
|
||||||
val = cell.getNumericCellValue();
|
val = cell.getNumericCellValue();
|
||||||
if (HSSFDateUtil.isCellDateFormatted(cell))
|
if (DateUtil.isCellDateFormatted(cell))
|
||||||
{
|
{
|
||||||
val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换
|
// POI Excel 日期格式转换
|
||||||
|
val = DateUtil.getJavaDate((Double) val);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -924,15 +925,15 @@ public class ExcelUtil<T>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cell.getCellTypeEnum() == CellType.STRING)
|
else if (cell.getCellType() == CellType.STRING)
|
||||||
{
|
{
|
||||||
val = cell.getStringCellValue();
|
val = cell.getStringCellValue();
|
||||||
}
|
}
|
||||||
else if (cell.getCellTypeEnum() == CellType.BOOLEAN)
|
else if (cell.getCellType() == CellType.BOOLEAN)
|
||||||
{
|
{
|
||||||
val = cell.getBooleanCellValue();
|
val = cell.getBooleanCellValue();
|
||||||
}
|
}
|
||||||
else if (cell.getCellTypeEnum() == CellType.ERROR)
|
else if (cell.getCellType() == CellType.ERROR)
|
||||||
{
|
{
|
||||||
val = cell.getErrorCellValue();
|
val = cell.getErrorCellValue();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue