Accept Merge Request #97: (hyc -> master)

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

Created By: @华允传
Accepted By: @华允传
URL: https://g-iswv8783.coding.net/p/education/d/pengchen-exam-java/git/merge/97?initial=true
This commit is contained in:
华允传
2025-05-30 02:11:09 +08:00
committed by Coding
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