|
|
@@ -16,7 +16,6 @@ import java.util.Map;
|
|
16
|
16
|
import java.util.Set;
|
|
17
|
17
|
import java.util.stream.Collectors;
|
|
18
|
18
|
import javax.servlet.http.HttpServletResponse;
|
|
19
|
|
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
20
|
19
|
import org.apache.poi.ss.usermodel.BorderStyle;
|
|
21
|
20
|
import org.apache.poi.ss.usermodel.Cell;
|
|
22
|
21
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
@@ -507,12 +506,10 @@ public class ExcelUtil<T>
|
|
507
|
506
|
{
|
|
508
|
507
|
if (ColumnType.STRING == attr.cellType())
|
|
509
|
508
|
{
|
|
510
|
|
- cell.setCellType(CellType.STRING);
|
|
511
|
509
|
cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix());
|
|
512
|
510
|
}
|
|
513
|
511
|
else if (ColumnType.NUMERIC == attr.cellType())
|
|
514
|
512
|
{
|
|
515
|
|
- cell.setCellType(CellType.NUMERIC);
|
|
516
|
513
|
cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value));
|
|
517
|
514
|
}
|
|
518
|
515
|
}
|
|
|
@@ -915,10 +912,10 @@ public class ExcelUtil<T>
|
|
915
|
912
|
Cell cell = row.getCell(column);
|
|
916
|
913
|
if (StringUtils.isNotNull(cell))
|
|
917
|
914
|
{
|
|
918
|
|
- if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA)
|
|
|
915
|
+ if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA)
|
|
919
|
916
|
{
|
|
920
|
917
|
val = cell.getNumericCellValue();
|
|
921
|
|
- if (HSSFDateUtil.isCellDateFormatted(cell))
|
|
|
918
|
+ if (DateUtil.isCellDateFormatted(cell))
|
|
922
|
919
|
{
|
|
923
|
920
|
val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换
|
|
924
|
921
|
}
|
|
|
@@ -934,15 +931,15 @@ public class ExcelUtil<T>
|
|
934
|
931
|
}
|
|
935
|
932
|
}
|
|
936
|
933
|
}
|
|
937
|
|
- else if (cell.getCellTypeEnum() == CellType.STRING)
|
|
|
934
|
+ else if (cell.getCellType() == CellType.STRING)
|
|
938
|
935
|
{
|
|
939
|
936
|
val = cell.getStringCellValue();
|
|
940
|
937
|
}
|
|
941
|
|
- else if (cell.getCellTypeEnum() == CellType.BOOLEAN)
|
|
|
938
|
+ else if (cell.getCellType() == CellType.BOOLEAN)
|
|
942
|
939
|
{
|
|
943
|
940
|
val = cell.getBooleanCellValue();
|
|
944
|
941
|
}
|
|
945
|
|
- else if (cell.getCellTypeEnum() == CellType.ERROR)
|
|
|
942
|
+ else if (cell.getCellType() == CellType.ERROR)
|
|
946
|
943
|
{
|
|
947
|
944
|
val = cell.getErrorCellValue();
|
|
948
|
945
|
}
|