|
@@ -137,6 +137,8 @@ public class ExportController extends BaseController {
|
|
|
private IndexErrDataRecordService indexErrDataRecordService;
|
|
|
@Autowired
|
|
|
private EmployeeInfoService employeeInfoService;
|
|
|
+ @Autowired
|
|
|
+ private StudentService studentService;
|
|
|
|
|
|
@ApiOperation(value = "21年暑期考级活动统计页面详情导出")
|
|
|
@PostMapping("export/statisticsDetail")
|
|
@@ -1533,7 +1535,7 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String[] header = {"分部", "上课日期", "学生编号", "课程编号", "学员是否到课", "课程班名称", "老师", "教材内容", "发音", "节奏", "乐理", "曲目", "评价备注", "回访日期(布置作业)", "完成app双向沟通", "学员评分", "是否布置作业", "是否提交作业", "是否回复作业", "教务老师", "教务评价"};
|
|
|
+ String[] header = {"分部", "上课日期", "学生编号", "课程编号", "学员是否到课", "课程班名称", "老师", "教材内容", "发音", "节奏", "乐理", "曲目", "评价备注", "回访日期(布置训练)", "完成app双向沟通", "学员评分", "是否布置训练", "是否提交训练", "是否回复训练", "教务老师", "教务评价"};
|
|
|
String[] body = {"organName", "classDateStr", "studentId", "id", "attendanceStr", "courseName", "teacherName", "teachingMaterial", "pronunciationStr", "tempoStr", "musicTheoryStr", "song", "memo", "createTimeStr", "hasLiaison", "studentReview", "assignHomeworkStr", "handHomeworkStr", "homeWorkReplied", "eduTeacherName", "courseReview"};
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(header, body, practiceGroupReviews.getRows());
|
|
|
response.setContentType("application/octet-stream");
|
|
@@ -1745,7 +1747,7 @@ public class ExportController extends BaseController {
|
|
|
OutputStream ouputStream = null;
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(
|
|
|
- new String[]{"布置时间", "截至时间", "训练标题", "老师名字", "分部", "学生姓名", "学生编号", "提交作业", "提交作业时间", "是否评价", "是否有vip", "及时评价"},
|
|
|
+ new String[]{"布置时间", "截至时间", "训练标题", "老师名字", "分部", "学生姓名", "学生编号", "提交训练", "提交训练时间", "是否评价", "是否有vip", "及时评价"},
|
|
|
new String[]{"createTime", "expireDate", "title", "teacherName", "organName", "user.username", "userId", "statusStr", "submitTime", "isRepliedStr", "existVipCourseStr", "isRepliedTimelyStr"}, rows);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
@@ -1797,7 +1799,7 @@ public class ExportController extends BaseController {
|
|
|
OutputStream ouputStream = null;
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(
|
|
|
- new String[]{"学员编号", "学员姓名", "所属分部", "乐团名称", "指导老师", "教务老师", "服务课程", "预期安排", "实际安排", "提交次数", "评价次数", "及时评价次数", "付费网管课", "VIP课", "作业提交时间"},
|
|
|
+ new String[]{"学员编号", "学员姓名", "所属分部", "乐团名称", "指导老师", "教务老师", "服务课程", "预期安排", "实际安排", "提交次数", "评价次数", "及时评价次数", "付费网管课", "VIP课", "训练提交时间"},
|
|
|
new String[]{"studentId", "studentName", "organName", "groupNames", "teacherName", "educationalTeacherName", "serveType == 'EXERCISE' ? '课外训练':courseIds", "expectExercisesNum", "actualExercisesNum", "exercisesReplyNum",
|
|
|
"exercisesMessageNum", "exercisesMessageTimelyNum", "existPracticeCourse", "existVipCourse", "lastSubmitTime"}, rows);
|
|
|
response.setContentType("application/octet-stream");
|
|
@@ -2042,7 +2044,7 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String[] header = {"分部", "上课日期", "课程编号", "课程班名称", "老师", "教材内容", "发音", "节奏", "乐理", "曲目", "评价备注", "回访日期(布置作业)", "是否布置作业", "是否提交作业", "教务老师", "教务评价"};
|
|
|
+ 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");
|
|
@@ -2810,8 +2812,8 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- String[] header = {"分部", "老师编号", "老师姓名", "服务周期", "课后作业(节)", "课外作业(人)",
|
|
|
- "作业布置", "作业点评", "作业提交率",
|
|
|
+ String[] header = {"分部", "老师编号", "老师姓名", "服务周期", "课后训练(节)", "课外训练(人)",
|
|
|
+ "训练布置", "训练点评", "训练提交率",
|
|
|
"提醒时间", "操作人"};
|
|
|
String[] body = {"organName", "teacherId", "teacherName", "dateRange", "homeworkNum", "exerciseNum",
|
|
|
"expectExercisesNum>actualExercisesNum?'异常':'正常'", "exercisesReplyNum>exercisesMessageNum?'异常':'正常'", "submitRate",
|
|
@@ -3104,4 +3106,198 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "分部下教师关联的会员数据导出")
|
|
|
+ @RequestMapping("export/organTeacherMemberStudentData")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/organTeacherMemberStudentData')")
|
|
|
+ public void exportEmployeeInfo(TeacherServeQueryInfo queryInfo,HttpServletResponse response) throws IOException {
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+ List<TeacherStudentDataDto> rows = teacherService.queryMemberStudentData(queryInfo).getRows();
|
|
|
+ if (CollectionUtils.isEmpty(rows)) {
|
|
|
+ response.setStatus(200);
|
|
|
+ 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 {
|
|
|
+ String[] header = {"老师编号", "老师姓名", "学员总数", "使用人数", "使用人数比", "付费学员数量", "会员占比"};
|
|
|
+ String[] body = {"teacherId", "teacherName", "totalStudentNum", "cloudStudyUseStudentNum", "cloudStudyUseStudentDuty+\"%\"",
|
|
|
+ "vipStudentNum", "vipStudentDuty+\"%\""};
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=employeeInfo-" + 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "分部云教练学员数据预览导出")
|
|
|
+ @RequestMapping("export/organStudentOverView")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/organStudentOverView')")
|
|
|
+ public void organStudentOverView(OrganCloudStudyStudentDataQueryInfo queryInfo,HttpServletResponse response) throws IOException {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ Employee employee = employeeDao.get(sysUser.getId());
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+
|
|
|
+ List<Integer> organIds = new ArrayList<>();
|
|
|
+ if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
|
|
|
+ organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
+ }else if(StringUtils.isNotBlank(employee.getOrganIdList())){
|
|
|
+ organIds = Arrays.stream(employee.getOrganIdList().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ List<Integer> ids = organIds.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<EduOrganStudentDataDto> rows = studentService.queryOrganStudentOverView(ids, queryInfo).getRows();
|
|
|
+ if (CollectionUtils.isEmpty(rows)) {
|
|
|
+ response.setStatus(200);
|
|
|
+ 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 {
|
|
|
+ String[] header = {"分部", "学员总数", "活跃人数", "使用人数", "新增使用人数", "使用比例", "付费会员数", "付费会员占比"};
|
|
|
+ String[] body = {"organName", "totalStudentNum", "cloudStudyLivelyStudentNum", "cloudStudyUseStudentNum", "newCloudStudyStudentNum",
|
|
|
+ "cloudStudyUseStudentDuty+\"%\"", "vipStudentNum", "vipStudentDuty+\"%\""};
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=employeeInfo-" + 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "分部云教练学员数据预览导出")
|
|
|
+ @RequestMapping("export/cloudStudyStudentOverView")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/cloudStudyStudentOverView')")
|
|
|
+ public void cloudStudyStudentOverView(OrganCloudStudyStudentDataQueryInfo queryInfo,HttpServletResponse response) throws IOException {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ Employee employee = employeeDao.get(sysUser.getId());
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+
|
|
|
+ List<Integer> organIds = new ArrayList<>();
|
|
|
+ if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
|
|
|
+ organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
+ }else if(StringUtils.isNotBlank(employee.getOrganIdList())){
|
|
|
+ organIds = Arrays.stream(employee.getOrganIdList().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ List<Integer> ids = organIds.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<EduOrganStudentDataDto> rows = indexService.organStudentOverView(ids, queryInfo).getRows();
|
|
|
+ if (CollectionUtils.isEmpty(rows)) {
|
|
|
+ response.setStatus(200);
|
|
|
+ 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 {
|
|
|
+ String[] header = {"排名", "分部", "学员总数", "活跃人数", "活跃人数比", "当日使用人数", "当日新增使用人数", "使用人数占比", "付费会员数量","付费会员占比", "新增付费会员"};
|
|
|
+ String[] body = {"index", "organName", "totalStudentNum", "cloudStudyLivelyStudentNum", "cloudStudyLivelyStudentDuty+\"%\"",
|
|
|
+ "cloudStudyUseStudentNum", "newCloudStudyStudentNum", "cloudStudyUseStudentDuty+\"%\"", "vipStudentNum", "vipStudentDuty+\"%\"", "newCloudStudyStudentNum"};
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=employeeInfo-" + 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "分部云教练学员训练数据导出")
|
|
|
+ @RequestMapping("export/cloudStudyStudentTrainData")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/cloudStudyStudentTrainData')")
|
|
|
+ public void cloudStudyStudentTrainData(StudentQueryInfo queryInfo,HttpServletResponse response) throws IOException {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+
|
|
|
+ List<EduOrganStudentListDto> rows = ((PageInfo<EduOrganStudentListDto>)studentService.organStudentData(queryInfo).getDetail()).getRows();
|
|
|
+ if (CollectionUtils.isEmpty(rows)) {
|
|
|
+ response.setStatus(200);
|
|
|
+ response.setContentType("Content-Type: application/json;charset=UTF-8");
|
|
|
+ response.getOutputStream().write("{\"data\": null, \"code\": 500, \"status\": false, \"msg\": \"没有可导出的记录\"}".getBytes());
|
|
|
+ response.flushBuffer();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (EduOrganStudentListDto row : rows) {
|
|
|
+ row.setCloudStudyUseTime(Math.round(row.getCloudStudyUseTime()));
|
|
|
+ row.setCloudStudyUseAvgTime(Math.round(row.getCloudStudyUseAvgTime()));
|
|
|
+ }
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ try {
|
|
|
+ String[] header = {"学员编号", "学员", "训练总时长", "连续训练天数", "乐团", "指导老师", "声部", "是否有小课", "训练次数", "训练天数", "训练平均时长", "会员有效期"};
|
|
|
+ String[] body = {"studentId", "studentName", "cloudStudyUseTime+\"分钟\"", "cloudStudyRunningDays+\"天\"", "musicGroupNames",
|
|
|
+ "teacherName", "subjectName", "hasVipGroup>0?\"是\":\"否\"", "cloudStudyUseNum+\"次\"", "cloudStudyUseDays+\"天\"",
|
|
|
+ "cloudStudyUseAvgTime+\"分钟\"", "membershipEndTime"};
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=employeeInfo-" + 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|