|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.collection.ConcurrentHashSet;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
@ -20,6 +21,7 @@ import com.ibeetl.admin.core.web.JsonReturnCode;
|
|
|
|
|
import com.ibeetl.jlw.dao.*;
|
|
|
|
|
import com.ibeetl.jlw.entity.*;
|
|
|
|
|
import com.ibeetl.jlw.entity.dto.QuestionSettingDTO;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.OpenCourseQuestionSettingAnalysisAvgVO;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseQuestionSettingAnalysisVO;
|
|
|
|
|
import com.ibeetl.jlw.enums.*;
|
|
|
|
|
import com.ibeetl.jlw.service.questionQueue.questionSettingQueue.QuestionSettingRedisDelayQueueImpl;
|
|
|
|
@ -43,6 +45,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
import static cn.hutool.core.text.CharSequenceUtil.join;
|
|
|
|
|
import static cn.jlw.util.CacheUserUtil.getStudent;
|
|
|
|
|
import static cn.jlw.util.QuestionUtil.shuffleQuestion;
|
|
|
|
|
import static com.ibeetl.jlw.enums.GlobalPushStatusEnum.PUSH;
|
|
|
|
|
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.*;
|
|
|
|
@ -73,6 +76,8 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
|
|
|
|
|
@Autowired private TeacherOpenCourseMergeResourcesQuestionService teacherOpenCourseMergeResourcesQuestionService;
|
|
|
|
|
@Autowired private TeacherOpenCourseMergeCourseInfoService teacherOpenCourseMergeCourseInfoService;
|
|
|
|
|
@Autowired private QuestionSettingRedisDelayQueueImpl questionSettingRedisDelayQueue;
|
|
|
|
|
@Autowired
|
|
|
|
|
private QuestionLogSummaryService questionLogSummaryService;
|
|
|
|
|
|
|
|
|
|
public PageQuery<TeacherOpenCourseQuestionSetting>queryByCondition(PageQuery query){
|
|
|
|
|
PageQuery ret = teacherOpenCourseQuestionSettingDao.queryByCondition(query);
|
|
|
|
@ -904,4 +909,46 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
|
|
|
|
|
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能描述: <br>
|
|
|
|
|
* 分析汇总
|
|
|
|
|
*
|
|
|
|
|
* @param teacherOpenCourseId 开课ID
|
|
|
|
|
* @param questionSettingType 题目配置类型
|
|
|
|
|
* @Author: 87966
|
|
|
|
|
* @Date: 2022/12/21 22:40
|
|
|
|
|
*/
|
|
|
|
|
public OpenCourseQuestionSettingAnalysisAvgVO analysisTotal(Long teacherOpenCourseId, ResourcesQuestionSnapshotFromTypeEnum questionSettingType) {
|
|
|
|
|
|
|
|
|
|
TeacherOpenCourseQuestionSettingQuery settingQuery = new TeacherOpenCourseQuestionSettingQuery();
|
|
|
|
|
settingQuery.setTeacherOpenCourseQuestionSettingStatus(1);
|
|
|
|
|
settingQuery.setTeacherOpenCourseId(teacherOpenCourseId);
|
|
|
|
|
settingQuery.setTeacherOpenCourseQuestionSettingPushStatus(PUSH);
|
|
|
|
|
settingQuery.setTeacherOpenCourseQuestionSettingType(questionSettingType);
|
|
|
|
|
List<TeacherOpenCourseQuestionSetting> settingList = teacherOpenCourseQuestionSettingDao.getValuesByQueryNotWithPermission(settingQuery);
|
|
|
|
|
List<String> questionSettingIdList = CollectionUtil.emptyIfNull(settingList).stream()
|
|
|
|
|
.map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).map(Objects::toString).collect(Collectors.toList());
|
|
|
|
|
String questionSettingIds = join( ",", questionSettingIdList);
|
|
|
|
|
|
|
|
|
|
OpenCourseQuestionSettingAnalysisAvgVO analysisAvgVO = new OpenCourseQuestionSettingAnalysisAvgVO();
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(questionSettingIds)) {
|
|
|
|
|
ResourcesQuestionSnapshotQuery snapshotQuery = new ResourcesQuestionSnapshotQuery();
|
|
|
|
|
snapshotQuery.setTeacherOpenCourseQuestionSettingIdPlural(questionSettingIds);
|
|
|
|
|
snapshotQuery.setQuestionStatus(1);
|
|
|
|
|
|
|
|
|
|
long questionCount = resourcesQuestionSnapshotDao.createLambdaQuery()
|
|
|
|
|
.andIn(ResourcesQuestionSnapshot::getTeacherOpenCourseQuestionSettingId, questionSettingIdList)
|
|
|
|
|
.andEq(ResourcesQuestionSnapshot::getQuestionStatus, 1)
|
|
|
|
|
.count();
|
|
|
|
|
|
|
|
|
|
Map<String, Object> stringObjectMap = questionLogSummaryDao.analysisAvg(questionSettingIds, questionSettingType);
|
|
|
|
|
analysisAvgVO.setSettingTotalCount(questionSettingIdList.size());
|
|
|
|
|
analysisAvgVO.setQuestionTotalCount(questionCount);
|
|
|
|
|
analysisAvgVO.putAll(stringObjectMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return analysisAvgVO;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|