From 62eb499b0c969f246d3245d1429a97da4de1ce28 Mon Sep 17 00:00:00 2001
From: 钟日健 <arsn163@163.com>
Date: Mon, 01 Jun 2026 20:46:13 +0800
Subject: [PATCH] feat: 成绩查询增加年龄查询返回
---
src/main/java/org/springblade/modules/exam/controller/ExamSubjectChoicesController.java | 83 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 81 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/springblade/modules/exam/controller/ExamSubjectChoicesController.java b/src/main/java/org/springblade/modules/exam/controller/ExamSubjectChoicesController.java
index 99d9a90..bdd172f 100644
--- a/src/main/java/org/springblade/modules/exam/controller/ExamSubjectChoicesController.java
+++ b/src/main/java/org/springblade/modules/exam/controller/ExamSubjectChoicesController.java
@@ -4,16 +4,25 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
+import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.exam.entity.ExamSubjectChoices;
+import org.springblade.modules.exam.excel.ExamScoreExcel;
+import org.springblade.modules.exam.excel.ExamScoreImporter;
+import org.springblade.modules.exam.excel.ExamSubjectExcel;
+import org.springblade.modules.exam.excel.ExamSubjectImporter;
import org.springblade.modules.exam.service.ExamSubjectChoicesService;
import org.springblade.modules.exam.vo.ExamSubjectChoicesVO;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
/**
* @author zhongrj
@@ -137,6 +146,29 @@
}
/**
+ * 获取下一题的题目,并判断上一题的答案,且返回上一题答题结果
+ *
+ * @param examSubjectChoices 选择题信息对象
+ */
+ @GetMapping("/getSubjectResultInfo")
+ @ApiOperation(value = "详情", notes = "传入examSubjectChoices")
+ public R<ExamSubjectChoicesVO> getSubjectResultInfo(ExamSubjectChoicesVO examSubjectChoices) {
+ //查询下一题题目详情
+ ExamSubjectChoicesVO detail = examSubjectChoicesService.selectExamSubjectChoicesInfo(examSubjectChoices);
+ //判断当前题目的答题结果
+ if (examSubjectChoices.getPreSubJectId() != null) {
+ if (null != examSubjectChoices.getPreResult() && examSubjectChoices.getPreResult() != "" && !examSubjectChoices.getPreResult().equals("")) {
+ detail.setResult(examSubjectChoicesService.getAnswerResult(examSubjectChoices.getPreSubJectId(), examSubjectChoices.getPreResult(), examSubjectChoices.getScoreId()));
+ } else {
+ //无
+ detail.setResult(3);
+ }
+ }
+ //返回
+ return R.data(detail);
+ }
+
+ /**
* 查询试卷包含的题目
*/
@GetMapping("/getEexPaperChoices")
@@ -149,8 +181,55 @@
* 修改单项题目分值
*/
@PostMapping("/updateChoicesValue")
- public R updateChoicesValue(String id,String value) {
- return R.status(examSubjectChoicesService.updateChoicesValue(id,value));
+ public R updateChoicesValue(String id, String value) {
+ return R.status(examSubjectChoicesService.updateChoicesValue(id, value));
+ }
+
+ /**
+ * 导入题库
+ *
+ * @param isCovered 1 覆盖 0不覆盖
+ * @return
+ */
+ @PostMapping("import-examSubject")
+ @ApiOperation(value = "导入题库", notes = "传入excel")
+ public R importExamScore(MultipartFile file, Integer isCovered) {
+ ExamSubjectImporter examSubjectImporter = new ExamSubjectImporter(examSubjectChoicesService, false);
+ ExcelUtil.save(file, examSubjectImporter, ExamSubjectExcel.class);
+ return R.success("操作成功");
+ }
+
+ /**
+ * 导出模板
+ */
+ @GetMapping("export-template")
+ @ApiOperation(value = "导出模板")
+ public void exportUser(HttpServletResponse response) {
+ List<ExamSubjectExcel> list = new ArrayList<>();
+ ExcelUtil.export(response, "题库导入数据模板", "题库导入数据表", list, ExamSubjectExcel.class);
+ }
+
+
+ /**
+ * 获取下一题的题目,并判断上一题的答案,且返回上一题答题结果(app 模拟考试)
+ *
+ * @param examSubjectChoices 选择题信息对象
+ */
+ @GetMapping("/getSubjectResultInfoBySimulate")
+ public R<ExamSubjectChoicesVO> getSubjectResultInfoBySimulate(ExamSubjectChoicesVO examSubjectChoices) {
+ //查询下一题题目详情
+ ExamSubjectChoicesVO detail = examSubjectChoicesService.selectExamSubjectChoicesInfo(examSubjectChoices);
+ //判断当前题目的答题结果
+ if (examSubjectChoices.getPreSubJectId() != null) {
+ if (null != examSubjectChoices.getPreResult() && examSubjectChoices.getPreResult() != "" && !examSubjectChoices.getPreResult().equals("")) {
+ detail.setResult(examSubjectChoicesService.getAnswerResultBySimulate(examSubjectChoices.getPreSubJectId(), examSubjectChoices.getPreResult(), examSubjectChoices.getSimulateExamId()));
+ } else {
+ //无
+ detail.setResult(3);
+ }
+ }
+ //返回
+ return R.data(detail);
}
}
--
Gitblit v1.9.3