|
@@ -62,6 +62,8 @@ public class ExportController extends BaseController {
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
@Autowired
|
|
|
+ private EmployeeService employeeService;
|
|
|
+ @Autowired
|
|
|
private EmployeeDao employeeDao;
|
|
|
@Autowired
|
|
|
private StudentPaymentOrderService studentPaymentOrderService;
|
|
@@ -135,6 +137,8 @@ public class ExportController extends BaseController {
|
|
|
private ManagerDownloadDao managerDownloadDao;
|
|
|
@Autowired
|
|
|
private IdGeneratorService idGeneratorService;
|
|
|
+ @Autowired
|
|
|
+ private MusicGroupQuitService musicGroupQuitService;
|
|
|
|
|
|
@ApiOperation(value = "班级列表导出")
|
|
|
@PostMapping("export/classGroup")
|
|
@@ -2376,4 +2380,168 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "欠费学员列表导出")
|
|
|
+ @RequestMapping("export/arrearageStudents")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/arrearageStudents')")
|
|
|
+ public void arrearageStudents(ArrearageStudentsQueryInfo queryInfo, HttpServletResponse response) throws IOException {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ Employee employee = employeeService.get(sysUser.getId());
|
|
|
+ if (StringUtils.isBlank(queryInfo.getOrganIds())) {
|
|
|
+ queryInfo.setOrganIds(employee.getOrganIdList());
|
|
|
+ }else if(StringUtils.isEmpty(employee.getOrganIdList())){
|
|
|
+ throw new BizException("用户所在分部异常");
|
|
|
+ }else {
|
|
|
+ List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
+ if(!list.containsAll(Arrays.asList(queryInfo.getOrganIds().split(",")))){
|
|
|
+ throw new BizException("非法请求");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+ PageInfo<MusicArrearageStudentDto> result = musicGroupPaymentCalenderDetailService.queryArrearageStudents(queryInfo);
|
|
|
+ if (CollectionUtils.isEmpty(result.getRows())) {
|
|
|
+ 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 = {"userId", "studentName", "organName", "cooperationName", "musicGroupName", "eduTeacherName", "subjectName", "gender==0?'女':'男'", "parentName", "phone", "noPaymentAmount"};
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(header, body, result.getRows());
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=teacherDefaultSalary-" + 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/musicGroupQuit")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/musicGroupQuit')")
|
|
|
+ public void musicGroupQuit(MusicGroupQuitQueryInfo queryInfo, HttpServletResponse response) throws IOException {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ Employee employee = employeeService.get(sysUser.getId());
|
|
|
+ if (StringUtils.isBlank(queryInfo.getOrganId())) {
|
|
|
+ queryInfo.setOrganId(employee.getOrganIdList());
|
|
|
+ }else if(StringUtils.isEmpty(employee.getOrganIdList())){
|
|
|
+ throw new BizException("用户所在分部异常");
|
|
|
+ }else {
|
|
|
+ List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
+ if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
|
|
|
+ throw new BizException("非法请求");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+ PageInfo<MusicGroupQuit> result = musicGroupQuitService.queryPage(queryInfo);
|
|
|
+ if (CollectionUtils.isEmpty(result.getRows())) {
|
|
|
+ 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 = {"userId", "user.username", "musicGroup.name", "createTime", "userComment", "status.getMsg()"};
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(header, body, result.getRows());
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=teacherDefaultSalary-" + 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/teacherServeInfo")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/teacherServeInfo')")
|
|
|
+ public void teacherServeInfo(TeacherServeQueryInfo queryInfo, HttpServletResponse response) throws IOException {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ Employee employee = employeeService.get(sysUser.getId());
|
|
|
+ if (StringUtils.isBlank(queryInfo.getOrganId())) {
|
|
|
+ queryInfo.setOrganId(employee.getOrganIdList());
|
|
|
+ }else if(StringUtils.isEmpty(employee.getOrganIdList())){
|
|
|
+ throw new BizException("用户所在分部异常");
|
|
|
+ }else {
|
|
|
+ List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
+ if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
|
|
|
+ throw new BizException("非法请求");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+ PageInfo<TeacherServeDto> result = studentExtracurricularExercisesSituationService.queryTeacherServeInfo(queryInfo);
|
|
|
+ if (CollectionUtils.isEmpty(result.getRows())) {
|
|
|
+ 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();
|
|
|
+
|
|
|
+ for (TeacherServeDto row : result.getRows()) {
|
|
|
+ row.setDateRange(com.ym.mec.util.date.DateUtil.dateToString(row.getMonday(), "yyyy-MM-dd") + '~' + com.ym.mec.util.date.DateUtil.dateToString(row.getSunday(), "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ String[] header = {"分部", "老师编号", "老师姓名", "服务周期", "课后作业(节)", "课外作业(人)", "是否异常", "提醒时间", "操作人"};
|
|
|
+ String[] body = {"organName", "teacherId", "teacherName", "dateRange", "homeworkNum", "exerciseNum", "unDone==0?'否':'是'", "remindDate", "operatorName"};
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(header, body, result.getRows());
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=teacherDefaultSalary-" + 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|