fastexcel可以快速简单读取excel数据,将ApachePOI进行了薄封装,基于注解,更加易于使用。
使用样例FastExcel fastExcel = ew FastExcel("E:/data.xlsx"); fastExcel.setSheetName("活动信息数据"); List<MyTest> tests = fastExcel.parse(MyTest.class); if(ull != tests && !tests.isEmpty()) { for(MyTest myTest : tests) { LOG.debug("记录:{}", myTest.toStrig()); } } else { LOG.debug("没有结果"); }映射类:
public class MyTest { @MapperCell(cellName = "名称") private Strig ame; @MapperCell(cellName = "联系电话") private Strig phoe; @MapperCell(cellName = "地址") private Strig address; @MapperCell(cellName = "一级分类ID") private it type; @MapperCell(cellName = "经度") private double lat;}






评论