|
@@ -2,10 +2,14 @@ package com.ym.mec.teacher.controller;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentDao;
|
|
|
import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
|
|
|
import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
+import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
import com.ym.mec.biz.dal.entity.ExtracurricularExercises;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
+import com.ym.mec.biz.dal.entity.Subject;
|
|
|
import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
|
|
|
import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
|
|
|
import com.ym.mec.biz.service.ExtracurricularExercisesService;
|
|
@@ -22,10 +26,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -45,6 +46,10 @@ public class ExtracurricularExercisesController extends BaseController {
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
@Autowired
|
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
|
+ @Autowired
|
|
|
+ private ClassGroupStudentMapperDao classGroupStudentMapperDao;
|
|
|
+ @Autowired
|
|
|
+ private StudentDao studentDao;
|
|
|
|
|
|
@ApiOperation(value = "创建课外训练")
|
|
|
@PostMapping("/createExtraExercises")
|
|
@@ -81,12 +86,12 @@ public class ExtracurricularExercisesController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "获取待布置学员列表")
|
|
|
@GetMapping("/getDontServeStudents")
|
|
|
- public HttpResponseResult getDontServeStudents(String search, String musicGroupId){
|
|
|
+ public HttpResponseResult getDontServeStudents(String search, String musicGroupId, Long classGroupId, Integer subjectId){
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if(Objects.isNull(sysUser)){
|
|
|
return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
|
}
|
|
|
- return succeed(extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, musicGroupId));
|
|
|
+ return succeed(extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, musicGroupId, classGroupId, subjectId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取待布置学员乐团列表")
|
|
@@ -96,7 +101,7 @@ public class ExtracurricularExercisesController extends BaseController {
|
|
|
if(Objects.isNull(sysUser)){
|
|
|
return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
|
}
|
|
|
- List<BasicUserDto> dontServeStudents = extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, null);
|
|
|
+ List<BasicUserDto> dontServeStudents = extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, null, null,null);
|
|
|
if(CollectionUtils.isEmpty(dontServeStudents)){
|
|
|
return succeed(Collections.emptyList());
|
|
|
}
|
|
@@ -104,4 +109,28 @@ public class ExtracurricularExercisesController extends BaseController {
|
|
|
List<MusicGroup> studentNormalMusicGroups = studentRegistrationDao.getStudentNormalMusicGroups(studentIds);
|
|
|
return succeed(studentNormalMusicGroups);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取服务学员查询条件")
|
|
|
+ @GetMapping("/getDontServeStudentQueryCondition")
|
|
|
+ public HttpResponseResult getDontServeStudentQueryCondition(){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(Objects.isNull(sysUser)){
|
|
|
+ return failed(HttpStatus.FORBIDDEN,"请登录");
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ List<BasicUserDto> dontServeStudents = extracurricularExercisesService.getDontServeStudents(sysUser.getId(), null, null);
|
|
|
+ if(CollectionUtils.isEmpty(dontServeStudents)){
|
|
|
+ return succeed(result);
|
|
|
+ }
|
|
|
+ Set<Integer> studentIds = dontServeStudents.stream().map(BasicUserDto::getUserId).collect(Collectors.toSet());
|
|
|
+ List<MusicGroup> studentNormalMusicGroups = studentRegistrationDao.getStudentNormalMusicGroups(studentIds);
|
|
|
+ result.put("musicGroups", studentNormalMusicGroups);
|
|
|
+
|
|
|
+ List<ClassGroup> classGroups = classGroupStudentMapperDao.getStudentClassGroupWithTeacher(studentIds, sysUser.getId());
|
|
|
+ result.put("classGroups", classGroups);
|
|
|
+
|
|
|
+ List<Subject> studentSubjects = studentDao.getStudentSubjects(studentIds);
|
|
|
+ result.put("subjects", studentSubjects);
|
|
|
+ return succeed(result);
|
|
|
+ }
|
|
|
}
|