From cae71871a9da3d795a533430e9d0c63f9a688ee5 Mon Sep 17 00:00:00 2001 From: luoweijian <1329394916@qq.com> Date: Sat, 18 Apr 2026 10:01:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/service/impl/AssemblePaperDomainServiceImpl.java | 5 ++++- .../com/project/question/mapper/QuestionKpRelMapper.java | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) 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); /** From 6eda219436d5560f14df9ebdd7e42c70752c2cb1 Mon Sep 17 00:00:00 2001 From: luoweijian <1329394916@qq.com> Date: Wed, 22 Apr 2026 08:39:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/project/task/domain/dto/TaskDTO.java | 3 +++ .../java/com/project/task/domain/entity/TaskEntity.java | 4 ++++ .../service/impl/SaveOrUpdateTaskDomainServiceImpl.java | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/src/main/java/com/project/task/domain/dto/TaskDTO.java b/src/main/java/com/project/task/domain/dto/TaskDTO.java index 98c506e..6a02417 100644 --- a/src/main/java/com/project/task/domain/dto/TaskDTO.java +++ b/src/main/java/com/project/task/domain/dto/TaskDTO.java @@ -31,6 +31,9 @@ public class TaskDTO extends BaseDTO { private String note; private List relatedDocumentList; private Integer singleChoiceNum; + + private Integer remindTimePoint; + private Double singleChoiceScore; private Integer multipleChoiceNum; private Double multipleChoiceScore; diff --git a/src/main/java/com/project/task/domain/entity/TaskEntity.java b/src/main/java/com/project/task/domain/entity/TaskEntity.java index d9d06f1..20e7c90 100644 --- a/src/main/java/com/project/task/domain/entity/TaskEntity.java +++ b/src/main/java/com/project/task/domain/entity/TaskEntity.java @@ -83,6 +83,10 @@ public class TaskEntity extends BaseEntity { @Comment("考试时长") private Integer duration; + @Column(name = "remind_time_point") + @Comment("提示时间点") + private Integer remindTimePoint = 10; + @Column(name = "pass_score") @Comment("通过考试分数线") private Integer passScore; diff --git a/src/main/java/com/project/task/domain/service/impl/SaveOrUpdateTaskDomainServiceImpl.java b/src/main/java/com/project/task/domain/service/impl/SaveOrUpdateTaskDomainServiceImpl.java index f182a84..19c2d67 100644 --- a/src/main/java/com/project/task/domain/service/impl/SaveOrUpdateTaskDomainServiceImpl.java +++ b/src/main/java/com/project/task/domain/service/impl/SaveOrUpdateTaskDomainServiceImpl.java @@ -91,6 +91,8 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain dto.setSingleChoiceScore(Math.round(configTotal / dto.getSingleChoiceNum() * 100) / 100.0); } + + dto.setTotalScore((int) configTotal); // 补全冗余字段 ProductLineEntity subProductLine = productLineBaseService.getById(dto.getSubLineId()); @@ -191,6 +193,12 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain if (Objects.isNull(dto.getDuration())) { throw new BusinessErrorException("考试时长不能为空"); } + if (Objects.isNull(dto.getRemindTimePoint())) { + throw new BusinessErrorException("剩余时间提示点不能为空"); + } + if (dto.getRemindTimePoint() > dto.getDuration()) { + throw new BusinessErrorException("剩余时间提示点不能大于考试时长"); + } if (Objects.isNull(dto.getPassScore())) { throw new BusinessErrorException("通过考试分数线不能为空"); }