|
@@ -1449,4 +1449,91 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "vip评论列表导出")
|
|
|
+ @RequestMapping("export/vipCourseReviews")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/vipCourseReviews')")
|
|
|
+ public void vipCourseReviews(CourseReviewQueryInfo queryInfo, HttpServletResponse response) throws IOException {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (!sysUser.getIsSuperAdmin()) {
|
|
|
+ Employee employee = employeeDao.get(sysUser.getId());
|
|
|
+ queryInfo.setOrganId(employee.getOrganIdList());
|
|
|
+ }
|
|
|
+ queryInfo.setIsExport(1);
|
|
|
+ queryInfo.setRows(99999);
|
|
|
+ PageInfo<CourseReviewDto> practiceGroupReviews = courseReviewService.getVipCourseReviews(queryInfo);
|
|
|
+ if (practiceGroupReviews.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 (CourseReviewDto row : practiceGroupReviews.getRows()) {
|
|
|
+ row.setClassDateStr(DateUtil.dateToString(row.getClassDate(), "yyyy-MM-dd"));
|
|
|
+ if (row.getHandHomework() != null && row.getHandHomework() > 0) {
|
|
|
+ row.setHandHomeworkStr("是");
|
|
|
+ } else {
|
|
|
+ row.setHandHomeworkStr("否");
|
|
|
+ }
|
|
|
+ if (row.getHasLiaison() != null && row.getHasLiaison().equals("1")) {
|
|
|
+ row.setHasLiaison("是");
|
|
|
+ } else {
|
|
|
+ row.setHasLiaison("否");
|
|
|
+ }
|
|
|
+ if (row.getCreateTime() != null) {
|
|
|
+ row.setCreateTimeStr(DateUtil.dateToString(row.getCreateTime(), "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ if (row.getPronunciation() != null) {
|
|
|
+ row.setPronunciationStr(row.getPronunciation() + "星");
|
|
|
+ }
|
|
|
+ if (row.getTempo() != null) {
|
|
|
+ row.setTempoStr(row.getTempo() + "星");
|
|
|
+ }
|
|
|
+ if (row.getMusicTheory() != null) {
|
|
|
+ row.setMusicTheoryStr(row.getMusicTheory() + "星");
|
|
|
+ }
|
|
|
+ if (row.getHomeWorkReplied() != null && row.getHomeWorkReplied().equals("1")) {
|
|
|
+ row.setHomeWorkReplied("已回复");
|
|
|
+ } else if (row.getHandHomework() != null && row.getHandHomework() > 0) {
|
|
|
+ row.setHomeWorkReplied("未回复");
|
|
|
+ } else {
|
|
|
+ row.setHomeWorkReplied(null);
|
|
|
+ }
|
|
|
+ if (row.getAttendanceId() != null) {
|
|
|
+ row.setAttendanceStr("是");
|
|
|
+ } else {
|
|
|
+ row.setAttendanceStr("否");
|
|
|
+ }
|
|
|
+ if(new Integer(1).equals(row.getAssignHomework())){
|
|
|
+ row.setAssignHomeworkStr("是");
|
|
|
+ }else{
|
|
|
+ row.setAssignHomeworkStr("否");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] header = {"分部", "上课日期", "课程编号", "课程班名称", "老师", "教材内容", "发音", "节奏", "乐理", "曲目", "评价备注", "回访日期(布置作业)", "是否布置作业", "是否提交作业", "教务老师", "教务评价"};
|
|
|
+ String[] body = {"organName", "classDateStr", "id", "courseName", "teacherName", "teachingMaterial", "pronunciationStr", "tempoStr", "musicTheoryStr", "song", "memo", "createTimeStr", "assignHomeworkStr", "handHomeworkStr", "eduTeacherName", "courseReview"};
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(header, body, practiceGroupReviews.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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|