fastexcel v0.0.4,快速简单操作 excel 小工具

来源: 投稿
作者: 愚_者
2016-09-23 00:00:00

FastExcel 能快速简单读取 excel 数据,将 Apache POI 进行了薄封装,基于注解,更加易于使用

本次更新:

  • 1.升级poi版本至3.15

  • 2.适配3.15最新的API

  • 3.修复将整数判定为浮点数问题

使用样例:

FastExcel fastExcel = new FastExcel("E:/data.xlsx");
        fastExcel.setSheetName("活动信息数据");
        List<MyTest> tests = fastExcel.parse(MyTest.class);
        if(null != tests && !tests.isEmpty()) {
            for(MyTest myTest : tests) {
                LOG.debug("记录:{}", myTest.toString());
            }
        } else {
            LOG.debug("没有结果");
        }

映射类

public class MyTest {
   
    @MapperCell(cellName = "名称")
    private String name;
   
    @MapperCell(cellName = "联系电话")
    private String phone;
   
    @MapperCell(cellName = "地址")
    private String address;
   
    @MapperCell(cellName = "一级分类ID")
    private int type;
   
    @MapperCell(cellName = "经度")
    private double lat;
展开阅读全文
点击加入讨论🔥(15) 发布并加入讨论🔥
本篇精彩评论
推荐一个功能丰富、兼容性好、高性能的 Excel 文档基础库 #Excelize#https://github.com/xuri/excelize
2020-11-19 10:16
1
举报
15 评论
133 收藏
分享
返回顶部
顶部