|
@@ -84,6 +84,8 @@ public class ExportController extends BaseController {
|
|
|
private TeacherAttendanceService teacherAttendanceService;
|
|
|
@Autowired
|
|
|
private TeacherCourseRewardService teacherCourseRewardService;
|
|
|
+ @Autowired
|
|
|
+ private DegreeRegistrationService degreeRegistrationService;
|
|
|
|
|
|
@ApiOperation(value = "导出教师考勤列表")
|
|
|
@PostMapping("export/queryTeacherAttendances")
|
|
@@ -1565,4 +1567,52 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation(value = "考级报名导出")
|
|
|
+ @RequestMapping("export/degreeRegistration")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/degreeRegistration')")
|
|
|
+ public void queryPage(DegreeQueryInfo queryInfo,HttpServletResponse response) throws IOException {
|
|
|
+ queryInfo.setStatus(2);
|
|
|
+ queryInfo.setSort("create_time_");
|
|
|
+ queryInfo.setOrder("ASC");
|
|
|
+ queryInfo.setRows(65000);
|
|
|
+ PageInfoDegree<DegreeRegistration> pageList = degreeRegistrationService.getPageList(queryInfo);
|
|
|
+ if (pageList.getTotal() <= 0) {
|
|
|
+ response.setStatus(500);
|
|
|
+ response.setContentType("Content-Type: application/json;charset=UTF-8");
|
|
|
+ response.getOutputStream().write("{\"data\": null, \"code\": 500, \"status\": false, \"msg\": \"没有可导出的记录\"}".getBytes());
|
|
|
+ response.flushBuffer();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ try {
|
|
|
+ for (DegreeRegistration row : pageList.getRows()) {
|
|
|
+ if(row.getGender().equals(1)){
|
|
|
+ row.setGender("男");
|
|
|
+ } else {
|
|
|
+ row.setGender("女");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] header = {"名字", "性别", "身份证号", "城市", "学校", "乐器", "考试级别", "乐理级别", "乐理级别证书", "家长联系电话", "考级费用", "乐理费用", "备注"};
|
|
|
+ String[] body = {"name", "gender", "idcard", "city", "school", "subject", "level", "theoryLevel", "theoryCert", "mobile", "money", "theoryMoney", "memo"};
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(header, body, pageList.getRows());
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
+ response.flushBuffer();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|