diff --git a/src/main/java/com/project/exam/domain/service/impl/AssemblePaperDomainServiceImpl.java b/src/main/java/com/project/exam/domain/service/impl/AssemblePaperDomainServiceImpl.java index e8c1f23..46057c3 100644 --- a/src/main/java/com/project/exam/domain/service/impl/AssemblePaperDomainServiceImpl.java +++ b/src/main/java/com/project/exam/domain/service/impl/AssemblePaperDomainServiceImpl.java @@ -259,7 +259,7 @@ public class AssemblePaperDomainServiceImpl implements AssemblePaperDomainServic } - /** + /**selectedQuestionIds * 通用的普通题抽取逻辑(锁 KP 级别) */ private void pickWithLock(List seeds, QuestionTypeEnum type, @@ -301,6 +301,9 @@ public class AssemblePaperDomainServiceImpl implements AssemblePaperDomainServic if (CollUtil.isEmpty(candidateIds)){ continue; } + // todo + candidateIds.removeIf(id -> result.stream().anyMatch(r -> r.getId().equals(id))); + QuestionDTO bestQuestionDTO = questionMapper.selectBatchIds(candidateIds).stream() .max(Comparator.comparingInt(q -> { diff --git a/src/main/java/com/project/question/mapper/QuestionKpRelMapper.java b/src/main/java/com/project/question/mapper/QuestionKpRelMapper.java index f5f279e..7bfdf22 100644 --- a/src/main/java/com/project/question/mapper/QuestionKpRelMapper.java +++ b/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.project.question.domain.entity.QuestionKpRelEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Options; import org.apache.ibatis.annotations.Select; import org.springframework.data.repository.query.Param; @@ -21,6 +22,7 @@ public interface QuestionKpRelMapper extends BaseMapper { " AND q.question_type = #{type} " + " AND q.use_status = 0 " + " AND q.deleted = 0") + @Options(flushCache = Options.FlushCachePolicy.TRUE) List findAvailableIdsByKpAndType(@Param("kpId") Long kpId, @Param("type") Integer type); /**