|
|
@ -127,7 +127,7 @@ public class CourseLearningRecordServiceImpl extends ServiceImpl<CourseLearningR |
|
|
|
String roleId = umsUserMapper.getByIdRoleId(userId); |
|
|
|
String roleId = umsUserMapper.getByIdRoleId(userId); |
|
|
|
List<Courses> coursesList = new ArrayList<>(); |
|
|
|
List<Courses> coursesList = new ArrayList<>(); |
|
|
|
if (roleId.equals("1")){ |
|
|
|
if (roleId.equals("1")){ |
|
|
|
List<String> courseIds = courseLearningRecordMapper.selectMaxNumber(); |
|
|
|
List<String> courseIds = courseLearningRecordMapper.selectMaxNumber(userId); |
|
|
|
for (String courseId : courseIds) { |
|
|
|
for (String courseId : courseIds) { |
|
|
|
Courses courses = coursesMapper.selectById(courseId); |
|
|
|
Courses courses = coursesMapper.selectById(courseId); |
|
|
|
coursesList.add(courses); |
|
|
|
coursesList.add(courses); |
|
|
@ -149,18 +149,15 @@ public class CourseLearningRecordServiceImpl extends ServiceImpl<CourseLearningR |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<CoursesVO> queryrecommendCourses(String userId) { |
|
|
|
public List<CoursesVO> queryrecommendCourses(String userId) { |
|
|
|
String roleId = umsUserMapper.getByIdRoleId(userId); |
|
|
|
List<Courses> coursesList = new ArrayList<>(); |
|
|
|
|
|
|
|
List<String> courseIds = courseLearningRecordMapper.selectMaxNumber(userId); |
|
|
|
if (roleId.equals("1")) { |
|
|
|
for (String courseId : courseIds) { |
|
|
|
|
|
|
|
Courses courses = coursesMapper.selectById(courseId); |
|
|
|
return null; |
|
|
|
if (courses != null){ |
|
|
|
} else if (roleId.equals("2")) { |
|
|
|
coursesList.add(courses); |
|
|
|
|
|
|
|
} |
|
|
|
return null; |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<CoursesVO> coursesVOList = BeanUtil.copyToList(coursesList, CoursesVO.class); |
|
|
|
|
|
|
|
return coursesVOList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|