|
@@ -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")
|
|
@@ -970,10 +972,12 @@ public class ExportController extends BaseController {
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "学员编号", "学员姓名", "性别", "家长姓名",
|
|
|
"家长联系电话", "是否激活", "是否有课", "是否有网管课","网管课剩余课时","VIP课剩余课时", "课程余额(元)", "账户余额(元)",
|
|
|
- "所在乐团", "乐团所属声部", "所在乐团状态", "所在vip课", "所在VIP状态", "服务标签", "运营标签", "指导老师", "是否签订协议"}, new String[]{
|
|
|
+ "所在乐团", "乐团所属声部", "所在乐团状态", "所在vip课", "所在VIP状态", "服务标签", "运营标签", "指导老师", "是否签订协议", "是否使用云教练", "会员截止日期", "会员剩余天数", "会员试用结束日期", "会员试用剩余天数"}, new String[]{
|
|
|
"organName", "userId", "username", "gender.description", "parentsName", "parentsPhone",
|
|
|
"isActive.msg", "hasCourse.msg", "hasPracticeCourse.msg","noStartPracticeCourseNum","noStartVipCourseNum", "courseBalance", "balance", "musicGroupName",
|
|
|
- "subjectName", "musicGroupStatus", "vipGroupName", "vipGroupStatus", "serviceTag.msg", "operatingTag.msg", "teacherName", "isSignedContract ? '是' : '否'"}, rows);
|
|
|
+ "subjectName", "musicGroupStatus", "vipGroupName", "vipGroupStatus", "serviceTag.msg", "operatingTag.msg", "teacherName", "isSignedContract ? '是' : '否'", "recordUserId == null ? '否' : '是'",
|
|
|
+ "membershipEndTime","membershipEndTime == null ? hasNoStartCloudTeacher ? \"未生效\" : \"未购买\" : membershipDay >= 0 ? membershipDay : hasNoStartCloudTeacher ? \"未生效\" : \"会员已过期\"",
|
|
|
+ "experienceMembershipEndTime","membershipEndTime == null ? \"未试用\" : membershipDay >= 0 ? membershipDay : \"已失效\""}, rows);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
@@ -1431,19 +1435,23 @@ public class ExportController extends BaseController {
|
|
|
} else {
|
|
|
row.setActiveName("否");
|
|
|
}
|
|
|
- if (row.getIsNewStudent().equals(1)) {
|
|
|
- row.setIsNewStudentStr("是");
|
|
|
- } else {
|
|
|
- row.setIsNewStudentStr("否");
|
|
|
+ if (row.getMusicMembershipDay() != null && row.getMusicMembershipDay() < 0) {
|
|
|
+ row.setMusicMembershipDay1(Math.abs(row.getMusicMembershipDay()));
|
|
|
}
|
|
|
if (row.getNextPaymentDate() != null) {
|
|
|
row.setNextPaymentDateStr(DateUtil.format(row.getNextPaymentDate(), DateUtil.DEFAULT_PATTERN));
|
|
|
}
|
|
|
}
|
|
|
- String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级", "班级", "专业", "学员状态", "新增学员", "缴费金额",
|
|
|
- "下次缴费日期", "报名缴费状态", "是否激活", "是否有剩余VIP", "是否有剩余网管课", "欠费总额"};
|
|
|
- String[] body = {"userId", "realName", "gender", "phone", "currentGrade", "currentClass", "subjectName", "studentStatus", "isNewStudentStr",
|
|
|
- "courseFee", "nextPaymentDateStr", "paymentStatus.desc", "activeName", "hasVip ? '是' : '否'", "hasPractice ? '是' : '否'", "noPaymentAmount"};
|
|
|
+ String[] header = {"学员编号", "学员姓名", "性别", "联系电话","入团时间", "年级", "班级", "入团专业", "学员状态", "报名缴费", "缴费金额", "是否激活",
|
|
|
+ "VIP/网管是否有课","关心包","加油包", "欠费金额(元)", "退团原因",
|
|
|
+ "下次续费时间", "下次续费剩余天数", "会员截止时间", "会员剩余天数", "试用会员截止时间", "试用会员剩余天数"};
|
|
|
+ String[] body = {"userId", "realName", "gender", "phone","registerTime", "currentGrade", "currentClass", "subjectName", "studentStatus", "paymentStatus.desc"
|
|
|
+ ,"courseFee", "activeName", "hasCourse ? '是' : '否'"
|
|
|
+ ,"carePackage == null || carePackage == 0 ? \"不可用\" : carePackage == 1 ? \"可用\" : \"已使用\""
|
|
|
+ ,"comeOnPackage == null || comeOnPackage == 0 ? \"不可用\" : comeOnPackage == 1 ? \"可用\" : \"已使用\""
|
|
|
+ ,"noPaymentAmount == null ? 0 : noPaymentAmount", "quitReason", "musicMembershipEndTime", "musicMembershipEndTime == null ? '' : musicMembershipDay >= 0 ? musicMembershipDay : '已欠费' + musicMembershipDay1 + '天'",
|
|
|
+ "membershipEndTime","membershipEndTime == null ? hasNoStartCloudTeacher ? \"未生效\" : \"未购买\" : membershipDay >= 0 ? membershipDay : hasNoStartCloudTeacher ? \"未生效\" : \"会员已过期\"",
|
|
|
+ "experienceMembershipEndTime","membershipEndTime == null ? \"未试用\" : membershipDay >= 0 ? membershipDay : \"已失效\""};
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(header, body, musicGroupStudentsDtoPageInfo.getRows());
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
@@ -3098,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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|