From 5d1188bcf23abf2f124413de50a5b92364d39a4d Mon Sep 17 00:00:00 2001 From: dlaren Date: Thu, 28 Aug 2025 17:12:18 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=20?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=AB=AF=E9=94=99=E9=A2=98=E9=9B=86=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=8A=9F=E8=83=BD=EF=BC=88=E6=9F=A5=E8=AF=A2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../error/ExamErrorQuestionController.java | 31 +++++ .../admin/error/vo/ErrorQuestionListVo.java | 115 ++++++++++++++++ .../dataobject/error/ExamErrorQuestion.java | 129 ++++++++++++++++++ .../error/ExamErrorQuestionInfo.java | 42 ++++++ .../error/ExamErrorQuestionInfoMapper.java | 17 +++ .../mysql/error/ExamErrorQuestionMapper.java | 24 ++++ .../error/ExamErrorQuestionInfoService.java | 16 +++ .../ExamErrorQuestionInfoServiceImpl.java | 17 +++ .../error/ExamErrorQuestionService.java | 16 +++ .../error/ExamErrorQuestionServiceImpl.java | 28 ++++ .../error/ExamErrorQuestionInfoMapper.xml | 14 ++ .../mapper/error/ExamErrorQuestionMapper.xml | 15 ++ .../service/auth/AdminAuthServiceImpl.java | 5 +- 13 files changed, 468 insertions(+), 1 deletion(-) create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/error/ExamErrorQuestionController.java create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/error/vo/ErrorQuestionListVo.java create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/error/ExamErrorQuestion.java create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/error/ExamErrorQuestionInfo.java create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/error/ExamErrorQuestionInfoMapper.java create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/error/ExamErrorQuestionMapper.java create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionInfoService.java create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionInfoServiceImpl.java create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionService.java create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionServiceImpl.java create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/error/ExamErrorQuestionInfoMapper.xml create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/error/ExamErrorQuestionMapper.xml diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/error/ExamErrorQuestionController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/error/ExamErrorQuestionController.java new file mode 100644 index 00000000..7b69deac --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/error/ExamErrorQuestionController.java @@ -0,0 +1,31 @@ +package pc.exam.pp.module.exam.controller.admin.error; + +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import pc.exam.pp.framework.common.pojo.CommonResult; +import pc.exam.pp.module.exam.controller.admin.error.vo.ErrorQuestionListVo; +import pc.exam.pp.module.exam.service.error.ExamErrorQuestionService; + +import java.util.List; + +/** + * 错题集Controller + * + * @author pengchen + */ +@RestController +@RequestMapping("/exam/error_question") +@Tag(name = "错题集管理接口") +@Validated +public class ExamErrorQuestionController { + + @Resource + ExamErrorQuestionService examErrorQuestionService; + + @GetMapping("/list/{id}") + public CommonResult> list(@PathVariable("id") String id){ + return CommonResult.success(examErrorQuestionService.selectByUserId(id)); + } +} diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/error/vo/ErrorQuestionListVo.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/error/vo/ErrorQuestionListVo.java new file mode 100644 index 00000000..72a46b7b --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/error/vo/ErrorQuestionListVo.java @@ -0,0 +1,115 @@ +package pc.exam.pp.module.exam.controller.admin.error.vo; + +import lombok.Data; +import pc.exam.pp.module.exam.dal.dataobject.ExamQuestionAnswer; +import pc.exam.pp.module.exam.dal.dataobject.ExamQuestionFile; +import pc.exam.pp.module.exam.dal.dataobject.ExamQuestionKeyword; +import pc.exam.pp.module.exam.dal.dataobject.ExamQuestionScore; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class ErrorQuestionListVo { + + private String id; + /** + * 试题id + */ + private String quId; + + /** + * 任务ID + */ + private String taskId; + + private String taskName; + + private String errorNumber; + + /** + * 章节名称 + */ + private String chapteridDictText; + /** + * 题型名称 + */ + private String subjectName; + + /** + * 题型难度(0:简单,1:一般,2:困难) + */ + private Integer quLevel; + + /** + * 试题内容(带样式:

下列表格123

\n\n\n\n\) + */ + private String content; + + /** + * 试题内容(纯文本) + */ + private String contentText; + + /** + * 解析(带样式) + */ + private String analysis; + + /** + * c语言参考答案 + */ + private String answer; + + + /** + * 知识点 + */ + private String pointNames; + /** + * 关键字 + */ + private String keywords; + + /** + * 课程类别 + */ + private String courseName; + + /** + * 专业分类 + */ + private String specialtyName; + /** + * 数据库名 + */ + private String tname; + + /** + * 试题答案 + */ + private List answerList; + + /** + * 试题文件 + */ + private List fileUploads; + + /** + * 试题判分 + */ + private ExamQuestionScore questionScores; + + /** + * 试题关键字 + */ + private List questionKeywords; + + private LocalDateTime createTime; + + private String creator; + /** + * 租户id + */ + private long tenantId; +} diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/error/ExamErrorQuestion.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/error/ExamErrorQuestion.java new file mode 100644 index 00000000..a03339d8 --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/error/ExamErrorQuestion.java @@ -0,0 +1,129 @@ +package pc.exam.pp.module.exam.dal.dataobject.error; + +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 pc.exam.pp.module.exam.dal.dataobject.ExamQuestionAnswer; +import pc.exam.pp.module.exam.dal.dataobject.ExamQuestionFile; +import pc.exam.pp.module.exam.dal.dataobject.ExamQuestionKeyword; +import pc.exam.pp.module.exam.dal.dataobject.ExamQuestionScore; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 错题集 + * + * @author pengchen + */ + +@TableName(value = "exam_error_question", autoResultMap = true) +@Accessors(chain = true) +@Data +public class ExamErrorQuestion { + + @TableId + private String id; + /** + * 试题id + */ + private String quId; + + /** + * 任务ID + */ + private String taskId; + + /** + * 章节名称 + */ + private String chapteridDictText; + /** + * 题型名称 + */ + private String subjectName; + + /** + * 题型难度(0:简单,1:一般,2:困难) + */ + private Integer quLevel; + + /** + * 试题内容(带样式:

下列表格123

\n
1
\n\n\n\) + */ + private String content; + + /** + * 试题内容(纯文本) + */ + private String contentText; + + /** + * 解析(带样式) + */ + private String analysis; + + /** + * c语言参考答案 + */ + private String answer; + + + /** + * 知识点 + */ + private String pointNames; + /** + * 关键字 + */ + private String keywords; + + /** + * 课程类别 + */ + private String courseName; + + /** + * 专业分类 + */ + private String specialtyName; + /** + * 数据库名 + */ + private String tname; + + /** + * 试题答案 + */ + @TableField(exist = false) + private List answerList; + + /** + * 试题文件 + */ + @TableField(exist = false) + private List fileUploads; + + /** + * 试题判分 + */ + @TableField(exist = false) + private ExamQuestionScore questionScores; + + /** + * 试题关键字 + */ + @TableField(exist = false) + private List questionKeywords; + + private LocalDateTime createTime; + + private String creator; + /** + * 租户id + */ + private long tenantId; + +} diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/error/ExamErrorQuestionInfo.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/error/ExamErrorQuestionInfo.java new file mode 100644 index 00000000..f6967438 --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/error/ExamErrorQuestionInfo.java @@ -0,0 +1,42 @@ +package pc.exam.pp.module.exam.dal.dataobject.error; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 错题集 + * + * @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/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/error/ExamErrorQuestionInfoMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/error/ExamErrorQuestionInfoMapper.java new file mode 100644 index 00000000..e3a9e526 --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/error/ExamErrorQuestionInfoMapper.java @@ -0,0 +1,17 @@ +package pc.exam.pp.module.exam.dal.mysql.error; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import pc.exam.pp.framework.mybatis.core.mapper.BaseMapperX; +import pc.exam.pp.module.exam.dal.dataobject.error.ExamErrorQuestionInfo; + +/** + * 错题集 Mapper接口 + * + * @author pengchen + */ +@Mapper +public interface ExamErrorQuestionInfoMapper extends BaseMapperX { + + String selectByQuId(@Param("quId") String quId); +} diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/error/ExamErrorQuestionMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/error/ExamErrorQuestionMapper.java new file mode 100644 index 00000000..2212782c --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/error/ExamErrorQuestionMapper.java @@ -0,0 +1,24 @@ +package pc.exam.pp.module.exam.dal.mysql.error; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import pc.exam.pp.framework.mybatis.core.mapper.BaseMapperX; +import pc.exam.pp.module.exam.controller.admin.error.vo.ErrorQuestionListVo; +import pc.exam.pp.module.exam.dal.dataobject.error.ExamErrorQuestion; + +import java.util.List; + +/** + * 错题集 Mapper接口 + * + * @author pengchen + */ +@Mapper +public interface ExamErrorQuestionMapper extends BaseMapperX { + /** + * 根据用户id查询错题集 + * @param id 用户id + * @return 错题集列表 + */ + List selectByUserId(@Param("id") String id); +} diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionInfoService.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionInfoService.java new file mode 100644 index 00000000..a96c2007 --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionInfoService.java @@ -0,0 +1,16 @@ +package pc.exam.pp.module.exam.service.error; + +import pc.exam.pp.module.exam.controller.admin.error.vo.ErrorQuestionListVo; + +import java.util.List; + +public interface ExamErrorQuestionInfoService { + + /** + * 根据用户id查询错题次数 + * @param quId 试题ID + * @return 错题列表 + */ + String selectByQuId(String quId); + +} diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionInfoServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionInfoServiceImpl.java new file mode 100644 index 00000000..7f362afb --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionInfoServiceImpl.java @@ -0,0 +1,17 @@ +package pc.exam.pp.module.exam.service.error; + +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import pc.exam.pp.module.exam.dal.mysql.error.ExamErrorQuestionInfoMapper; + +@Service +public class ExamErrorQuestionInfoServiceImpl implements ExamErrorQuestionInfoService{ + + @Resource + ExamErrorQuestionInfoMapper examErrorQuestionInfoMapper; + + @Override + public String selectByQuId(String quId) { + return examErrorQuestionInfoMapper.selectByQuId(quId); + } +} diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionService.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionService.java new file mode 100644 index 00000000..8a7b6ebc --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionService.java @@ -0,0 +1,16 @@ +package pc.exam.pp.module.exam.service.error; + +import pc.exam.pp.module.exam.controller.admin.error.vo.ErrorQuestionListVo; + +import java.util.List; + +public interface ExamErrorQuestionService { + + /** + * 根据用户id查询错题 + * @param userId 用户id + * @return 错题列表 + */ + List selectByUserId(String userId); + +} diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionServiceImpl.java new file mode 100644 index 00000000..ea26ef21 --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/error/ExamErrorQuestionServiceImpl.java @@ -0,0 +1,28 @@ +package pc.exam.pp.module.exam.service.error; + +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import pc.exam.pp.module.exam.controller.admin.error.vo.ErrorQuestionListVo; +import pc.exam.pp.module.exam.dal.mysql.error.ExamErrorQuestionInfoMapper; +import pc.exam.pp.module.exam.dal.mysql.error.ExamErrorQuestionMapper; + +import java.util.List; + +@Service +public class ExamErrorQuestionServiceImpl implements ExamErrorQuestionService{ + + @Resource + ExamErrorQuestionMapper examErrorQuestionMapper; + @Resource + ExamErrorQuestionInfoMapper examErrorQuestionInfoMapper; + + @Override + public List selectByUserId(String userId) { + List errorQuestionListVos = examErrorQuestionMapper.selectByUserId(userId); + errorQuestionListVos.forEach(item->{ + item.setErrorNumber(examErrorQuestionInfoMapper.selectByQuId(item.getQuId())); + }); + return errorQuestionListVos; + } + +} diff --git a/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/error/ExamErrorQuestionInfoMapper.xml b/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/error/ExamErrorQuestionInfoMapper.xml new file mode 100644 index 00000000..8693588c --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/error/ExamErrorQuestionInfoMapper.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/error/ExamErrorQuestionMapper.xml b/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/error/ExamErrorQuestionMapper.xml new file mode 100644 index 00000000..22c36a9f --- /dev/null +++ b/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/error/ExamErrorQuestionMapper.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/exam-module-system/exam-module-system-biz/src/main/java/pc/exam/pp/module/system/service/auth/AdminAuthServiceImpl.java b/exam-module-system/exam-module-system-biz/src/main/java/pc/exam/pp/module/system/service/auth/AdminAuthServiceImpl.java index 59acdf4c..55c5c74d 100644 --- a/exam-module-system/exam-module-system-biz/src/main/java/pc/exam/pp/module/system/service/auth/AdminAuthServiceImpl.java +++ b/exam-module-system/exam-module-system-biz/src/main/java/pc/exam/pp/module/system/service/auth/AdminAuthServiceImpl.java @@ -98,6 +98,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { } return user; } + @Override public AdminUserDO authenticateOnlyUsername(String username) { final LoginLogTypeEnum logTypeEnum = LoginLogTypeEnum.LOGIN_USERNAME; @@ -114,6 +115,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { } return user; } + @Override public AdminUserDO authenticateByNickName(String username, String nickname) { final LoginLogTypeEnum logTypeEnum = LoginLogTypeEnum.LOGIN_USERNAME; @@ -130,10 +132,11 @@ public class AdminAuthServiceImpl implements AdminAuthService { } return user; } + @Override public AuthLoginRespVO login(AuthLoginReqVO reqVO) { AdminUserDO user = new AdminUserDO(); - // 校验验证码 + // 校验验证码 validateCaptcha(reqVO); // 判断用户类型 if (reqVO.getUserType().equals("2")) {
1