From ea563857e46e2057d266de93811249f836e6e3a1 Mon Sep 17 00:00:00 2001 From: dlaren Date: Thu, 28 Aug 2025 16:14:21 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=201?= =?UTF-8?q?=E3=80=81=E9=94=99=E9=A2=98=E9=9B=86=EF=BC=88=E5=BD=93=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=E7=9A=84=E9=A2=98=E6=AD=A3=E7=A1=AE=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E8=BF=9B=E8=A1=8C=E5=88=A0=E9=99=A4=E8=AF=95?= =?UTF-8?q?=E9=A2=98=EF=BC=892=E3=80=81=E6=96=B0=E5=A2=9E=E9=94=99?= =?UTF-8?q?=E9=A2=98=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exam/exam/dal/ExamErrorQuestionInfo.java | 44 +++++++++++++++++++ .../mapper/ExamErrorQuestionInfoMapper.java | 16 +++++++ .../exam/mapper/ExamErrorQuestionMapper.java | 2 + .../AutoForWinEmailSettingServiceImpl.java | 29 +++++++++--- .../AutoForWinEdgeSettingServiceImpl.java | 29 +++++++++--- .../AutoForBrowerServiceImpl.java | 23 ++++++++-- .../service/autoforc/AutoForCServiceImpl.java | 23 ++++++++-- .../AutoForChoiceServiceImpl.java | 29 ++++++++++-- .../autoforfile/AutoForFileServiceImpl.java | 23 ++++++++-- .../autoformysql/AutoForMysqlServiceImpl.java | 23 ++++++++-- .../autoforps/AutoForPsServiceImpl.java | 23 ++++++++-- .../ExamErrorQuestionInfoServiceImpl.java | 24 ++++++++++ .../error/ExamErrorQuestionServiceImpl.java | 5 +++ .../error/IExamErrorQuestionInfoService.java | 16 +++++++ .../error/IExamErrorQuestionService.java | 5 +++ .../excel/JudgementForExcelServiceImpl.java | 23 ++++++++-- .../pptx/JudgementForPptxServiceImpl.java | 23 ++++++++-- .../word/JudgementForWordServiceImpl.java | 26 ++++++++--- .../utils/error_question/ErrorQuestion.java | 17 +++++++ .../mapper/error/ExamErrorQuestionMapper.xml | 15 +++++++ 20 files changed, 369 insertions(+), 49 deletions(-) create mode 100644 src/main/java/com/example/exam/exam/dal/ExamErrorQuestionInfo.java create mode 100644 src/main/java/com/example/exam/exam/mapper/ExamErrorQuestionInfoMapper.java create mode 100644 src/main/java/com/example/exam/exam/service/error/ExamErrorQuestionInfoServiceImpl.java create mode 100644 src/main/java/com/example/exam/exam/service/error/IExamErrorQuestionInfoService.java create mode 100644 src/main/resources/mapper/error/ExamErrorQuestionMapper.xml diff --git a/src/main/java/com/example/exam/exam/dal/ExamErrorQuestionInfo.java b/src/main/java/com/example/exam/exam/dal/ExamErrorQuestionInfo.java new file mode 100644 index 0000000..5c5c221 --- /dev/null +++ b/src/main/java/com/example/exam/exam/dal/ExamErrorQuestionInfo.java @@ -0,0 +1,44 @@ +package com.example.exam.exam.dal; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 错题集 + * + * @author pengchen + */ + +@TableName(value = "exam_error_question_info", autoResultMap = true) +@Accessors(chain = true) +@Data +public class ExamErrorQuestionInfo { + + + @TableId + private String id; + /** + * 试题id + */ + private String quId; + + /** + * 任务ID + */ + private String taskId; + + private LocalDateTime createTime; + + private String creator; + /** + * 租户id + */ + private long tenantId; + +} diff --git a/src/main/java/com/example/exam/exam/mapper/ExamErrorQuestionInfoMapper.java b/src/main/java/com/example/exam/exam/mapper/ExamErrorQuestionInfoMapper.java new file mode 100644 index 0000000..631bd72 --- /dev/null +++ b/src/main/java/com/example/exam/exam/mapper/ExamErrorQuestionInfoMapper.java @@ -0,0 +1,16 @@ +package com.example.exam.exam.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.example.exam.exam.dal.ExamErrorQuestionInfo; +import org.apache.ibatis.annotations.Mapper; + +/** + * 错题集记录 Mapper接口 + * + * @author pengchen + */ +@Mapper +public interface ExamErrorQuestionInfoMapper extends BaseMapper +{ + +} diff --git a/src/main/java/com/example/exam/exam/mapper/ExamErrorQuestionMapper.java b/src/main/java/com/example/exam/exam/mapper/ExamErrorQuestionMapper.java index bd011d4..1cb1c45 100644 --- a/src/main/java/com/example/exam/exam/mapper/ExamErrorQuestionMapper.java +++ b/src/main/java/com/example/exam/exam/mapper/ExamErrorQuestionMapper.java @@ -24,4 +24,6 @@ public interface ExamErrorQuestionMapper extends BaseMapper wrapper.eq(ExamErrorQuestion::getTenantId, tenantId); return selectOne(wrapper); } + + int deleteByQuIdAndUserId(@Param("quId") String quId, @Param("userId") String userId, @Param("tenantId") String tenantId); } diff --git a/src/main/java/com/example/exam/exam/service/autoForEmailSetting/AutoForWinEmailSettingServiceImpl.java b/src/main/java/com/example/exam/exam/service/autoForEmailSetting/AutoForWinEmailSettingServiceImpl.java index b6864bb..c32a052 100644 --- a/src/main/java/com/example/exam/exam/service/autoForEmailSetting/AutoForWinEmailSettingServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/autoForEmailSetting/AutoForWinEmailSettingServiceImpl.java @@ -6,6 +6,7 @@ import com.example.exam.exam.mapper.EducationPaperMapper; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; import com.example.exam.exam.service.c.JudgementService; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.question.IExamQuestionService; import com.example.exam.exam.service.stupaperscore.StuPaperScoreService; @@ -42,6 +43,8 @@ public class AutoForWinEmailSettingServiceImpl implements AutoForWinEmailSetting EducationPaperMapper educationPaperMapper; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; /** * 自动判题邮箱 @@ -204,14 +207,26 @@ public class AutoForWinEmailSettingServiceImpl implements AutoForWinEmailSetting insertInfo.setTrueScore(new BigDecimal(quScore)); stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isTrue); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isTrue == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isTrue); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } // 关闭文件输入流 @@ -266,15 +281,19 @@ public class AutoForWinEmailSettingServiceImpl implements AutoForWinEmailSetting insertInfo.setTrueScore(new BigDecimal(quScore)); stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, 1); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, 1); if (!isInsert) { if (examErrorQuestion != null) { examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); } } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } return score.setScale(1, BigDecimal.ROUND_HALF_UP); } diff --git a/src/main/java/com/example/exam/exam/service/autoForWinEdgeSetting/AutoForWinEdgeSettingServiceImpl.java b/src/main/java/com/example/exam/exam/service/autoForWinEdgeSetting/AutoForWinEdgeSettingServiceImpl.java index 626a5b6..1a339b5 100644 --- a/src/main/java/com/example/exam/exam/service/autoForWinEdgeSetting/AutoForWinEdgeSettingServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/autoForWinEdgeSetting/AutoForWinEdgeSettingServiceImpl.java @@ -6,6 +6,7 @@ import com.example.exam.exam.mapper.EducationPaperMapper; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; import com.example.exam.exam.service.c.JudgementService; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.question.IExamQuestionService; import com.example.exam.exam.service.stupaperscore.StuPaperScoreService; @@ -41,6 +42,8 @@ public class AutoForWinEdgeSettingServiceImpl implements AutoForWinEdgeSettingSe EducationPaperMapper educationPaperMapper; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; /** * 自动判题Edge @@ -201,14 +204,26 @@ public class AutoForWinEdgeSettingServiceImpl implements AutoForWinEdgeSettingSe insertInfo.setTrueScore(new BigDecimal(quScore)); stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isTrue); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isTrue == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isTrue); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } // 关闭文件输入流 if (fileInputStream != null) { @@ -261,15 +276,19 @@ public class AutoForWinEdgeSettingServiceImpl implements AutoForWinEdgeSettingSe insertInfo.setTrueScore(new BigDecimal(quScore)); stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, 1); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, 1); if (!isInsert) { if (examErrorQuestion != null) { examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); } } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } return score.setScale(1, BigDecimal.ROUND_HALF_UP); } diff --git a/src/main/java/com/example/exam/exam/service/autoforbrower/AutoForBrowerServiceImpl.java b/src/main/java/com/example/exam/exam/service/autoforbrower/AutoForBrowerServiceImpl.java index c4a21de..67c19c6 100644 --- a/src/main/java/com/example/exam/exam/service/autoforbrower/AutoForBrowerServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/autoforbrower/AutoForBrowerServiceImpl.java @@ -5,6 +5,7 @@ import com.example.exam.exam.dal.*; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; import com.example.exam.exam.service.brower.JudgementBrowerService; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.question.IExamQuestionService; import com.example.exam.exam.service.stupaperscore.StuPaperScoreService; @@ -38,6 +39,8 @@ public class AutoForBrowerServiceImpl implements AutoForBrowerService { SystemTenantService systemTenantService; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; /** * 自动判题文件处理 @@ -104,14 +107,26 @@ public class AutoForBrowerServiceImpl implements AutoForBrowerService { stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 int isError = cpojo.getScore() == 0 ? 1 : cpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2; - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isError == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } break; } diff --git a/src/main/java/com/example/exam/exam/service/autoforc/AutoForCServiceImpl.java b/src/main/java/com/example/exam/exam/service/autoforc/AutoForCServiceImpl.java index 7d3334f..8ed4dab 100644 --- a/src/main/java/com/example/exam/exam/service/autoforc/AutoForCServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/autoforc/AutoForCServiceImpl.java @@ -5,6 +5,7 @@ import com.example.exam.exam.dal.*; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; import com.example.exam.exam.service.c.JudgementService; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.question.IExamQuestionService; import com.example.exam.exam.service.stupaperscore.StuPaperScoreService; @@ -39,6 +40,8 @@ public class AutoForCServiceImpl implements AutoForCService { SystemTenantService systemTenantService; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; /** * 自动判题C语言 @@ -109,14 +112,26 @@ public class AutoForCServiceImpl implements AutoForCService { stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 int isError = cpojo.getScore() == 0 ? 1 : cpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2; - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isError == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } break; } diff --git a/src/main/java/com/example/exam/exam/service/autoforchoice/AutoForChoiceServiceImpl.java b/src/main/java/com/example/exam/exam/service/autoforchoice/AutoForChoiceServiceImpl.java index f1c9ac4..d192d63 100644 --- a/src/main/java/com/example/exam/exam/service/autoforchoice/AutoForChoiceServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/autoforchoice/AutoForChoiceServiceImpl.java @@ -6,6 +6,7 @@ import com.example.exam.exam.mapper.EducationPaperMapper; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; import com.example.exam.exam.service.c.JudgementService; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.question.IExamQuestionService; import com.example.exam.exam.service.stupaperscore.StuPaperScoreService; @@ -42,6 +43,8 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService { EducationPaperMapper educationPaperMapper; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; /** * 自动判题选择题 @@ -160,14 +163,26 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService { stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 int isError = isRight ? 0 : 1; - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isError == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } } else { // 根据ID查询试题 @@ -211,6 +226,9 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService { examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); } } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } } if (fileInputStream != null) { @@ -271,6 +289,9 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService { examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); } } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } } return score; diff --git a/src/main/java/com/example/exam/exam/service/autoforfile/AutoForFileServiceImpl.java b/src/main/java/com/example/exam/exam/service/autoforfile/AutoForFileServiceImpl.java index 76ed638..0ecd5ef 100644 --- a/src/main/java/com/example/exam/exam/service/autoforfile/AutoForFileServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/autoforfile/AutoForFileServiceImpl.java @@ -5,6 +5,7 @@ import com.example.exam.exam.dal.*; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; import com.example.exam.exam.service.c.JudgementService; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.mysql.IMysqlLocalService; import com.example.exam.exam.service.question.IExamQuestionService; @@ -44,6 +45,8 @@ public class AutoForFileServiceImpl implements AutoForFileService { SystemTenantService systemTenantService; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; /** * 自动判题文件处理 @@ -110,14 +113,26 @@ public class AutoForFileServiceImpl implements AutoForFileService { stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 int isError = cpojo.getScore() == 0 ? 1 : cpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2; - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isError == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } break; } diff --git a/src/main/java/com/example/exam/exam/service/autoformysql/AutoForMysqlServiceImpl.java b/src/main/java/com/example/exam/exam/service/autoformysql/AutoForMysqlServiceImpl.java index 3fe7db0..fd6fc0a 100644 --- a/src/main/java/com/example/exam/exam/service/autoformysql/AutoForMysqlServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/autoformysql/AutoForMysqlServiceImpl.java @@ -5,6 +5,7 @@ import com.example.exam.exam.dal.*; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; import com.example.exam.exam.service.c.JudgementService; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.mysql.IMysqlLocalService; import com.example.exam.exam.service.question.IExamQuestionService; @@ -38,6 +39,8 @@ public class AutoForMysqlServiceImpl implements AutoForMysqlService { SystemTenantService systemTenantService; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; /** * 自动判题C语言 @@ -107,14 +110,26 @@ public class AutoForMysqlServiceImpl implements AutoForMysqlService { stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 int isError = cpojo.getScore() == 0 ? 1 : cpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2; - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isError == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } } break; diff --git a/src/main/java/com/example/exam/exam/service/autoforps/AutoForPsServiceImpl.java b/src/main/java/com/example/exam/exam/service/autoforps/AutoForPsServiceImpl.java index 89e5653..2e2818d 100644 --- a/src/main/java/com/example/exam/exam/service/autoforps/AutoForPsServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/autoforps/AutoForPsServiceImpl.java @@ -4,6 +4,7 @@ import com.example.exam.exam.controller.auto.vo.StuInfoVo; import com.example.exam.exam.dal.*; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.mysql.IMysqlLocalService; import com.example.exam.exam.service.ps.PsService; @@ -37,6 +38,8 @@ public class AutoForPsServiceImpl implements AutoForPsService { SystemTenantService systemTenantService; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; @Override public BigDecimal autoForPs(StuInfoVo stuInfoVo) throws IOException { @@ -100,14 +103,26 @@ public class AutoForPsServiceImpl implements AutoForPsService { stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 int isError = wordpojo.getScore() == 0 ? 1 : wordpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2; - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isError == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } break; } diff --git a/src/main/java/com/example/exam/exam/service/error/ExamErrorQuestionInfoServiceImpl.java b/src/main/java/com/example/exam/exam/service/error/ExamErrorQuestionInfoServiceImpl.java new file mode 100644 index 0000000..637f973 --- /dev/null +++ b/src/main/java/com/example/exam/exam/service/error/ExamErrorQuestionInfoServiceImpl.java @@ -0,0 +1,24 @@ +package com.example.exam.exam.service.error; + + +import com.example.exam.exam.dal.ExamErrorQuestionInfo; +import com.example.exam.exam.mapper.ExamErrorQuestionInfoMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; + +/** + * 错题集记录 Service业务层处理 + * + * @author pengchen + */ +@Service +public class ExamErrorQuestionInfoServiceImpl implements IExamErrorQuestionInfoService +{ + @Resource + ExamErrorQuestionInfoMapper examErrorQuestionInfoMapper; + + @Override + public void insertExamErrorQuestionInfo(ExamErrorQuestionInfo examErrorQuestionInfo) { + examErrorQuestionInfoMapper.insert(examErrorQuestionInfo); + } +} diff --git a/src/main/java/com/example/exam/exam/service/error/ExamErrorQuestionServiceImpl.java b/src/main/java/com/example/exam/exam/service/error/ExamErrorQuestionServiceImpl.java index b101158..77f442f 100644 --- a/src/main/java/com/example/exam/exam/service/error/ExamErrorQuestionServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/error/ExamErrorQuestionServiceImpl.java @@ -29,4 +29,9 @@ public class ExamErrorQuestionServiceImpl implements IExamErrorQuestionService public boolean isExamErrorQuestion(String quId, String userId, String tenantId) { return examErrorQuestionMapper.selectByIdAndUserId(quId, userId, tenantId) != null; } + + @Override + public int deleteExamErrorQuestion(String quId, String userId, String tenantId) { + return examErrorQuestionMapper.deleteByQuIdAndUserId(quId, userId, tenantId); + } } diff --git a/src/main/java/com/example/exam/exam/service/error/IExamErrorQuestionInfoService.java b/src/main/java/com/example/exam/exam/service/error/IExamErrorQuestionInfoService.java new file mode 100644 index 0000000..80dddb7 --- /dev/null +++ b/src/main/java/com/example/exam/exam/service/error/IExamErrorQuestionInfoService.java @@ -0,0 +1,16 @@ +package com.example.exam.exam.service.error; + + +import com.example.exam.exam.dal.ExamErrorQuestionInfo; + +/** + * 错题集记录 Service接口 + * + * @author pengchen + */ +public interface IExamErrorQuestionInfoService { + /** + * 新增错题集数据 + */ + void insertExamErrorQuestionInfo(ExamErrorQuestionInfo examErrorQuestionInfo); +} diff --git a/src/main/java/com/example/exam/exam/service/error/IExamErrorQuestionService.java b/src/main/java/com/example/exam/exam/service/error/IExamErrorQuestionService.java index 9f87b31..bc884de 100644 --- a/src/main/java/com/example/exam/exam/service/error/IExamErrorQuestionService.java +++ b/src/main/java/com/example/exam/exam/service/error/IExamErrorQuestionService.java @@ -18,4 +18,9 @@ public interface IExamErrorQuestionService { * 判断错题是否存在 */ boolean isExamErrorQuestion(String quId, String userId, String tenantId); + + /** + * 删除错题集数据 + */ + int deleteExamErrorQuestion(String quId, String userId, String tenantId); } diff --git a/src/main/java/com/example/exam/exam/service/wpsexcel/excel/JudgementForExcelServiceImpl.java b/src/main/java/com/example/exam/exam/service/wpsexcel/excel/JudgementForExcelServiceImpl.java index d5b8451..76cd47f 100644 --- a/src/main/java/com/example/exam/exam/service/wpsexcel/excel/JudgementForExcelServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/wpsexcel/excel/JudgementForExcelServiceImpl.java @@ -6,6 +6,7 @@ import com.example.exam.exam.dal.*; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; import com.example.exam.exam.service.c.JudgementService; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.question.IExamQuestionService; import com.example.exam.exam.service.stupaperscore.StuPaperScoreService; @@ -42,6 +43,8 @@ public class JudgementForExcelServiceImpl implements JudgementForExcelService { SystemTenantService systemTenantService; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; @Override public BigDecimal autoForWpsExcel(StuInfoVo stuInfoVo) throws Exception { @@ -103,14 +106,26 @@ public class JudgementForExcelServiceImpl implements JudgementForExcelService { stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 int isError = excelpojo.getScore() == 0 ? 1 : excelpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2; - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isError == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } break; } diff --git a/src/main/java/com/example/exam/exam/service/wpspptx/pptx/JudgementForPptxServiceImpl.java b/src/main/java/com/example/exam/exam/service/wpspptx/pptx/JudgementForPptxServiceImpl.java index 84639b2..ed49283 100644 --- a/src/main/java/com/example/exam/exam/service/wpspptx/pptx/JudgementForPptxServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/wpspptx/pptx/JudgementForPptxServiceImpl.java @@ -6,6 +6,7 @@ import com.example.exam.exam.dal.*; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; import com.example.exam.exam.service.c.JudgementService; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.question.IExamQuestionService; import com.example.exam.exam.service.stupaperscore.StuPaperScoreService; @@ -42,6 +43,8 @@ public class JudgementForPptxServiceImpl implements JudgementForPptxService { SystemTenantService systemTenantService; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; @Override public BigDecimal autoForWpsPptx(StuInfoVo stuInfoVo) throws Exception { @@ -103,14 +106,26 @@ public class JudgementForPptxServiceImpl implements JudgementForPptxService { stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 int isError = pptxpojo.getScore() == 0 ? 1 : pptxpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2; - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isError == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } break; } diff --git a/src/main/java/com/example/exam/exam/service/wpsword/word/JudgementForWordServiceImpl.java b/src/main/java/com/example/exam/exam/service/wpsword/word/JudgementForWordServiceImpl.java index b0687cb..35b102a 100644 --- a/src/main/java/com/example/exam/exam/service/wpsword/word/JudgementForWordServiceImpl.java +++ b/src/main/java/com/example/exam/exam/service/wpsword/word/JudgementForWordServiceImpl.java @@ -6,20 +6,18 @@ import com.example.exam.exam.dal.*; import com.example.exam.exam.mapper.EducationPaperQuMapper; import com.example.exam.exam.mapper.EducationPaperSchemeMapper; import com.example.exam.exam.service.c.JudgementService; +import com.example.exam.exam.service.error.IExamErrorQuestionInfoService; import com.example.exam.exam.service.error.IExamErrorQuestionService; import com.example.exam.exam.service.question.IExamQuestionService; import com.example.exam.exam.service.stupaperscore.StuPaperScoreService; import com.example.exam.exam.service.tenant.SystemTenantService; import com.example.exam.exam.service.wpsword.JudgementWpsWordService; import com.example.exam.exam.utils.error_question.ErrorQuestion; -import com.example.exam.exam.utils.snowflake.SnowflakeId; import jakarta.annotation.Resource; -import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import java.io.File; import java.math.BigDecimal; -import java.time.LocalDateTime; import java.util.List; import java.util.Optional; @@ -45,6 +43,8 @@ public class JudgementForWordServiceImpl implements JudgementForWordService { SystemTenantService systemTenantService; @Resource IExamErrorQuestionService examErrorQuestionService; + @Resource + IExamErrorQuestionInfoService examErrorQuestionInfoService; @Override public BigDecimal autoForWpsWord(StuInfoVo stuInfoVo) throws Exception { @@ -106,14 +106,26 @@ public class JudgementForWordServiceImpl implements JudgementForWordService { stuPaperScoreService.insertStuPaperScore(insertInfo); // 判断是否进入错题集 int isError = wordpojo.getScore() == 0 ? 1 : wordpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2; - ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); boolean isInsert = examErrorQuestionService.isExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); - if (!isInsert) { - if (examErrorQuestion != null) { - examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + if (isError == 0) { + // 如果做对了 + if (!isInsert) { + // 删除对应的题,但是保留记录 + examErrorQuestionService.deleteExamErrorQuestion(quId, String.valueOf(stuInfoVo.getStuId()), String.valueOf(systemTenant.getId())); } + } else { + // 如果做错了 + ExamErrorQuestion examErrorQuestion = ErrorQuestion.insertErrorQuestion(quId, examQuestion, taskId, systemTenant, stuInfoVo, isError); + if (!isInsert) { + if (examErrorQuestion != null) { + examErrorQuestionService.insertExamErrorQuestion(examErrorQuestion); + } + } + // 只要是试题错误,直接进行添加到记录表中 + ExamErrorQuestionInfo examErrorQuestionInfo = ErrorQuestion.insertErrorQuestionInfo(quId, taskId, systemTenant, stuInfoVo); + examErrorQuestionInfoService.insertExamErrorQuestionInfo(examErrorQuestionInfo); } break; } diff --git a/src/main/java/com/example/exam/exam/utils/error_question/ErrorQuestion.java b/src/main/java/com/example/exam/exam/utils/error_question/ErrorQuestion.java index fb46986..ae2376d 100644 --- a/src/main/java/com/example/exam/exam/utils/error_question/ErrorQuestion.java +++ b/src/main/java/com/example/exam/exam/utils/error_question/ErrorQuestion.java @@ -2,6 +2,7 @@ package com.example.exam.exam.utils.error_question; import com.example.exam.exam.controller.auto.vo.StuInfoVo; import com.example.exam.exam.dal.ExamErrorQuestion; +import com.example.exam.exam.dal.ExamErrorQuestionInfo; import com.example.exam.exam.dal.ExamQuestion; import com.example.exam.exam.dal.SystemTenant; import com.example.exam.exam.utils.snowflake.SnowflakeId; @@ -33,4 +34,20 @@ public class ErrorQuestion { } return null; } + + public static ExamErrorQuestionInfo insertErrorQuestionInfo(String quId, + String taskId, + SystemTenant systemTenant, + StuInfoVo stuInfoVo) { + ExamErrorQuestionInfo examErrorQuestionInfo = new ExamErrorQuestionInfo(); + SnowflakeId idWorker = new SnowflakeId(0, 31); + examErrorQuestionInfo.setId(idWorker.nextIdStr()); + examErrorQuestionInfo.setTaskId(taskId); + examErrorQuestionInfo.setQuId(quId); + examErrorQuestionInfo.setTenantId(systemTenant.getId()); + examErrorQuestionInfo.setCreator(String.valueOf(stuInfoVo.getStuId())); + examErrorQuestionInfo.setCreateTime(LocalDateTime.now()); + return examErrorQuestionInfo; + } + } diff --git a/src/main/resources/mapper/error/ExamErrorQuestionMapper.xml b/src/main/resources/mapper/error/ExamErrorQuestionMapper.xml new file mode 100644 index 0000000..1778fc9 --- /dev/null +++ b/src/main/resources/mapper/error/ExamErrorQuestionMapper.xml @@ -0,0 +1,15 @@ + + + + + + DELETE + FROM exam_error_question + WHERE qu_id = #{quId} + AND creator = #{userId} + AND tenant_id = #{tenantId} + + + \ No newline at end of file