Răsfoiți Sursa

修改tools-poi,使用对象输出excel时,Integer和Long类型的字段默认按double单元格类型写入

Signed-off-by: luoshi <luoshi@qmth.com.cn>
luoshi 8 luni în urmă
părinte
comite
2214a4ed0a

+ 0 - 5
tools-poi/src/main/java/com/qmth/boot/tools/excel/convertor/impl/IntegerConvertor.java

@@ -15,11 +15,6 @@ public class IntegerConvertor implements ValueConvertor<Integer> {
 
     @Override
     public void format(Integer object, FieldParam param, Cell cell) throws Exception {
-        //        if (StringUtils.isNotBlank(param.getAnnotation().pattern())) {
-        //            cell.setCellValue(new DecimalFormat(param.getAnnotation().pattern()).format(object));
-        //        } else {
-        //            cell.setCellValue(object);
-        //        }
         cell.setCellValue(object);
     }
 }

+ 1 - 1
tools-poi/src/main/java/com/qmth/boot/tools/excel/convertor/impl/LongConvertor.java

@@ -15,6 +15,6 @@ public class LongConvertor implements ValueConvertor<Long> {
 
     @Override
     public void format(Long object, FieldParam param, Cell cell) throws Exception {
-        cell.setCellValue(String.valueOf(object));
+        cell.setCellValue(object);
     }
 }