commit
This commit is contained in:
+5
-7
@@ -310,16 +310,14 @@ public class ActivityCommonController {
|
|||||||
sql.setVar("cnd", "and u.unionid='" + unionId + "'");
|
sql.setVar("cnd", "and u.unionid='" + unionId + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Record> list = activitySchoolApplyService.list(sql);
|
List<NutMap> list = activitySchoolApplyService.listMap(sql);
|
||||||
String activityName = list.get(0).getString("activityName");
|
String activityName = list.get(0).getString("activityName");
|
||||||
|
|
||||||
List<ActivitySchoolApply> excels = new ArrayList<>();
|
|
||||||
|
|
||||||
list.forEach(z -> {
|
list.forEach(z -> {
|
||||||
ActivitySchoolApply schoolApply = z.toPojo(ActivitySchoolApply.class);
|
List<String> identity = Json.fromJsonAsList(String.class, z.getString("identity"));
|
||||||
String s = schoolApply.getIdentity().stream().map(personType::getName).collect(Collectors.toList()).toString();
|
String s = identity.stream().map(personType::getName).collect(Collectors.toList()).toString();
|
||||||
schoolApply.setSf(s);
|
z.addv("sf", s);
|
||||||
excels.add(schoolApply);
|
|
||||||
});
|
});
|
||||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||||
exportEntities.add(new ExcelExportEntity("小队名称", "team", 20));
|
exportEntities.add(new ExcelExportEntity("小队名称", "team", 20));
|
||||||
@@ -334,7 +332,7 @@ public class ActivityCommonController {
|
|||||||
|
|
||||||
response.setContentType("application/octet-stream");
|
response.setContentType("application/octet-stream");
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=" + new String((activityName + "报名表.xls").getBytes("utf-8"), "ISO8859-1"));
|
response.setHeader("Content-Disposition", "attachment;filename=" + new String((activityName + "报名表.xls").getBytes("utf-8"), "ISO8859-1"));
|
||||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, excels);
|
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, list);
|
||||||
workbook.write(response.getOutputStream());
|
workbook.write(response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user