public class BsMatrixConsortiumBo{ private Long id; private String applyScopeConsortium; private String companyPointNo; private String standardPointNo; private String businessProcess; private String sonProcess; private String controlTarget; private String companyPointMessage; private String standardPointMessage; private String controlRate; private String controlType; private String controlClass; private String suggestDutyDept; private String companyDutyDept; private String companyPointUser; private String nkDesignDutyDept; private String nkProcessUser; private String pointExecuteTime; private String itWeldingMode; private String weldingSystem; private String pointClass; private String trajectionTestData; private String referenceFile; private String suggestFollow; private String year; private String matrixType; }
List<BsMatrixConsortiumVo> list = iBsMatrixConsortiumService.queryList(bo);
for (int i = 0; i < list.size(); i++) {
int index = i + 1;
list.get(i).setId(Long.parseLong(index + ""));//序号
}
BufferedOutputStream bos = null;
String temPath = fileTemplatesDir + "集团矩阵.xlsx";
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=内控矩阵excel");
try {
bos = new BufferedOutputStream(response.getOutputStream());
ExcelWriter excelWriter = EasyExcel.write(bos).withTemplate(temPath).build();
WriteSheet writeSheet = EasyExcel.writerSheet().build();
excelWriter.fill(list,writeSheet);
excelWriter.finish();
bos.flush();
} catch (IOException e) {
e.printStackTrace();
}

浙公网安备 33010602011771号