|  | @@ -3,7 +3,6 @@ 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.EmployeeDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.StudentManageListDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.UpdateStudentFeeDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.Employee;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.*;
 | 
	
	
		
			
				|  | @@ -14,24 +13,24 @@ import com.ym.mec.biz.service.StudentRegistrationService;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.controller.BaseController;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.exception.BizException;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.page.QueryInfo;
 | 
	
		
			
				|  |  | -import com.ym.mec.util.date.DateUtil;
 | 
	
		
			
				|  |  | -import com.ym.mec.util.excel.POIUtil;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.*;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  | -import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 | 
	
		
			
				|  |  |  import org.slf4j.Logger;
 | 
	
		
			
				|  |  |  import org.slf4j.LoggerFactory;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.security.access.prepost.PreAuthorize;
 | 
	
		
			
				|  |  | -import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.GetMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.PostMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -import javax.servlet.http.HttpServletResponse;
 | 
	
		
			
				|  |  |  import java.util.Arrays;
 | 
	
		
			
				|  |  |  import java.util.Date;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  @Api(tags = "学生管理")
 | 
	
		
			
				|  |  |  @RestController
 | 
	
		
			
				|  |  | +@RequestMapping("studentManage")
 | 
	
		
			
				|  |  |  public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
	
		
			
				|  | @@ -48,50 +47,8 @@ public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |      private EmployeeDao employeeDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
 | 
	
		
			
				|  |  | -    @ApiOperation(value = "导出学员是否有课")
 | 
	
		
			
				|  |  | -    @PostMapping("export/studentHasCourse")
 | 
	
		
			
				|  |  | -    @PreAuthorize("@pcs.hasPermissions('export/studentHasCourse')")
 | 
	
		
			
				|  |  | -    public void studentHasCourse(HttpServletResponse response, StudentManageQueryInfo queryInfo) {
 | 
	
		
			
				|  |  | -        queryInfo.setRows(99999);
 | 
	
		
			
				|  |  | -        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | -        if (sysUser == null) {
 | 
	
		
			
				|  |  | -            throw new BizException("用户信息获取失败");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if(!sysUser.getIsSuperAdmin()){
 | 
	
		
			
				|  |  | -            Employee employee = employeeDao.get(sysUser.getId());
 | 
	
		
			
				|  |  | -            if (StringUtils.isEmpty(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.setIsExport(true);
 | 
	
		
			
				|  |  | -//        List<StudentManageListDto> rows = studentManageService.queryHasCourseStudent(queryInfo);
 | 
	
		
			
				|  |  | -        List<StudentManageListDto> rows = studentManageService.findStudentsByOrganId(queryInfo).getRows();
 | 
	
		
			
				|  |  | -        try {
 | 
	
		
			
				|  |  | -            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "学员编号", "学员姓名", "性别", "家长姓名",
 | 
	
		
			
				|  |  | -                    "家长联系电话", "是否激活", "是否有课", "是否预约陪练课","是否有陪练课", "课程余额(元)",
 | 
	
		
			
				|  |  | -                    "所在乐团", "乐团所属声部", "所在乐团状态", "所在vip课", "所在VIP状态"}, new String[]{
 | 
	
		
			
				|  |  | -                    "organName", "userId", "username", "gender.description", "parentsName", "parentsPhone",
 | 
	
		
			
				|  |  | -                    "isActive.msg","hasCourse.msg","isMake.msg","hasPracticeCourse.msg","courseBalance","musicGroupName",
 | 
	
		
			
				|  |  | -                    "subjectName","musicGroupStatus","vipGroupName","vipGroupStatus"}, rows);
 | 
	
		
			
				|  |  | -            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();
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      @ApiOperation(value = "获取学生列表")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/queryStudentList")
 | 
	
		
			
				|  |  | +    @GetMapping("/queryStudentList")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentList')")
 | 
	
		
			
				|  |  |      public Object queryStudentList(StudentManageQueryInfo queryInfo){
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
	
		
			
				|  | @@ -116,14 +73,14 @@ public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "学员注册")
 | 
	
		
			
				|  |  | -    @PostMapping("studentManage/register")
 | 
	
		
			
				|  |  | +    @PostMapping("/register")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/register')")
 | 
	
		
			
				|  |  |      public Object studentRegister(SysUser sysUser){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.studentRegister(sysUser));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "修改学员信息")
 | 
	
		
			
				|  |  | -    @PostMapping("studentManage/studentUpdate")
 | 
	
		
			
				|  |  | +    @PostMapping("/studentUpdate")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/studentUpdate')")
 | 
	
		
			
				|  |  |      public Object studentUpdate(Integer id, String phone, String username, Integer gender, String realName, Date birthdate,String nation){
 | 
	
		
			
				|  |  |          SysUser sysUser = new SysUser();
 | 
	
	
		
			
				|  | @@ -138,14 +95,14 @@ public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "乐团管理--乐团详情--获取学员列表")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/queryMusicGroupStudent")
 | 
	
		
			
				|  |  | +    @GetMapping("/queryMusicGroupStudent")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/queryMusicGroupStudent')")
 | 
	
		
			
				|  |  |      public Object queryMusicGroupStudent(MusicGroupStudentQueryInfo queryInfo){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.queryMusicGroupStudent(queryInfo));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "乐团管理--乐团详情--学员列表--查看班级")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/queryStudentClassGroup")
 | 
	
		
			
				|  |  | +    @GetMapping("/queryStudentClassGroup")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentClassGroup')")
 | 
	
		
			
				|  |  |      @ApiImplicitParams({@ApiImplicitParam(name = "teacherId", value = "学生编号", required = true, dataType = "Integer"),
 | 
	
		
			
				|  |  |              @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
 | 
	
	
		
			
				|  | @@ -157,70 +114,70 @@ public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "乐团管理--乐团详情--学员列表,汇总数据接口")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/musicGroupStudentsSum")
 | 
	
		
			
				|  |  | +    @GetMapping("/musicGroupStudentsSum")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/musicGroupStudentsSum')")
 | 
	
		
			
				|  |  |      public Object musicGroupStudentsSum(String musicGroupId){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.musicGroupStudentsSum(musicGroupId));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "乐团管理--乐团详情--点名总览")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/queryMusicGroupStudentsSign")
 | 
	
		
			
				|  |  | +    @GetMapping("/queryMusicGroupStudentsSign")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/queryMusicGroupStudentsSign')")
 | 
	
		
			
				|  |  |      public Object queryMusicGroupStudentsSign(StudentSignQueryInfo queryInfo){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.queryMusicGroupStudentsSign(queryInfo));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "根据学生ID获取学生基本报名信息")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/findStudentBaseInfo")
 | 
	
		
			
				|  |  | +    @GetMapping("/findStudentBaseInfo")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/findStudentBaseInfo')")
 | 
	
		
			
				|  |  |      public Object findStudentBaseInfo(@ApiParam(value = "学生编号", required = true) Integer userId){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.findStudentManageBaseInfo(userId));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "根据学生ID获取其所在的乐团")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/findStudentMusicGroups")
 | 
	
		
			
				|  |  | +    @GetMapping("/findStudentMusicGroups")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/findStudentMusicGroups')")
 | 
	
		
			
				|  |  |      public Object findStudentMusicGroups(@ApiParam(value = "学生编号", required = true) Integer userId){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.findStudentMusicGroupsByUserId(userId));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "根据乐团获取排课列表")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/findStudentCourses")
 | 
	
		
			
				|  |  | +    @GetMapping("/findStudentCourses")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/findStudentCourses')")
 | 
	
		
			
				|  |  |      public Object findStudentCourses(StudentManageCourseQueryInfo queryInfo){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.findStudentCourseList(queryInfo));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "获取学生签到列表")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/findStudentAttendances")
 | 
	
		
			
				|  |  | +    @GetMapping("/findStudentAttendances")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/findStudentAttendances')")
 | 
	
		
			
				|  |  |      public Object findStudentAttendances(StudentManageAttendanceQueryInfo queryInfo){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.findStudentAttendances(queryInfo));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "获取学生vip课程")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/findStudentVipGroups")
 | 
	
		
			
				|  |  | +    @GetMapping("/findStudentVipGroups")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/findStudentVipGroups')")
 | 
	
		
			
				|  |  |      public Object findStudentVipGroups(StudentManageCourseQueryInfo queryInfo){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.findStudentVipGroups(queryInfo));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "获取学生vip班级列表")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/findStudentVipGroupClass")
 | 
	
		
			
				|  |  | +    @GetMapping("/findStudentVipGroupClass")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/findStudentVipGroupClass')")
 | 
	
		
			
				|  |  |      public Object findStudentVipGroupClass(StudentManageVipClassQueryInfo queryInfo){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.findStudentVipGroupClass(queryInfo));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "获取用户默认账户基本信息")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/getUserCashAccountBaseInfo")
 | 
	
		
			
				|  |  | +    @GetMapping("/getUserCashAccountBaseInfo")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/getUserCashAccountBaseInfo')")
 | 
	
		
			
				|  |  |      public Object getUserCashAccountBaseInfo(Integer userId){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.getStudentAccountBaseInfo(userId));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "获取学员扣费记录列表")
 | 
	
		
			
				|  |  | -    @GetMapping("studentManage/queryStudentPayment")
 | 
	
		
			
				|  |  | +    @GetMapping("/queryStudentPayment")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentPayment')")
 | 
	
		
			
				|  |  |      public Object queryStudentPayment(TeacherPaymentRecordInfo queryInfo){
 | 
	
		
			
				|  |  |          return succeed(studentManageService.queryStudentPayment(queryInfo));
 | 
	
	
		
			
				|  | @@ -231,7 +188,7 @@ public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |       * @param mobile
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -    @GetMapping(value = "studentManage/queryUserByPhone")
 | 
	
		
			
				|  |  | +    @GetMapping(value = "/queryUserByPhone")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/queryUserByPhone')")
 | 
	
		
			
				|  |  |      public Object queryUserByPhone(String mobile) {
 | 
	
		
			
				|  |  |          return succeed(studentRegistrationService.queryUserByPhone(mobile));
 | 
	
	
		
			
				|  | @@ -241,7 +198,7 @@ public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |       * 修改学员缴费金额和缴费周期
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -    @PostMapping(value = "studentManage/updateStudentFee")
 | 
	
		
			
				|  |  | +    @PostMapping(value = "/updateStudentFee")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/updateStudentFee')")
 | 
	
		
			
				|  |  |      public Object updateStudentFee(UpdateStudentFeeDto studentFeeDto) {
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
	
		
			
				|  | @@ -257,7 +214,7 @@ public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |       * 修改学员缴费周期锁定状态
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -    @PostMapping(value = "studentManage/updateStudentFeeIsLock")
 | 
	
		
			
				|  |  | +    @PostMapping(value = "/updateStudentFeeIsLock")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/updateStudentFeeIsLock')")
 | 
	
		
			
				|  |  |      public Object updateStudentFeeIsLock(UpdateStudentFeeDto studentFeeDto) {
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
	
		
			
				|  | @@ -273,7 +230,7 @@ public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |       * 获取学员缴费日历信息
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -    @GetMapping(value = "studentManage/findMusicGroupStudentFee")
 | 
	
		
			
				|  |  | +    @GetMapping(value = "/findMusicGroupStudentFee")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/findMusicGroupStudentFee')")
 | 
	
		
			
				|  |  |      public Object findMusicGroupStudentFee(Integer studentId,String musicGroupId) {
 | 
	
		
			
				|  |  |          if(studentId == null || StringUtils.isEmpty(musicGroupId)){
 | 
	
	
		
			
				|  | @@ -290,7 +247,7 @@ public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |       * 获取课程学员作业列表
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -    @GetMapping(value = "studentManage/findStudentCourseHomeworks")
 | 
	
		
			
				|  |  | +    @GetMapping(value = "/findStudentCourseHomeworks")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/findStudentCourseHomeworks')")
 | 
	
		
			
				|  |  |      public Object findStudentCourseHomeworks(QueryInfo queryInfo) {
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
	
		
			
				|  | @@ -304,7 +261,7 @@ public class StudentManageController extends BaseController {
 | 
	
		
			
				|  |  |       * 获取课程学员作业列表
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -    @GetMapping(value = "studentManage/sumStudentAttendance")
 | 
	
		
			
				|  |  | +    @GetMapping(value = "/sumStudentAttendance")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('studentManage/sumStudentAttendance')")
 | 
	
		
			
				|  |  |      public Object sumStudentAttendance(Integer courseScheduleId) {
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserFeignService.queryUserInfo();
 |