fasterexcelExcel 數(shù)據(jù)處理工具
fastexcel 可以快速簡(jiǎn)單讀取excel數(shù)據(jù),將 Apache POI 進(jìn)行了薄封裝,基于注解,更加易于使用。
使用樣例
FastExcel fastExcel = new FastExcel("E:/data.xlsx");
fastExcel.setSheetName("活動(dòng)信息數(shù)據(jù)");
List<MyTest> tests = fastExcel.parse(MyTest.class);
if(null != tests && !tests.isEmpty()) {
for(MyTest myTest : tests) {
LOG.debug("記錄:{}", myTest.toString());
}
} else {
LOG.debug("沒有結(jié)果");
}
映射類:
public class MyTest {
@MapperCell(cellName = "名稱")
private String name;
@MapperCell(cellName = "聯(lián)系電話")
private String phone;
@MapperCell(cellName = "地址")
private String address;
@MapperCell(cellName = "一級(jí)分類ID")
private int type;
@MapperCell(cellName = "經(jīng)度")
private double lat;
}評(píng)論
圖片
表情
