|
|
@ -1,6 +1,7 @@ |
|
|
package com.project.exam.domain.job; |
|
|
package com.project.exam.domain.job; |
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
|
import com.project.base.config.ScheduledTaskProperties; |
|
|
import com.project.exam.domain.entity.ExamRecordEntity; |
|
|
import com.project.exam.domain.entity.ExamRecordEntity; |
|
|
import com.project.exam.mapper.ExamRecordMapper; |
|
|
import com.project.exam.mapper.ExamRecordMapper; |
|
|
import com.project.interaction.domain.dto.AiScoringRequestDTO; |
|
|
import com.project.interaction.domain.dto.AiScoringRequestDTO; |
|
|
@ -69,6 +70,9 @@ public class ShortAnswerScoringJob { |
|
|
@Value("${scoring.batch-size:5}") |
|
|
@Value("${scoring.batch-size:5}") |
|
|
private int batchSize; |
|
|
private int batchSize; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ScheduledTaskProperties taskProps; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public String toString() { |
|
|
public String toString() { |
|
|
return "ShortAnswerScoringJob{" + |
|
|
return "ShortAnswerScoringJob{" + |
|
|
@ -82,7 +86,9 @@ public class ShortAnswerScoringJob { |
|
|
@Scheduled(fixedRateString = "${scoring.interval-ms:60000}") |
|
|
@Scheduled(fixedRateString = "${scoring.interval-ms:60000}") |
|
|
public void processPendingScoring() { |
|
|
public void processPendingScoring() { |
|
|
log.debug(">>> [简答题评分任务] 开始扫描待评分简答题, batchSize={}", batchSize); |
|
|
log.debug(">>> [简答题评分任务] 开始扫描待评分简答题, batchSize={}", batchSize); |
|
|
|
|
|
if ("local".equalsIgnoreCase(taskProps.getOwner())) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
try { |
|
|
try { |
|
|
// 查询已提交的考试记录
|
|
|
// 查询已提交的考试记录
|
|
|
List<ExamRecordEntity> records = examRecordMapper.selectList( |
|
|
List<ExamRecordEntity> records = examRecordMapper.selectList( |
|
|
|