|
|
|
@ -3,6 +3,7 @@ package com.ibeetl.jlw.service;
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.jlw.util.EnumUtil;
|
|
|
|
@ -16,10 +17,7 @@ import com.ibeetl.admin.core.util.PlatformException;
|
|
|
|
|
import com.ibeetl.admin.core.util.TimeTool;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonReturnCode;
|
|
|
|
|
import com.ibeetl.jlw.dao.GeneralQuestionLogDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.GeneralQuestionSettingDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.GeneralResourcesQuestionSnapshotDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.QuestionLogSummaryDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.*;
|
|
|
|
|
import com.ibeetl.jlw.entity.*;
|
|
|
|
|
import com.ibeetl.jlw.entity.dto.QuestionSettingDTO;
|
|
|
|
|
import com.ibeetl.jlw.enums.*;
|
|
|
|
@ -72,6 +70,7 @@ public class GeneralQuestionSettingService extends CoreBaseService<GeneralQuesti
|
|
|
|
|
private GeneralResourcesQuestionSnapshotService generalResourcesQuestionSnapshotService;
|
|
|
|
|
@Autowired private ResourcesQuestionService resourcesQuestionService;
|
|
|
|
|
@Autowired private GeneralQuestionSettingRedisDelayQueueImpl generalQuestionSettingRedisDelayQueue;
|
|
|
|
|
@Autowired private CourseInfoDao courseInfoDao;
|
|
|
|
|
|
|
|
|
|
public PageQuery<GeneralQuestionSetting>queryByCondition(PageQuery query){
|
|
|
|
|
PageQuery ret = generalQuestionSettingDao.queryByCondition(query);
|
|
|
|
@ -576,10 +575,30 @@ public class GeneralQuestionSettingService extends CoreBaseService<GeneralQuesti
|
|
|
|
|
// 题目类型区分
|
|
|
|
|
Collection<QuestionSettingDTO> settingDTOList = settingQuery.getQuestionSettingOptions();
|
|
|
|
|
|
|
|
|
|
// 用于指定课程中拉取题目。暂时查询中不会用到
|
|
|
|
|
final String sourceCourseInfoIds = settingQuery.getSourceCourseInfoIds();
|
|
|
|
|
|
|
|
|
|
// 批量添加课程ID
|
|
|
|
|
settingDTOList.forEach(item -> item.setCourseInfoIdPlural(sourceCourseInfoIds));
|
|
|
|
|
|
|
|
|
|
// 如果指定的题目IDs不为空的话,则需要对这些题目进行题目类型分组。
|
|
|
|
|
if(ObjectUtil.isNotEmpty(resourcesQuestionIdPlural)) {
|
|
|
|
|
|
|
|
|
|
// 指定课程
|
|
|
|
|
String joinFindCourseInfoIds = null;
|
|
|
|
|
if (StrUtil.isNotBlank(sourceCourseInfoIds)) {
|
|
|
|
|
String sourceCourseInfoIdsNew = ArrayUtil.join(sourceCourseInfoIds.split(","), "|", "_", "_");
|
|
|
|
|
List<String> findCourseInfoIds = courseInfoDao.createLambdaQuery().andLike(CourseInfo::getCourseInfoFullId, sourceCourseInfoIdsNew)
|
|
|
|
|
.andEq(CourseInfo::getCourseInfoStatus, 1)
|
|
|
|
|
.select(String.class, "course_info_id");
|
|
|
|
|
|
|
|
|
|
joinFindCourseInfoIds = ArrayUtil.join(findCourseInfoIds, ",");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ResourcesQuestionQuery questionQuery = new ResourcesQuestionQuery();
|
|
|
|
|
questionQuery.setQuestionStatus(1);
|
|
|
|
|
// 这里可能为空,就不做判断了。
|
|
|
|
|
questionQuery.setCourseInfoIds(joinFindCourseInfoIds);
|
|
|
|
|
questionQuery.setResourcesQuestionIds(resourcesQuestionIdPlural);
|
|
|
|
|
List<ResourcesQuestion> questionList = resourcesQuestionService.getValuesByQueryNotWithPermission(questionQuery);
|
|
|
|
|
|
|
|
|
@ -595,7 +614,9 @@ public class GeneralQuestionSettingService extends CoreBaseService<GeneralQuesti
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(map)) { settingDTOList = map.values(); }
|
|
|
|
|
if (ObjectUtil.isNotEmpty(map)) {
|
|
|
|
|
settingDTOList = map.values();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<GeneralResourcesQuestionSnapshot> list =
|
|
|
|
|