|
@@ -139,6 +139,9 @@ public class ExportController extends BaseController {
|
|
|
private MusicGroupService musicGroupService;
|
|
|
@Autowired
|
|
|
private SysTenantConfigService sysTenantConfigService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StudentVisitService studentVisitService;
|
|
|
|
|
|
@Autowired
|
|
|
private ImLiveBroadcastRoomMemberService imLiveBroadcastRoomMemberService;
|
|
@@ -2968,4 +2971,81 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "学生课表考勤导出")
|
|
|
+ @PostMapping("export/studentCourseAttendance")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/studentCourseAttendance')")
|
|
|
+ public void exportStudentCourseAttendance(HttpServletResponse response, StudentAttendanceQueryInfo queryInfo) throws IOException {
|
|
|
+ queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
|
|
|
+ //按考勤状态和回访状态排序
|
|
|
+ queryInfo.setOrderFlag(true);
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+ List<StudentAttendance> rows = studentAttendanceService.findStudentAttendance(queryInfo).getRows();
|
|
|
+ if (rows.size() < 1) {
|
|
|
+ throw new BizException("没有可导出数据");
|
|
|
+ }
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ try {
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "学员姓名", "学员编号", "老师姓名", "老师编号",
|
|
|
+ "课程组编号", "课程编号", "课程名称", "课程组类型", "课程类型", "上课时间","签到时间", "签退时间", "考勤状态"}, new String[]{
|
|
|
+ "courseSchedule.organization.name", "username", "userId", "courseSchedule.teacherName", "teacherId", "musicGroupId", "courseScheduleId",
|
|
|
+ "courseSchedule.name", "groupType.desc", "courseSchedule.type.msg", "courseSchedule.classDate", "signInTime",
|
|
|
+ "signOutTime", "status.msg"}, rows);
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attac:wq" +
|
|
|
+ "hment;filename=courseAttendance-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
+
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "学生回访记录导出")
|
|
|
+ @PostMapping("export/studentVisitRecord")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/studentVisitRecord')")
|
|
|
+ public void exportStudentVisitRecord(HttpServletResponse response, StudentVisitQueryInfo queryInfo) throws IOException {
|
|
|
+ queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+ List<StudentVisitDto> rows = studentVisitService.getPageList(queryInfo).getRows();
|
|
|
+ if (rows.size() < 1) {
|
|
|
+ throw new BizException("没有可导出数据");
|
|
|
+ }
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ try {
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"老师姓名", "所属分部",
|
|
|
+ "角色", "学生编号", "学生姓名", "回访类型", "回访目的", "问题状态","回访图片", "回访时间"}, new String[]{
|
|
|
+ "teacherName", "organName", "visiterType.msg", "studentId", "studentName", "type", "purpose","probStatus == 1 ? '已解决' : '未解决'",
|
|
|
+ "attachments", "visitTime"}, rows);
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attac:wq" +
|
|
|
+ "hment;filename=visitRecord-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
+
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|