Browse Source

bug修复

master
luoweijian 6 days ago
parent
commit
cae71871a9
  1. 5
      src/main/java/com/project/exam/domain/service/impl/AssemblePaperDomainServiceImpl.java
  2. 2
      src/main/java/com/project/question/mapper/QuestionKpRelMapper.java

5
src/main/java/com/project/exam/domain/service/impl/AssemblePaperDomainServiceImpl.java

@ -259,7 +259,7 @@ public class AssemblePaperDomainServiceImpl implements AssemblePaperDomainServic
} }
/** /**selectedQuestionIds
* 通用的普通题抽取逻辑 KP 级别 * 通用的普通题抽取逻辑 KP 级别
*/ */
private void pickWithLock(List<TaskKnowledgePointDTO> seeds, QuestionTypeEnum type, private void pickWithLock(List<TaskKnowledgePointDTO> seeds, QuestionTypeEnum type,
@ -301,6 +301,9 @@ public class AssemblePaperDomainServiceImpl implements AssemblePaperDomainServic
if (CollUtil.isEmpty(candidateIds)){ if (CollUtil.isEmpty(candidateIds)){
continue; continue;
} }
// todo
candidateIds.removeIf(id -> result.stream().anyMatch(r -> r.getId().equals(id)));
QuestionDTO bestQuestionDTO = questionMapper.selectBatchIds(candidateIds).stream() QuestionDTO bestQuestionDTO = questionMapper.selectBatchIds(candidateIds).stream()
.max(Comparator.comparingInt(q -> { .max(Comparator.comparingInt(q -> {

2
src/main/java/com/project/question/mapper/QuestionKpRelMapper.java

@ -3,6 +3,7 @@ package com.project.question.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.question.domain.entity.QuestionKpRelEntity; import com.project.question.domain.entity.QuestionKpRelEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
@ -21,6 +22,7 @@ public interface QuestionKpRelMapper extends BaseMapper<QuestionKpRelEntity> {
" AND q.question_type = #{type} " + " AND q.question_type = #{type} " +
" AND q.use_status = 0 " + " AND q.use_status = 0 " +
" AND q.deleted = 0") " AND q.deleted = 0")
@Options(flushCache = Options.FlushCachePolicy.TRUE)
List<Long> findAvailableIdsByKpAndType(@Param("kpId") Long kpId, @Param("type") Integer type); List<Long> findAvailableIdsByKpAndType(@Param("kpId") Long kpId, @Param("type") Integer type);
/** /**

Loading…
Cancel
Save