|
|
|
@ -1,9 +1,11 @@
|
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.bean.copier.CopyOptions;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.map.MapUtil;
|
|
|
|
|
import cn.hutool.core.util.BooleanUtil;
|
|
|
|
|
import cn.hutool.core.util.ReUtil;
|
|
|
|
|
import cn.jlw.util.ToolUtils;
|
|
|
|
@ -485,7 +487,7 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
/**
|
|
|
|
|
* 根据题目配置ID查询题目快照,并根据类型分组
|
|
|
|
|
*
|
|
|
|
|
* @param questionSettingId
|
|
|
|
|
* @param questionSettingId 题目配置ID
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Map<Integer, List<TeacherOpenCourseQuestionLog>> questionAnalysis(@NotNull(message = "题目配置ID不能为空!") Long questionSettingId, @NotNull(message = "学生ID不能为空!") Long studentId) {
|
|
|
|
@ -497,6 +499,30 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
return questionAnalysis(valuesByQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取题目日志,信息
|
|
|
|
|
* @param questionSettingId 题目配置ID
|
|
|
|
|
* @param studentId 学生ID
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private List<ResourcesQuestionSnapshot> questionAnalysisNotType(Long questionSettingId, Long studentId) {
|
|
|
|
|
Map<Integer, List<TeacherOpenCourseQuestionLog>> tempMap = questionAnalysis(questionSettingId, studentId);
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> collect = tempMap.values().stream().flatMap(Collection::stream).collect(Collectors.toList());
|
|
|
|
|
List<ResourcesQuestionSnapshot> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
Map<String, String> build = MapUtil.builder("courseInfoId", "teacherOpenCourseMergeCourseInfoId").build();
|
|
|
|
|
CopyOptions copyOptions = CopyOptions.create().setFieldMapping(build);
|
|
|
|
|
Optional.ofNullable(collect).ifPresent(item -> {
|
|
|
|
|
for (TeacherOpenCourseQuestionLog questionLog : item) {
|
|
|
|
|
ResourcesQuestionSnapshot resourcesQuestionSnapshot = new ResourcesQuestionSnapshot();
|
|
|
|
|
BeanUtil.copyProperties(questionLog, resourcesQuestionSnapshot, copyOptions);
|
|
|
|
|
resourcesQuestionSnapshot.set("teacherOpenCourseQuestionLogAnswer", questionLog.getTeacherOpenCourseQuestionLogAnswer());
|
|
|
|
|
result.add(resourcesQuestionSnapshot);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据题目快照ID查询题目快照,并根据类型分组
|
|
|
|
|
*
|
|
|
|
|