Browse Source

Merge remote-tracking branch 'origin/master'

master
luogw 2 days ago
parent
commit
09a29910d7
  1. 5
      src/main/java/com/project/exam/domain/service/impl/AssemblePaperDomainServiceImpl.java
  2. 2
      src/main/java/com/project/question/mapper/QuestionKpRelMapper.java
  3. 3
      src/main/java/com/project/task/domain/dto/TaskDTO.java
  4. 4
      src/main/java/com/project/task/domain/entity/TaskEntity.java
  5. 8
      src/main/java/com/project/task/domain/service/impl/SaveOrUpdateTaskDomainServiceImpl.java

5
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<TaskKnowledgePointDTO> 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 -> {

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.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<QuestionKpRelEntity> {
" AND q.question_type = #{type} " +
" AND q.use_status = 0 " +
" AND q.deleted = 0")
@Options(flushCache = Options.FlushCachePolicy.TRUE)
List<Long> findAvailableIdsByKpAndType(@Param("kpId") Long kpId, @Param("type") Integer type);
/**

3
src/main/java/com/project/task/domain/dto/TaskDTO.java

@ -31,6 +31,9 @@ public class TaskDTO extends BaseDTO {
private String note;
private List<Long> relatedDocumentList;
private Integer singleChoiceNum;
private Integer remindTimePoint;
private Double singleChoiceScore;
private Integer multipleChoiceNum;
private Double multipleChoiceScore;

4
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;

8
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("通过考试分数线不能为空");
}

Loading…
Cancel
Save