【修改】学生端试卷任务列表 次数

This commit is contained in:
YOHO\20373
2025-05-30 02:09:29 +08:00
parent e4595b7277
commit 1f1417ab44
2 changed files with 16 additions and 1 deletions

View File

@@ -498,6 +498,21 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
if ("0".equals(taskType)){
for (EducationPaperTask paperTask : list) {
String taskId = paperTask.getTaskId();
int count=0;
List<EducationPaper> educationPapers = educationPaperMapper.selectPaperListByTaskId(paperTask.getTaskId());
if (educationPapers!=null&&educationPapers.size()>0){
for (EducationPaper educationPaper : educationPapers) {
try {
count += Integer.parseInt(educationPaper.getCounts());
} catch (NumberFormatException e) {
// 可选:记录异常或忽略非法数字
System.err.println("无效的 counts 值: " + educationPaper.getCounts());
}
}
}
paperTask.setCount(String.valueOf(count));
EducationPaperParam educationPaperParam = educationPaperParamMapper.selectEducationPaperParamByTaskId(taskId);
//最高成绩

View File

@@ -119,7 +119,7 @@ select task_id from education_paper where paper_id=#{paperId}
</select>
<select id="selectPaperListByTaskId" resultMap="EducationPaperResult">
<include refid="selectEducationPaperVo"/>
where task_id =#{taskId} and deleted ='0'
where task_id =#{taskId} and deleted ='0' and status ='0'
</select>
<select id="selectCountPaperList" resultType="java.lang.Integer">
select count(*) from education_paper