https://github.com/SargerasWang/ExcelUtil
https://sargeraswang.com/blog/2018/11/27/excelutil-1-dot-2-1-doc/
<dependency>
<groupId>com.sargeraswang.util</groupId>
<artifactId>excel-util</artifactId>
<version>1.2.1</version>
</dependency>
官网1.2.4在maven中央仓库好像没有
public class Propmanger {
private String proOrgCode;
private String cityOrgCode;
@ExcelCell(index = 0)
private String provinceName;
@ExcelCell(index = 1)
private String cityName;
//setter and getter 省略...
}
List<Propmanger> propmangers = propertyMangerService.seleceAll();
System.out.println(propmangers.size());
Map<String,String> map = new LinkedHashMap<>();
map.put("provinceName","省");
map.put("cityName","市");
File f=new File("test.xls");
OutputStream out =new FileOutputStream(f);
ExcelUtil.exportExcel(map, propmangers, out);
out.close();
手机扫一扫
移动阅读更方便
你可能感兴趣的文章