修改Excel设置STRING单元格类型

This commit is contained in:
RuoYi
2020-08-05 13:02:57 +08:00
committed by 疯狂的狮子li
parent 07a32ce3fd
commit 7d466de9ff

View File

@@ -467,7 +467,7 @@ public class ExcelUtil<T>
{ {
if (ColumnType.STRING == attr.cellType()) if (ColumnType.STRING == attr.cellType())
{ {
cell.setCellType(CellType.NUMERIC); cell.setCellType(CellType.STRING);
cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix());
} }
else if (ColumnType.NUMERIC == attr.cellType()) else if (ColumnType.NUMERIC == attr.cellType())