接口
void download(List<EnterpriseBaseInfo> all, HttpServletResponse response) throws IOException;
实现类
@Override
public void download(List<EnterpriseBaseInfo> all, HttpServletResponse response) throws IOException
{
List<Map<String, Object>> list = new ArrayList<>();
for (EnterpriseBaseInfo enterpriseBaseInfo : all) {
Map<String,Object> map = new LinkedHashMap<>();
map.put("企业名称", enterpriseBaseInfo.getName());
map.put("社会信用代码", enterpriseBaseInfo.getCreditCode());
map.put("企业性质", enterpriseNatureDao.getOne(enterpriseBaseInfo.getNature()).getName());
map.put("行业门类", enterpriseBaseInfo.getIndustryCategory());
map.put("行业主管部门", industryDepartmentDao.getOne(enterpriseBaseInfo.getDepartmentId()).getName());
map.put("运营状态 1运营中,2停业", enterpriseBaseInfo.getEnterpriseStatus());
map.put("法人姓名", enterpriseBaseInfo.getLegalName());
map.put("法人号码", enterpriseBaseInfo.getLegalPhone());
map.put("地址", enterpriseBaseInfo.getAddress());
list.add(map);
}
ExcelUtils.createExcel(list, "企业信息", "企业信息数据", response);
}