|
@@ -6,11 +6,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.ym.mec.biz.dal.enums.JobTypeEnum;
|
|
|
+import com.ym.mec.common.security.SecurityUtils;
|
|
|
import com.ym.mec.education.base.PageResponse;
|
|
|
import com.ym.mec.education.entity.*;
|
|
|
import com.ym.mec.education.enums.TeachTypeEnum;
|
|
|
import com.ym.mec.education.mapper.ClassGroupStudentMapperMapper;
|
|
|
import com.ym.mec.education.req.ClassGroupReq;
|
|
|
+import com.ym.mec.education.req.StudentReq;
|
|
|
import com.ym.mec.education.req.TeacherReq;
|
|
|
import com.ym.mec.education.resp.ClassStudentResp;
|
|
|
import com.ym.mec.education.resp.StudentListResp;
|
|
@@ -105,12 +107,9 @@ public class ClassGroupStudentMapperServiceImpl extends ServiceImpl<ClassGroupSt
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public PageResponse getPageByTeacher(TeacherReq teacherReq) {
|
|
|
- if (Objects.isNull(teacherReq.getUserId())) {
|
|
|
- return PageResponse.errorParam();
|
|
|
- }
|
|
|
+ public PageResponse getPageByTeacher(StudentReq studentReq) {
|
|
|
//判断当前登录人角色
|
|
|
- Teacher teacher = teacherService.getById(teacherReq.getUserId());
|
|
|
+ Teacher teacher = teacherService.getById(SecurityUtils.getUser().getUserId());
|
|
|
if (Objects.nonNull(teacher)) {
|
|
|
//教学主管
|
|
|
QueryWrapper<MusicGroup> musicGroupQueryWrapper = new QueryWrapper<>();
|
|
@@ -129,7 +128,7 @@ public class ClassGroupStudentMapperServiceImpl extends ServiceImpl<ClassGroupSt
|
|
|
musicGroupList.stream().map(MusicGroup::getId).collect(Collectors.toList()));
|
|
|
List<ClassGroup> classGroupList = classGroupService.list(classGroupQueryWrapper);
|
|
|
if (!CollectionUtils.isEmpty(classGroupList)) {
|
|
|
- return PageResponse.success(getPage(classGroupList, teacherReq, musicGroupList));
|
|
|
+ return PageResponse.success(getPage(classGroupList, studentReq, musicGroupList));
|
|
|
}
|
|
|
}
|
|
|
//指导老师 助教老师
|
|
@@ -150,14 +149,14 @@ public class ClassGroupStudentMapperServiceImpl extends ServiceImpl<ClassGroupSt
|
|
|
if (!CollectionUtils.isEmpty(classGroupList)) {
|
|
|
musicGroupQueryWrapper.lambda().in(MusicGroup::getId, classGroupList.stream().map(ClassGroup::getMusicGroupId).collect(Collectors.toList()));
|
|
|
musicGroupList = musicGroupService.list(musicGroupQueryWrapper);
|
|
|
- return PageResponse.success(getPage(classGroupList, teacherReq, musicGroupList));
|
|
|
+ return PageResponse.success(getPage(classGroupList, studentReq, musicGroupList));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return PageResponse.noDataExists();
|
|
|
}
|
|
|
|
|
|
- private IPage<StudentListResp> getPage(List<ClassGroup> classGroupList, TeacherReq teacherReq, List<MusicGroup> musicGroupList) {
|
|
|
+ private IPage<StudentListResp> getPage(List<ClassGroup> classGroupList, StudentReq studentReq, List<MusicGroup> musicGroupList) {
|
|
|
Page<StudentListResp> pageResult = new Page<>();
|
|
|
ArrayList<StudentListResp> resultList = Lists.newArrayList();
|
|
|
QueryWrapper<ClassGroupStudentMapper> classGroupStudentMapperQueryWrapper = new QueryWrapper<>();
|
|
@@ -167,8 +166,9 @@ public class ClassGroupStudentMapperServiceImpl extends ServiceImpl<ClassGroupSt
|
|
|
if (!CollectionUtils.isEmpty(classGroupStudentMapperList)) {
|
|
|
QueryWrapper<SysUser> sysUserQueryWrapper = new QueryWrapper<>();
|
|
|
sysUserQueryWrapper.lambda().in(SysUser::getId,
|
|
|
- classGroupStudentMapperList.stream().map(ClassGroupStudentMapper::getUserId).collect(Collectors.toList()));
|
|
|
- Page<SysUser> sysUserPage = new Page<>(teacherReq.getPageNo(), teacherReq.getPageSize());
|
|
|
+ classGroupStudentMapperList.stream().map(ClassGroupStudentMapper::getUserId).collect(Collectors.toList()))
|
|
|
+ .like(SysUser::getRealName, studentReq.getStudentName());
|
|
|
+ Page<SysUser> sysUserPage = new Page<>(studentReq.getPageNo(), studentReq.getPageSize());
|
|
|
IPage<SysUser> page = sysUserService.page(sysUserPage, sysUserQueryWrapper);
|
|
|
if (!CollectionUtils.isEmpty(page.getRecords())) {
|
|
|
BeanUtils.copyProperties(page, pageResult);
|