mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-25 02:32:57 +08:00
fix:添加根据课程id查询studyCourse表数据集合,并修正对应的错误逻辑
This commit is contained in:
@@ -105,6 +105,13 @@ public interface IStudyCourseService {
|
||||
*/
|
||||
List<StudyCourse> findByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据课程id集合查询StudyCourse集合
|
||||
* @param courseIds 课程id集合
|
||||
* @return StudyCourse集合
|
||||
*/
|
||||
List<StudyCourse> findByCourseIds(List<String> courseIds);
|
||||
|
||||
/**
|
||||
* 查询课程内容学习记录
|
||||
* */
|
||||
|
||||
@@ -957,6 +957,17 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
||||
return studyCourseDao.findList(FieldFilters.in("id", ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据课程id集合查询StudyCourse集合
|
||||
*
|
||||
* @param courseIds 课程id集合
|
||||
* @return StudyCourse集合
|
||||
*/
|
||||
@Override
|
||||
public List<StudyCourse> findByCourseIds(List<String> courseIds) {
|
||||
return studyCourseDao.findList(FieldFilters.in("courseId", courseIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据课程id得到对应考试记录
|
||||
* 这个接口从study_course_item表获取,这个表的score分数字段更新时,是根据考试设置最新/最高分的
|
||||
|
||||
@@ -403,7 +403,7 @@ public class StudyServiceImpl implements IStudyService{
|
||||
// 3. 批量查询 StudyCourse
|
||||
Map<String, StudyCourse> courseMap = new HashMap<>();
|
||||
if (!courseIds.isEmpty()) {
|
||||
List<StudyCourse> courses = studyCourseService.findByIds(new ArrayList<>(courseIds));
|
||||
List<StudyCourse> courses = studyCourseService.findByCourseIds(new ArrayList<>(courseIds));
|
||||
if (courses != null) {
|
||||
courseMap = courses.stream().collect(Collectors.toMap(StudyCourse::getId, Function.identity(), (e1, e2) -> e1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user