From 1f1417ab440d40680c89c68102bc3b20443b3ba7 Mon Sep 17 00:00:00 2001 From: "YOHO\\20373" <2037305722@qq.com> Date: Fri, 30 May 2025 02:09:29 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=AD=A6?= =?UTF-8?q?=E7=94=9F=E7=AB=AF=E8=AF=95=E5=8D=B7=E4=BB=BB=E5=8A=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=20=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../paper/EducationPaperTaskServiceImpl.java | 15 +++++++++++++++ .../mapper/exam/EducationPaperMapper.xml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) 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}