|
@@ -1,7 +1,9 @@
|
|
package com.ym.mec.web.controller;
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
|
|
+import com.ym.mec.biz.dal.entity.StudentRegistration;
|
|
import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
|
|
import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
|
+import com.ym.mec.biz.dal.wrapper.StudentWrapper;
|
|
import com.ym.mec.biz.service.ClassGroupStudentMapperService;
|
|
import com.ym.mec.biz.service.ClassGroupStudentMapperService;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
@@ -10,18 +12,12 @@ import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
-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 org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
-import java.util.Arrays;
|
|
|
|
-import java.util.HashSet;
|
|
|
|
-import java.util.Objects;
|
|
|
|
-import java.util.Set;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@RequestMapping("${app-config.url.web:}/classGroupStudent")
|
|
@RequestMapping("${app-config.url.web:}/classGroupStudent")
|
|
@@ -29,7 +25,7 @@ import java.util.stream.Collectors;
|
|
@RestController
|
|
@RestController
|
|
public class ClassGroupStudentController extends BaseController {
|
|
public class ClassGroupStudentController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
|
+ @Resource
|
|
private ClassGroupStudentMapperService classGroupStudentMapperService;
|
|
private ClassGroupStudentMapperService classGroupStudentMapperService;
|
|
|
|
|
|
|
|
|
|
@@ -38,7 +34,7 @@ public class ClassGroupStudentController extends BaseController {
|
|
@PreAuthorize("@pcs.hasPermissions('classGroupStudent/del')")
|
|
@PreAuthorize("@pcs.hasPermissions('classGroupStudent/del')")
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "int"),
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "int"),
|
|
@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
|
|
@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
|
|
- public HttpResponseResult del(Integer userId, Integer classGroupId) throws Exception {
|
|
|
|
|
|
+ public HttpResponseResult<Boolean> del(Integer userId, Integer classGroupId) throws Exception {
|
|
return succeed(classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId,false));
|
|
return succeed(classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId,false));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -46,8 +42,8 @@ public class ClassGroupStudentController extends BaseController {
|
|
@PostMapping("/findAllStudent")
|
|
@PostMapping("/findAllStudent")
|
|
@PreAuthorize("@pcs.hasPermissions('classGroupStudent/findAllStudent')")
|
|
@PreAuthorize("@pcs.hasPermissions('classGroupStudent/findAllStudent')")
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
|
|
- public HttpResponseResult findAllStudent(Integer classGroupId) throws Exception {
|
|
|
|
- return succeed(classGroupStudentMapperService.findClassStudentList(classGroupId, ClassGroupStudentStatusEnum.NORMAL));
|
|
|
|
|
|
+ public HttpResponseResult<List<StudentWrapper.ClassStudentDto>> findAllStudent(@RequestBody StudentWrapper.ClassStudentQuery query) throws Exception {
|
|
|
|
+ return succeed(classGroupStudentMapperService.findAllStudent(query));
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "调整班级(小班课)")
|
|
@ApiOperation(value = "调整班级(小班课)")
|
|
@@ -58,7 +54,7 @@ public class ClassGroupStudentController extends BaseController {
|
|
@ApiImplicitParam(name = "oldClassGroupId", value = "原班级id", required = true, dataType = "int"),
|
|
@ApiImplicitParam(name = "oldClassGroupId", value = "原班级id", required = true, dataType = "int"),
|
|
@ApiImplicitParam(name = "classGroupId", value = "新班级id", required = true, dataType = "int")
|
|
@ApiImplicitParam(name = "classGroupId", value = "新班级id", required = true, dataType = "int")
|
|
})
|
|
})
|
|
- public HttpResponseResult adjustClassGroup(Integer userId, Integer oldClassGroupId, Integer classGroupId) throws Exception {
|
|
|
|
|
|
+ public HttpResponseResult<Boolean> adjustClassGroup(Integer userId, Integer oldClassGroupId, Integer classGroupId) throws Exception {
|
|
return succeed(classGroupStudentMapperService.adjustClassGroup(userId, oldClassGroupId, classGroupId));
|
|
return succeed(classGroupStudentMapperService.adjustClassGroup(userId, oldClassGroupId, classGroupId));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -70,7 +66,7 @@ public class ClassGroupStudentController extends BaseController {
|
|
@ApiImplicitParam(name = "classGroupId", value = "小课班班级id", required = true, dataType = "int"),
|
|
@ApiImplicitParam(name = "classGroupId", value = "小课班班级id", required = true, dataType = "int"),
|
|
@ApiImplicitParam(name = "userIdsStr", value = "学生UserId,逗号分隔", required = true, dataType = "String")
|
|
@ApiImplicitParam(name = "userIdsStr", value = "学生UserId,逗号分隔", required = true, dataType = "String")
|
|
})
|
|
})
|
|
- public HttpResponseResult addStudents(Integer classGroupId, String userIdsStr) throws Exception {
|
|
|
|
|
|
+ public HttpResponseResult<Boolean> addStudents(Integer classGroupId, String userIdsStr) throws Exception {
|
|
return succeed(classGroupStudentMapperService.addStudents(classGroupId, userIdsStr, GroupType.MUSIC));
|
|
return succeed(classGroupStudentMapperService.addStudents(classGroupId, userIdsStr, GroupType.MUSIC));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -89,7 +85,7 @@ public class ClassGroupStudentController extends BaseController {
|
|
@ApiOperation(value = "修改班级学员")
|
|
@ApiOperation(value = "修改班级学员")
|
|
@PostMapping("/updateClassGroupStudents")
|
|
@PostMapping("/updateClassGroupStudents")
|
|
@PreAuthorize("@pcs.hasPermissions('classGroupStudent/updateClassGroupStudents')")
|
|
@PreAuthorize("@pcs.hasPermissions('classGroupStudent/updateClassGroupStudents')")
|
|
- public HttpResponseResult updateClassGroupStudents(Long classGroupId, String studentIds){
|
|
|
|
|
|
+ public HttpResponseResult<Object> updateClassGroupStudents(Long classGroupId, String studentIds){
|
|
if(Objects.isNull(classGroupId)){
|
|
if(Objects.isNull(classGroupId)){
|
|
return failed("请指定班级");
|
|
return failed("请指定班级");
|
|
}
|
|
}
|