diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperTaskServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperTaskServiceImpl.java index b4525c9c..9758fb3a 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperTaskServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperTaskServiceImpl.java @@ -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 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); //最高成绩 diff --git a/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/exam/EducationPaperMapper.xml b/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/exam/EducationPaperMapper.xml index a60be133..f1552184 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/exam/EducationPaperMapper.xml +++ b/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/exam/EducationPaperMapper.xml @@ -119,7 +119,7 @@ select task_id from education_paper where paper_id=#{paperId}