diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionLogService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionLogService.java index f785a68d..0501a516 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionLogService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionLogService.java @@ -51,6 +51,7 @@ import static com.ibeetl.jlw.enums.QuestionLogAddTypeEnum.FINALLY_SUBMIT; import static com.ibeetl.jlw.enums.QuestionLogAddTypeEnum.PRE_SUBMIT; import static com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum.CHAPTER_EXERCISE; import static java.util.stream.Collectors.groupingBy; +import static java.util.stream.Collectors.joining; /** * 题目日志 Service @@ -593,7 +594,7 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService stringTeacherOpenCourseQuestionLogFunction = logId -> { TeacherOpenCourseQuestionLog questionLog = new TeacherOpenCourseQuestionLog(); @@ -607,6 +608,35 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService list = getValuesByQueryNotWithPermission(logQuery); + + if (ObjectUtil.isEmpty(list)) { + throw new PlatformException("收藏失败,未查询到要收藏的题目"); + } + + String logIds = list.stream() + .map(o -> o.getTeacherOpenCourseQuestionLogId().toString()).collect(joining(",")); + + // 根据做题的日志ID,收藏题目 + tuckByLogIds(logIds, isTuck); + } + /** * 批量收藏到错题库 * @param teacherOpenCourseQuestionLogIds @@ -660,4 +690,5 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService