肖海南查老师所教的学生方法修改

master
总裁 3 months ago
parent dd6e7d9dc2
commit d1da72ad1a
  1. 2
      src/main/java/com/teaching/backend/service/courses/ICoursesService.java
  2. 27
      src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java

@ -51,6 +51,8 @@ public interface ICoursesService extends IService<Courses> {
Map<String, Object> getPagePageSize2(int page, int pageSize);
List<PersonalCenterStudentListVO> queryStudentList(String userId);
LinkedHashSet<UmsStudentManage> queryTeacherByStudentLearningRecordList(String userId);
LinkedHashSet<UmsStudentManage> queryTeacherByStudentList(String userId);
List<CourseUserInfVO> getUserInfByCourse(Long userId);

@ -360,8 +360,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
@Override
public List<PersonalCenterStudentListVO> queryStudentList(String userId) {
LinkedHashSet<UmsStudentManage> umsStudentManageList = queryTeacherByStudentList(userId);
System.out.println("1111111"+umsStudentManageList);
LinkedHashSet<UmsStudentManage> umsStudentManageList = queryTeacherByStudentLearningRecordList(userId);
List<PersonalCenterStudentListVO> personalCenterStudentListVOList = new ArrayList<>();
PersonalCenterStudentListVO personalCenterStudentListVO = null;
for (UmsStudentManage umsStudentManage : umsStudentManageList) {
@ -375,7 +374,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
}
@Override
public LinkedHashSet<UmsStudentManage> queryTeacherByStudentList(String userId) {
public LinkedHashSet<UmsStudentManage> queryTeacherByStudentLearningRecordList(String userId) {
String roleId = umsUserMapper.getByIdRoleId(userId);
CourseQuery courseQuery = new CourseQuery();
courseQuery.setUserId(userId);
@ -404,7 +403,27 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
throw new BusinessException(400,"只有老师才有此功能");
}
@Override
public LinkedHashSet<UmsStudentManage> queryTeacherByStudentList(String userId) {
String roleId = umsUserMapper.getByIdRoleId(userId);
CourseQuery courseQuery = new CourseQuery();
courseQuery.setUserId(userId);
LinkedHashSet<UmsStudentManage> umsStudentManageList = new LinkedHashSet<>();
if (roleId.equals("1")){
PageDTO<CoursesVO> queryCourses = queryCourses(courseQuery);
List<CoursesVO> coursesList = queryCourses.getList();
List<String> courseIds = coursesList.stream().map(CoursesVO::getId).collect(Collectors.toList());
for (String courseId : courseIds) {
List<StudentCourses> studentUsernames = studentCoursesMapper.selectBatchSomeStudent(courseId);
for (StudentCourses studentUsername : studentUsernames) {
UmsStudentManage umsStudentManage = umsStudentManageMapper.queryStudent(String.valueOf(studentUsername.getStudent()));
umsStudentManageList.add(umsStudentManage);
}
}
return umsStudentManageList;
}
throw new BusinessException(400,"只有老师才有此功能");
}
@Override
public List<CoursesVO> getPagePageSize(int page, int pageSize) {

Loading…
Cancel
Save