|
@@ -6,10 +6,10 @@ import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.RegistrationOrPreQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.page.*;
|
|
|
import com.ym.mec.biz.service.EmployeeService;
|
|
|
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -41,8 +41,6 @@ import com.ym.mec.biz.dal.dao.MusicGroupDao;
|
|
|
import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
|
|
|
import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
|
|
|
import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.page.StudentPreRegistrationQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
|
|
|
import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
|
|
|
import com.ym.mec.biz.service.StudentPreRegistrationService;
|
|
|
import com.ym.mec.biz.service.StudentRegistrationService;
|
|
@@ -273,7 +271,7 @@ public class StudentRegistrationController extends BaseController {
|
|
|
PageInfo<StudentPreRegistrationDto> studentPreRegistration = studentPreRegistrationService.queryListForPage(queryInfo);
|
|
|
if (studentPreRegistration.getTotal() <= 0) {
|
|
|
response.setStatus(200);
|
|
|
- response.setContentType("Content-Type: application/json;charset=UTF-8");
|
|
|
+ response.setContentType("Content-Type:application/json;charset=UTF-8");
|
|
|
response.getOutputStream().write("{\"data\": null, \"code\": 500, \"status\": false, \"msg\": \"没有可导出的记录\"}".getBytes());
|
|
|
response.flushBuffer();
|
|
|
return;
|
|
@@ -369,7 +367,7 @@ public class StudentRegistrationController extends BaseController {
|
|
|
@ApiOperation(value = "获取报名/预报名列表导出")
|
|
|
@GetMapping("/registerOrPreListExport")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentRegistration/registerOrPreListExport')")
|
|
|
- public void registerOrPreListExport(RegistrationOrPreQueryInfo queryInfo) {
|
|
|
+ public void registerOrPreListExport(RegistrationOrPreQueryInfo queryInfo, HttpServletResponse response) throws Exception {
|
|
|
if (StringUtils.isNotBlank(queryInfo.getSearch())) {
|
|
|
List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
|
|
|
List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
|
|
@@ -377,8 +375,45 @@ public class StudentRegistrationController extends BaseController {
|
|
|
queryInfo.setUserIds(userIds);
|
|
|
}
|
|
|
}
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+
|
|
|
+ PageInfo<RegisterDto> registerOrPreList = studentRegistrationService.getRegisterOrPreList(queryInfo);
|
|
|
+ if (registerOrPreList.getTotal() <= 0) {
|
|
|
+ throw new BizException("没有可导出的记录");
|
|
|
+ }
|
|
|
+ for (RegisterDto row : registerOrPreList.getRows()) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ HSSFWorkbook workbook = null;
|
|
|
+ try {
|
|
|
+ String[] header = {"学员编号","学员姓名", "声部", "预报名时间","预报名时间差", "缴费时间", "缴费时间差"};
|
|
|
+ String[] body = {"userId","studentName", "actualSubjectName", "perRegisterTime","perRegInterval","payTime", "payInterval"};
|
|
|
+ workbook = POIUtil.exportExcel(header, body, registerOrPreList.getRows());
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=registerOrPer-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
+ response.flushBuffer();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
+ workbook.close();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ workbook.close();
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@ApiOperation(value = "设置不需要云教练")
|
|
|
@GetMapping("/setNoneCloudTeacher")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentRegistration/setNoneCloudTeacher')")
|