Bladeren bron

修改Excel设置STRING单元格类型

RuoYi 5 jaren geleden
bovenliggende
commit
7d94113d24

+ 1 - 1
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java

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