|
@@ -2,18 +2,19 @@ package com.ym.mec.web.controller;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.biz.dal.dao.*;
|
|
|
+import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
|
|
|
+import com.ym.mec.biz.dal.dao.VipGroupDao;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
-import com.ym.mec.biz.dal.enums.KitPurchaseMethodEnum;
|
|
|
import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
|
|
|
import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
-import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
@@ -26,13 +27,16 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.*;
|
|
|
-import java.util.stream.Collectors;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@RequestMapping
|
|
|
@Api(tags = "数据导出服务")
|
|
@@ -54,12 +58,8 @@ public class ExportController extends BaseController {
|
|
|
@Autowired
|
|
|
private StudentPaymentOrderService studentPaymentOrderService;
|
|
|
@Autowired
|
|
|
- private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
|
|
|
- @Autowired
|
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
|
@Autowired
|
|
|
- private SporadicChargeInfoDao sporadicChargeInfoDao;
|
|
|
- @Autowired
|
|
|
private VipGroupDao vipGroupDao;
|
|
|
|
|
|
@ApiOperation(value = "导出学员是否有课")
|
|
@@ -265,4 +265,57 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation(value = "乐团管理--乐团详情-导出学员列表")
|
|
|
+ @RequestMapping("export/musicGroupStudent")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/musicGroupStudent')")
|
|
|
+ public void queryMusicGroupStudent(MusicGroupStudentQueryInfo queryInfo, HttpServletResponse response) {
|
|
|
+ queryInfo.setRows(99999);
|
|
|
+ PageInfo<MusicGroupStudentsDto> musicGroupStudentsDtoPageInfo = studentManageService.queryMusicGroupStudent(queryInfo);
|
|
|
+ try {
|
|
|
+ for (MusicGroupStudentsDto row : musicGroupStudentsDtoPageInfo.getRows()) {
|
|
|
+ if (row.getGender().equals("1")) {
|
|
|
+ row.setGender("男");
|
|
|
+ } else {
|
|
|
+ row.setGender("女");
|
|
|
+ }
|
|
|
+ if (row.getPaymentStatus().equals("PAID_COMPLETED")) {
|
|
|
+ row.setPaymentStatus("完成缴费");
|
|
|
+ } else if (row.getPaymentStatus().equals("NON_PAYMENT")) {
|
|
|
+ row.setPaymentStatus("未缴费");
|
|
|
+ } else if (row.getPaymentStatus().equals("PROCESSING")) {
|
|
|
+ row.setPaymentStatus("缴费中");
|
|
|
+ }
|
|
|
+ if(row.getStudentStatus().equals("NORMAL")){
|
|
|
+ row.setStudentStatus("在读");
|
|
|
+ }else {
|
|
|
+ row.setStudentStatus("退团");
|
|
|
+ }
|
|
|
+ if (row.getIsActive()) {
|
|
|
+ row.setActiveName("是");
|
|
|
+ } else {
|
|
|
+ row.setActiveName("否");
|
|
|
+ }
|
|
|
+ if(row.getIsNewStudent().equals(1)){
|
|
|
+ row.setIsNewStudentStr("是");
|
|
|
+ }else {
|
|
|
+ row.setIsNewStudentStr("否");
|
|
|
+ }
|
|
|
+ row.setCurrentGrade(row.getCurrentGrade() + row.getCurrentClass());
|
|
|
+ }
|
|
|
+ String[] header = {"学生姓名", "性别", "联系电话", "年级班级", "专业", "学员状态", "新增学员", "缴费金额",
|
|
|
+ "下次缴费日期", "报名缴费", "是否激活"};
|
|
|
+ String[] body = {"realName", "gender", "phone", "currentGrade", "subjectName", "studentStatus", "isNewStudentStr",
|
|
|
+ "courseFee", "nextPaymentDate","paymentStatus", "activeName"};
|
|
|
+ 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");
|
|
|
+ response.flushBuffer();
|
|
|
+ workbook.write(response.getOutputStream());
|
|
|
+ workbook.close();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|