|
|
@ -29,6 +29,7 @@ import com.teaching.backend.model.entity.umsAdmin.UmsUser; |
|
|
|
import com.teaching.backend.model.query.CourseQuery; |
|
|
|
import com.teaching.backend.model.query.CourseQuery; |
|
|
|
import com.teaching.backend.model.vo.courses.CourseObjectivesTreeVO; |
|
|
|
import com.teaching.backend.model.vo.courses.CourseObjectivesTreeVO; |
|
|
|
import com.teaching.backend.model.vo.courses.CoursesVO; |
|
|
|
import com.teaching.backend.model.vo.courses.CoursesVO; |
|
|
|
|
|
|
|
import com.teaching.backend.model.vo.courses.PersonalCenterStudentListVO; |
|
|
|
import com.teaching.backend.model.vo.umsAdmin.UmsStudentVO; |
|
|
|
import com.teaching.backend.model.vo.umsAdmin.UmsStudentVO; |
|
|
|
import com.teaching.backend.service.courses.ICoursesService; |
|
|
|
import com.teaching.backend.service.courses.ICoursesService; |
|
|
|
import com.teaching.backend.utils.CourseCode; |
|
|
|
import com.teaching.backend.utils.CourseCode; |
|
|
@ -352,7 +353,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public LinkedHashSet<UmsStudent> queryStudentList(String userId) { |
|
|
|
public LinkedHashSet<PersonalCenterStudentListVO> queryStudentList(String userId) { |
|
|
|
String roleId = umsUserMapper.getbyIdRoleId(userId); |
|
|
|
String roleId = umsUserMapper.getbyIdRoleId(userId); |
|
|
|
CourseQuery courseQuery = new CourseQuery(); |
|
|
|
CourseQuery courseQuery = new CourseQuery(); |
|
|
|
courseQuery.setUserId(userId); |
|
|
|
courseQuery.setUserId(userId); |
|
|
@ -360,7 +361,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
PageDTO<CoursesVO> queryCourses = queryCourses(courseQuery); |
|
|
|
PageDTO<CoursesVO> queryCourses = queryCourses(courseQuery); |
|
|
|
List<CoursesVO> coursesList = queryCourses.getList(); |
|
|
|
List<CoursesVO> coursesList = queryCourses.getList(); |
|
|
|
List<String> courseIds = coursesList.stream().map(CoursesVO::getId).collect(Collectors.toList()); |
|
|
|
List<String> courseIds = coursesList.stream().map(CoursesVO::getId).collect(Collectors.toList()); |
|
|
|
LinkedHashSet<UmsStudent> studentNameList = new LinkedHashSet<>(); |
|
|
|
LinkedHashSet<PersonalCenterStudentListVO> studentNameList = new LinkedHashSet<>(); |
|
|
|
for (String courseId : courseIds) { |
|
|
|
for (String courseId : courseIds) { |
|
|
|
List<StudentCourses> studentUsernames = studentCoursesMapper.selectBatchSomeStudent(courseId); |
|
|
|
List<StudentCourses> studentUsernames = studentCoursesMapper.selectBatchSomeStudent(courseId); |
|
|
|
List<CourseLearningRecord> courseLearningRecordList = new ArrayList<>(); |
|
|
|
List<CourseLearningRecord> courseLearningRecordList = new ArrayList<>(); |
|
|
@ -371,7 +372,12 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
courseLearningRecordList = courseLearningRecordList.stream().sorted(Comparator.comparing(CourseLearningRecord::getTimes).reversed()).collect(Collectors.toList()); |
|
|
|
courseLearningRecordList = courseLearningRecordList.stream().sorted(Comparator.comparing(CourseLearningRecord::getTimes).reversed()).collect(Collectors.toList()); |
|
|
|
for (CourseLearningRecord courseLearningRecord : courseLearningRecordList) { |
|
|
|
for (CourseLearningRecord courseLearningRecord : courseLearningRecordList) { |
|
|
|
UmsStudent umsStudent = umsStudentMapper.selectByUserId(Integer.valueOf(courseLearningRecord.getUserId())); |
|
|
|
UmsStudent umsStudent = umsStudentMapper.selectByUserId(Integer.valueOf(courseLearningRecord.getUserId())); |
|
|
|
studentNameList.add(umsStudent); |
|
|
|
UmsUser user = umsUserMapper.selectById(courseLearningRecord.getUserId()); |
|
|
|
|
|
|
|
PersonalCenterStudentListVO pcsl = new PersonalCenterStudentListVO(); |
|
|
|
|
|
|
|
pcsl.setName(umsStudent.getName()); |
|
|
|
|
|
|
|
pcsl.setNumber(umsStudent.getNumber()); |
|
|
|
|
|
|
|
pcsl.setIcon(user.getIcon()); |
|
|
|
|
|
|
|
studentNameList.add(pcsl); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return studentNameList; |
|
|
|
return studentNameList; |
|
|
|