|
@@ -115,7 +115,7 @@ public class PropertyCompanyServiceImpl extends ServiceImpl<PropertyCompanyMappe
|
|
|
rows.add(CollUtil.newArrayList("甲方公司id", "名称", "通讯地址", "状态"));
|
|
|
companies.forEach(company -> {
|
|
|
List<?> row = CollUtil.newArrayList(
|
|
|
- company.getId()
|
|
|
+ company.getId().toString()
|
|
|
, company.getName()
|
|
|
, null != company.getMailingAddress() ? company.getMailingAddress() : "无"
|
|
|
, company.getStatus() == 1 ? "无关联项目" : "有关联项目");
|
|
@@ -124,15 +124,12 @@ public class PropertyCompanyServiceImpl extends ServiceImpl<PropertyCompanyMappe
|
|
|
|
|
|
ExcelWriter writer = ExcelUtil.getWriter(true);
|
|
|
//设置列宽
|
|
|
- writer.setColumnWidth(0, 25);
|
|
|
- writer.setColumnWidth(1, 35);
|
|
|
- writer.setColumnWidth(2, 40);
|
|
|
- writer.setColumnWidth(3, 25);
|
|
|
|
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + LocalDate.now().toString() + ".xlsx");
|
|
|
try (ServletOutputStream out = response.getOutputStream()) {
|
|
|
writer.write(rows);
|
|
|
+ writer.autoSizeColumnAll();
|
|
|
writer.flush(out, true);
|
|
|
writer.close();
|
|
|
} catch (IOException e) {
|