|
@@ -3,6 +3,7 @@ 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.*;
|
|
@@ -13,19 +14,23 @@ 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 javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Api(tags = "学生管理")
|
|
|
-@RequestMapping("studentManage")
|
|
|
@RestController
|
|
|
public class StudentManageController extends BaseController {
|
|
|
|
|
@@ -43,9 +48,50 @@ 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) {
|
|
|
+ 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("非法请求");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<StudentManageListDto> rows = studentManageService.queryHasCourseStudent(queryInfo);
|
|
|
+ if(rows.size() > 50000){
|
|
|
+ throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
|
|
|
+ }
|
|
|
+ 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("/queryStudentList")
|
|
|
+ @GetMapping("studentManage/queryStudentList")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentList')")
|
|
|
public Object queryStudentList(StudentManageQueryInfo queryInfo){
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
@@ -69,14 +115,14 @@ public class StudentManageController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "学员注册")
|
|
|
- @PostMapping("/register")
|
|
|
+ @PostMapping("studentManage/register")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/register')")
|
|
|
public Object studentRegister(SysUser sysUser){
|
|
|
return succeed(studentManageService.studentRegister(sysUser));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "修改学员信息")
|
|
|
- @PostMapping("/studentUpdate")
|
|
|
+ @PostMapping("studentManage/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();
|
|
@@ -91,14 +137,14 @@ public class StudentManageController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "乐团管理--乐团详情--获取学员列表")
|
|
|
- @GetMapping("/queryMusicGroupStudent")
|
|
|
+ @GetMapping("studentManage/queryMusicGroupStudent")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/queryMusicGroupStudent')")
|
|
|
public Object queryMusicGroupStudent(MusicGroupStudentQueryInfo queryInfo){
|
|
|
return succeed(studentManageService.queryMusicGroupStudent(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "乐团管理--乐团详情--学员列表--查看班级")
|
|
|
- @GetMapping("/queryStudentClassGroup")
|
|
|
+ @GetMapping("studentManage/queryStudentClassGroup")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentClassGroup')")
|
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "teacherId", value = "学生编号", required = true, dataType = "Integer"),
|
|
|
@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
|
|
@@ -110,70 +156,70 @@ public class StudentManageController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "乐团管理--乐团详情--学员列表,汇总数据接口")
|
|
|
- @GetMapping("/musicGroupStudentsSum")
|
|
|
+ @GetMapping("studentManage/musicGroupStudentsSum")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/musicGroupStudentsSum')")
|
|
|
public Object musicGroupStudentsSum(String musicGroupId){
|
|
|
return succeed(studentManageService.musicGroupStudentsSum(musicGroupId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "乐团管理--乐团详情--点名总览")
|
|
|
- @GetMapping("/queryMusicGroupStudentsSign")
|
|
|
+ @GetMapping("studentManage/queryMusicGroupStudentsSign")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/queryMusicGroupStudentsSign')")
|
|
|
public Object queryMusicGroupStudentsSign(StudentSignQueryInfo queryInfo){
|
|
|
return succeed(studentManageService.queryMusicGroupStudentsSign(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据学生ID获取学生基本报名信息")
|
|
|
- @GetMapping("/findStudentBaseInfo")
|
|
|
+ @GetMapping("studentManage/findStudentBaseInfo")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/findStudentBaseInfo')")
|
|
|
public Object findStudentBaseInfo(@ApiParam(value = "学生编号", required = true) Integer userId){
|
|
|
return succeed(studentManageService.findStudentManageBaseInfo(userId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据学生ID获取其所在的乐团")
|
|
|
- @GetMapping("/findStudentMusicGroups")
|
|
|
+ @GetMapping("studentManage/findStudentMusicGroups")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/findStudentMusicGroups')")
|
|
|
public Object findStudentMusicGroups(@ApiParam(value = "学生编号", required = true) Integer userId){
|
|
|
return succeed(studentManageService.findStudentMusicGroupsByUserId(userId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据乐团获取排课列表")
|
|
|
- @GetMapping("/findStudentCourses")
|
|
|
+ @GetMapping("studentManage/findStudentCourses")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/findStudentCourses')")
|
|
|
public Object findStudentCourses(StudentManageCourseQueryInfo queryInfo){
|
|
|
return succeed(studentManageService.findStudentCourseList(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取学生签到列表")
|
|
|
- @GetMapping("/findStudentAttendances")
|
|
|
+ @GetMapping("studentManage/findStudentAttendances")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/findStudentAttendances')")
|
|
|
public Object findStudentAttendances(StudentManageAttendanceQueryInfo queryInfo){
|
|
|
return succeed(studentManageService.findStudentAttendances(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取学生vip课程")
|
|
|
- @GetMapping("/findStudentVipGroups")
|
|
|
+ @GetMapping("studentManage/findStudentVipGroups")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/findStudentVipGroups')")
|
|
|
public Object findStudentVipGroups(StudentManageCourseQueryInfo queryInfo){
|
|
|
return succeed(studentManageService.findStudentVipGroups(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取学生vip班级列表")
|
|
|
- @GetMapping("/findStudentVipGroupClass")
|
|
|
+ @GetMapping("studentManage/findStudentVipGroupClass")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/findStudentVipGroupClass')")
|
|
|
public Object findStudentVipGroupClass(StudentManageVipClassQueryInfo queryInfo){
|
|
|
return succeed(studentManageService.findStudentVipGroupClass(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取用户默认账户基本信息")
|
|
|
- @GetMapping("/getUserCashAccountBaseInfo")
|
|
|
+ @GetMapping("studentManage/getUserCashAccountBaseInfo")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/getUserCashAccountBaseInfo')")
|
|
|
public Object getUserCashAccountBaseInfo(Integer userId){
|
|
|
return succeed(studentManageService.getStudentAccountBaseInfo(userId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取学员扣费记录列表")
|
|
|
- @GetMapping("/queryStudentPayment")
|
|
|
+ @GetMapping("studentManage/queryStudentPayment")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentPayment')")
|
|
|
public Object queryStudentPayment(TeacherPaymentRecordInfo queryInfo){
|
|
|
return succeed(studentManageService.queryStudentPayment(queryInfo));
|
|
@@ -184,7 +230,7 @@ public class StudentManageController extends BaseController {
|
|
|
* @param mobile
|
|
|
* @return
|
|
|
*/
|
|
|
- @GetMapping(value = "/queryUserByPhone")
|
|
|
+ @GetMapping(value = "studentManage/queryUserByPhone")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/queryUserByPhone')")
|
|
|
public Object queryUserByPhone(String mobile) {
|
|
|
return succeed(studentRegistrationService.queryUserByPhone(mobile));
|
|
@@ -194,7 +240,7 @@ public class StudentManageController extends BaseController {
|
|
|
* 修改学员缴费金额和缴费周期
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping(value = "/updateStudentFee")
|
|
|
+ @PostMapping(value = "studentManage/updateStudentFee")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/updateStudentFee')")
|
|
|
public Object updateStudentFee(UpdateStudentFeeDto studentFeeDto) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
@@ -210,7 +256,7 @@ public class StudentManageController extends BaseController {
|
|
|
* 修改学员缴费周期锁定状态
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping(value = "/updateStudentFeeIsLock")
|
|
|
+ @PostMapping(value = "studentManage/updateStudentFeeIsLock")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/updateStudentFeeIsLock')")
|
|
|
public Object updateStudentFeeIsLock(UpdateStudentFeeDto studentFeeDto) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
@@ -226,7 +272,7 @@ public class StudentManageController extends BaseController {
|
|
|
* 获取学员缴费日历信息
|
|
|
* @return
|
|
|
*/
|
|
|
- @GetMapping(value = "/findMusicGroupStudentFee")
|
|
|
+ @GetMapping(value = "studentManage/findMusicGroupStudentFee")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/findMusicGroupStudentFee')")
|
|
|
public Object findMusicGroupStudentFee(Integer studentId,String musicGroupId) {
|
|
|
if(studentId == null || StringUtils.isEmpty(musicGroupId)){
|
|
@@ -243,7 +289,7 @@ public class StudentManageController extends BaseController {
|
|
|
* 获取课程学员作业列表
|
|
|
* @return
|
|
|
*/
|
|
|
- @GetMapping(value = "/findStudentCourseHomeworks")
|
|
|
+ @GetMapping(value = "studentManage/findStudentCourseHomeworks")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/findStudentCourseHomeworks')")
|
|
|
public Object findStudentCourseHomeworks(QueryInfo queryInfo) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
@@ -257,7 +303,7 @@ public class StudentManageController extends BaseController {
|
|
|
* 获取课程学员作业列表
|
|
|
* @return
|
|
|
*/
|
|
|
- @GetMapping(value = "/sumStudentAttendance")
|
|
|
+ @GetMapping(value = "studentManage/sumStudentAttendance")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentManage/sumStudentAttendance')")
|
|
|
public Object sumStudentAttendance(Integer courseScheduleId) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|