From a789277819a15f6f9575951798fbe905044a38d3 Mon Sep 17 00:00:00 2001
From: "YOHO\\20373" <2037305722@qq.com>
Date: Mon, 5 May 2025 00:01:11 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E6=B5=8F?=
=?UTF-8?q?=E8=A7=88=E5=99=A8=E3=80=81mysql=E3=80=81=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E5=A4=B9=E5=88=A4=E5=88=86=EF=BC=8C=E7=9B=91=E6=8E=A7=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E5=90=8E=E5=8F=B0=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/jarRepositories.xml | 5 +
answerLogBrower.txt | 8 +
answerLogFile.txt | 23 +
answerLogMysql.txt | 308 +++
.../admin/getpoints/GetPointsController.java | 33 +
.../admin/monitor/MonitorController.java | 109 ++
.../admin/monitor/vo/MonitorPageReqVO.java | 51 +
.../admin/monitor/vo/MonitorRespVO.java | 58 +
.../admin/monitor/vo/MonitorSaveReqVO.java | 43 +
.../monitor/vo/StuMonitorPaperEndVo.java | 14 +
.../admin/monitor/vo/StuMonitorPaperVo.java | 18 +
.../admin/monitor/vo/StuMonitorQuVo.java | 24 +
.../EducationPaperSessionController.java | 7 +-
.../paper/vo/EducationPaperSessionVo.java | 52 +
.../exam/dal/dataobject/EducationPaper.java | 1 +
.../dal/dataobject/EducationPaperScheme.java | 6 +
.../dal/dataobject/EducationPaperSession.java | 5 +-
.../exam/dal/dataobject/ExamQuestion.java | 2 +-
.../dal/dataobject/ExamQuestionKeyword.java | 4 +
.../dal/dataobject/PaperListResponseVo.java | 44 +-
.../dal/dataobject/monitor/MonitorDO.java | 67 +
.../exam/dal/mysql/monitor/MonitorMapper.java | 34 +
.../dal/mysql/paper/EducationPaperMapper.java | 6 +-
.../paper/EducationPaperSessionMapper.java | 24 +-
.../mysql/paper/EducationPaperTaskMapper.java | 4 +
.../dal/mysql/question/SysFileMapper.java | 2 +
.../getpoints/ExamGetPointsService.java | 15 +
.../getpoints/ExamGetPointsServiceImpl.java | 62 +
.../exam/service/monitor/MonitorService.java | 59 +
.../service/monitor/MonitorServiceImpl.java | 226 +++
.../EducationPaperPersonServiceImpl.java | 85 +-
.../paper/EducationPaperQuServiceImpl.java | 12 +
.../paper/EducationPaperServiceImpl.java | 19 +-
.../EducationPaperSessionServiceImpl.java | 4 +-
.../paper/IEducationPaperSessionService.java | 4 +-
.../file/GetDifferencesBetweenFolders.java | 2 +-
.../mapper/exam/EducationPaperMapper.xml | 16 +-
.../exam/EducationPaperSchemeMapper.xml | 15 +-
.../exam/EducationPaperSessionMapper.xml | 15 +-
.../mapper/exam/EducationPaperTaskMapper.xml | 6 +
.../mapper/exam/ExamQuestionMapper.xml | 4 -
.../resources/mapper/exam/SysFileMapper.xml | 7 +
.../admin/Mysql/MysqlController.java | 7 +-
.../WindowFile/WindowsFileController.java | 12 +-
.../service/browser/BrowserServericeImpl.java | 31 +-
.../service/file/FileServericeImpl.java | 69 +-
.../service/file/IFileServerice.java | 2 +-
.../service/mysql/IMysqlServerice.java | 12 +-
.../service/mysql/MysqlServericeImpl.java | 1700 +++++++++++++++--
.../utils/Mysql/MySQLExporterUtil.java | 25 +-
.../utils/Mysql/SqlFileProcessor.java | 106 +-
.../judgement/domain/SqlExecutionResult.java | 39 +
.../system/enums/ErrorCodeConstants.java | 3 +
.../src/main/resources/application-dev.yaml | 12 +-
.../src/main/resources/application.yaml | 1 -
55 files changed, 3146 insertions(+), 376 deletions(-)
create mode 100644 answerLogBrower.txt
create mode 100644 answerLogFile.txt
create mode 100644 answerLogMysql.txt
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/getpoints/GetPointsController.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/MonitorController.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorPageReqVO.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorRespVO.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorSaveReqVO.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorPaperEndVo.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorPaperVo.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorQuVo.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/vo/EducationPaperSessionVo.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/monitor/MonitorDO.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/monitor/MonitorMapper.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/getpoints/ExamGetPointsService.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/getpoints/ExamGetPointsServiceImpl.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorService.java
create mode 100644 exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java
rename {exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller => exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam}/utils/file/GetDifferencesBetweenFolders.java (98%)
create mode 100644 exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/domain/SqlExecutionResult.java
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 2b3768d9..303b1c5d 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -41,5 +41,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/answerLogBrower.txt b/answerLogBrower.txt
new file mode 100644
index 00000000..01bc2585
--- /dev/null
+++ b/answerLogBrower.txt
@@ -0,0 +1,8 @@
+=== 学生提交内容(stu 目录) ===
+ -> 文件夹
+文件名1.html -> 大小: 397103B, 隐藏: false, 可读: true, 可写: true
+文件名2.html -> 大小: 397103B, 隐藏: false, 可读: true, 可写: true
+=== 学生提交内容得分点 ===
+考点文件名1.html -> 得分权值:1-> 是否得分:true
+考点文件名2.html -> 得分权值:1-> 是否得分:true
+考点百度一下,你就知道 -> 得分权值:1-> 是否得分:false
diff --git a/answerLogFile.txt b/answerLogFile.txt
new file mode 100644
index 00000000..996554f5
--- /dev/null
+++ b/answerLogFile.txt
@@ -0,0 +1,23 @@
+=== 学生提交内容(stu 目录) ===
+ -> 文件夹
+AHEWL -> 文件夹
+AHEWL\KMENS -> 文件夹
+AHEWL\MENS.EXE -> 大小: 17B, 隐藏: false, 可读: true, 可写: true
+BNPA -> 文件夹
+BNPA\RONGHE.COM -> 大小: 17B, 隐藏: false, 可读: true, 可写: true
+EDZK -> 文件夹
+EDZK\RONGHE.COM -> 大小: 17B, 隐藏: false, 可读: true, 可写: true
+HGACYL -> 文件夹
+HGACYL\PLAY.MEM -> 大小: 17B, 隐藏: false, 可读: true, 可写: true
+TING -> 文件夹
+TING\XYU -> 文件夹
+WUE -> 文件夹
+WUE\PB6.txt -> 大小: 17B, 隐藏: false, 可读: true, 可写: false
+XEPO -> 文件夹
+=== 学生提交内容得分点 ===
+HGACYL\RLQM.MEM -> 考察删除 -> 得分权值:1-> 是否得分:true
+TING\XYU\AUTOE.BAT -> 考察删除 -> 得分权值:1-> 是否得分:true
+AHEWL\KMENS -> 考察名称 -> 得分权值:1-> 是否得分:true
+EDZK\RONGHE.COM -> 考察名称 -> 得分权值:1-> 是否得分:true
+HGACYL\PLAY.MEM -> 考察名称 -> 得分权值:1-> 是否得分:true
+WUE\PB6.txt -> 考察名称 -> 得分权值:1-> 是否得分:true
diff --git a/answerLogMysql.txt b/answerLogMysql.txt
new file mode 100644
index 00000000..e1998dc6
--- /dev/null
+++ b/answerLogMysql.txt
@@ -0,0 +1,308 @@
+==================插入语句==================
+表名:t_team
+✅新增语句得分: 4
+==================更新语句==================
+✅修改语句得分: 3
+==================视图语句==================
+执行视图 v_education_aad91eecf6954d24a249f86bd2271b17 的查询结果:
+列名:
+themeName
+description
+teamName
+earnedScore
+未来实验室
+关闭核反应堆
+穿梭队
+325
+未来实验室
+破解AI主机的密码
+穿梭队
+225
+未来实验室
+修复电力系统
+穿梭队
+165
+古墓谜影
+打开青铜棺椁的暗锁
+探险队
+325
+古墓谜影
+破解八卦阵机关
+探险队
+210
+古墓谜影
+寻找古墓入口的玉佩
+探险队
+110
+民国悬案
+解开保险箱的摩斯密码
+侦探队
+310
+民国悬案
+调查凶案现场的日记本
+侦探队
+225
+执行视图 v_education_2_742b43462b1e45d797daa825ed1bb490 的查询结果:
+列名:
+themeName
+description
+teamName
+earnedScore
+未来实验室
+关闭核反应堆
+穿梭队
+325
+未来实验室
+破解AI主机的密码
+穿梭队
+225
+未来实验室
+修复电力系统
+穿梭队
+165
+古墓谜影
+打开青铜棺椁的暗锁
+探险队
+325
+古墓谜影
+破解八卦阵机关
+探险队
+210
+古墓谜影
+寻找古墓入口的玉佩
+探险队
+110
+民国悬案
+解开保险箱的摩斯密码
+侦探队
+310
+民国悬案
+调查凶案现场的日记本
+侦探队
+225
+
+是否结果等价: true
+✅等价视图语句得分为: 6
+==================删除语句==================
+提取出的表名: t_room
+提取出的条件: roomId = 5
+验证 SQL: SELECT COUNT(*) FROM t_room WHERE roomId = 5
+验证通过:符合 DELETE 条件的记录已删除。
+✅删除正确最终得分: 3
+==================查找语句==================
+执行考生答案的查询结果:
+列名:
+超时任务描述
+实际得分
+基础分
+破解AI主机的密码
+225
+250
+关闭核反应堆
+325
+350
+指认真凶
+0
+400
+执行正确答案的查询结果:
+列名:
+实际得分
+超时任务描述
+基础分
+225
+破解AI主机的密码
+250
+325
+关闭核反应堆
+350
+0
+指认真凶
+400
+
+是否结果等价: true
+✅当前查询SQL得分为:3
+执行考生答案的查询结果:
+列名:
+任务描述
+队伍名称
+指认真凶
+侦探队
+执行正确答案的查询结果:
+列名:
+任务描述
+队伍名称
+指认真凶
+侦探队
+
+是否结果等价: true
+✅当前查询SQL得分为:3
+==================触发器语句==================
+考生答案与标准答案语句内容一致(忽略格式)
+✅触发器得分点8
+==================储存过程==================
+测试语句:CALL pro_getMaxScore('古墓');
+测试语句:CALL pro_getMaxScore('古墓');
+执行 SQL 语句时发生错误: PROCEDURE pro_getMaxScore already exists
+==== 标准答案 ====
+{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645}
+{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645}
+==== 考生答案 ====
+{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645}
+{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645}
+两个结果集内容一致(不考虑顺序)!
+考生答案与标准答案语句结果为:true
+✅存储过程得分9
+==================插入语句==================
+表名:t_team
+✅新增语句得分: 4
+==================更新语句==================
+✅修改语句得分: 3
+==================视图语句==================
+执行视图 v_education_61a0be43eafd4ddeb267eab989db482d 的查询结果:
+列名:
+themeName
+description
+teamName
+earnedScore
+未来实验室
+关闭核反应堆
+穿梭队
+325
+未来实验室
+破解AI主机的密码
+穿梭队
+225
+未来实验室
+修复电力系统
+穿梭队
+165
+古墓谜影
+打开青铜棺椁的暗锁
+探险队
+325
+古墓谜影
+破解八卦阵机关
+探险队
+210
+古墓谜影
+寻找古墓入口的玉佩
+探险队
+110
+民国悬案
+解开保险箱的摩斯密码
+侦探队
+310
+民国悬案
+调查凶案现场的日记本
+侦探队
+225
+执行视图 v_education_2_13a7c1a8c1d540a4ab247934fbd5b46d 的查询结果:
+列名:
+themeName
+description
+teamName
+earnedScore
+未来实验室
+关闭核反应堆
+穿梭队
+325
+未来实验室
+破解AI主机的密码
+穿梭队
+225
+未来实验室
+修复电力系统
+穿梭队
+165
+古墓谜影
+打开青铜棺椁的暗锁
+探险队
+325
+古墓谜影
+破解八卦阵机关
+探险队
+210
+古墓谜影
+寻找古墓入口的玉佩
+探险队
+110
+民国悬案
+解开保险箱的摩斯密码
+侦探队
+310
+民国悬案
+调查凶案现场的日记本
+侦探队
+225
+
+是否结果等价: true
+✅等价视图语句得分为: 6
+==================删除语句==================
+提取出的表名: t_room
+提取出的条件: roomId = 5
+验证 SQL: SELECT COUNT(*) FROM t_room WHERE roomId = 5
+验证通过:符合 DELETE 条件的记录已删除。
+✅删除正确最终得分: 3
+==================查找语句==================
+执行考生答案的查询结果:
+列名:
+超时任务描述
+实际得分
+基础分
+破解AI主机的密码
+225
+250
+关闭核反应堆
+325
+350
+指认真凶
+0
+400
+执行正确答案的查询结果:
+列名:
+实际得分
+超时任务描述
+基础分
+225
+破解AI主机的密码
+250
+325
+关闭核反应堆
+350
+0
+指认真凶
+400
+
+是否结果等价: true
+✅当前查询SQL得分为:3
+执行考生答案的查询结果:
+列名:
+任务描述
+队伍名称
+指认真凶
+侦探队
+执行正确答案的查询结果:
+列名:
+任务描述
+队伍名称
+指认真凶
+侦探队
+
+是否结果等价: true
+✅当前查询SQL得分为:3
+==================触发器语句==================
+考生答案与标准答案语句内容一致(忽略格式)
+✅触发器得分点8
+==================储存过程==================
+测试语句:CALL pro_getMaxScore('古墓');
+测试语句:CALL pro_getMaxScore('古墓');
+执行 SQL 语句时发生错误: PROCEDURE pro_getMaxScore already exists
+==== 标准答案 ====
+{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645}
+{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645}
+==== 考生答案 ====
+{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645}
+{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645}
+两个结果集内容一致(不考虑顺序)!
+考生答案与标准答案语句结果为:true
+✅存储过程得分9
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/getpoints/GetPointsController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/getpoints/GetPointsController.java
new file mode 100644
index 00000000..2a1b3624
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/getpoints/GetPointsController.java
@@ -0,0 +1,33 @@
+package pc.exam.pp.module.exam.controller.admin.getpoints;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import pc.exam.pp.framework.common.pojo.CommonResult;
+import pc.exam.pp.module.exam.service.getpoints.ExamGetPointsService;
+
+import java.io.IOException;
+
+@RestController
+@RequestMapping("/exam/getopints")
+public class GetPointsController {
+
+ @Autowired
+ private ExamGetPointsService examGetPointsService;
+
+ /**
+ * 得出文件操作考点
+ * @return 得分
+ */
+ @PostMapping("/get_filePoint")
+ //todo 后期需要素材文件和答案文件的 父目录 如:D:/exam/3/shucai,D:/exam/3/win
+ public CommonResult get_file_point() throws IOException {
+ return CommonResult.success(examGetPointsService.get_file_point());
+ }
+ @PostMapping("/get_mysql_point")
+ //todo 后期需要素材文件和答案文件的 父目录 如:D:/exam/3/shucai,D:/exam/3/win
+ public CommonResult get_mysql_point() throws IOException {
+ return CommonResult.success(examGetPointsService.get_mysql_point());
+ }
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/MonitorController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/MonitorController.java
new file mode 100644
index 00000000..13355d26
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/MonitorController.java
@@ -0,0 +1,109 @@
+package pc.exam.pp.module.exam.controller.admin.monitor;
+import org.springframework.web.bind.annotation.*;
+import jakarta.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import jakarta.validation.*;
+import jakarta.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import pc.exam.pp.framework.common.pojo.PageParam;
+import pc.exam.pp.framework.common.pojo.PageResult;
+import pc.exam.pp.framework.common.pojo.CommonResult;
+import pc.exam.pp.framework.common.util.object.BeanUtils;
+
+import static pc.exam.pp.framework.common.pojo.CommonResult.error;
+import static pc.exam.pp.framework.common.pojo.CommonResult.success;
+
+import pc.exam.pp.framework.excel.core.util.ExcelUtils;
+
+import pc.exam.pp.framework.apilog.core.annotation.ApiAccessLog;
+import static pc.exam.pp.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import pc.exam.pp.module.exam.controller.admin.monitor.vo.*;
+import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
+import pc.exam.pp.module.exam.service.monitor.MonitorService;
+
+
+@Tag(name = "管理后台 - 监控管理")
+@RestController
+@RequestMapping("/exam/monitor")
+@Validated
+public class MonitorController {
+@Resource
+private MonitorService monitorService;
+
+@PostMapping("/create")
+@Operation(summary = "创建监控管理")
+public CommonResult createMonitor(@Valid @RequestBody MonitorSaveReqVO createReqVO) {
+ return success(monitorService.createMonitor(createReqVO));
+}
+
+@PutMapping("/update")
+@Operation(summary = "更新监控管理")
+public CommonResult updateMonitor(@Valid @RequestBody MonitorSaveReqVO updateReqVO) {
+ monitorService.updateMonitor(updateReqVO);
+ return success(true);
+}
+
+@DeleteMapping("/delete")
+@Operation(summary = "删除监控管理")
+@Parameter(name = "id", description = "编号", required = true)
+public CommonResult deleteMonitor(@RequestParam("id") String id) {
+ monitorService.deleteMonitor(id);
+ return success(true);
+}
+
+@GetMapping("/get")
+@Operation(summary = "获得监控管理")
+@Parameter(name = "id", description = "编号", required = true, example = "1024")
+public CommonResult getMonitor(@RequestParam("id") String id) {
+ MonitorDO monitor = monitorService.getMonitor(id);
+ return success(BeanUtils.toBean(monitor, MonitorRespVO.class));
+}
+
+@GetMapping("/page")
+@Operation(summary = "获得监控管理分页")
+public CommonResult> getMonitorPage(@Valid MonitorPageReqVO pageReqVO) {
+ PageResult pageResult = monitorService.getMonitorPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, MonitorRespVO.class));
+}
+
+@GetMapping("/export-excel")
+@Operation(summary = "导出监控管理 Excel")
+@ApiAccessLog(operateType = EXPORT)
+public void exportMonitorExcel(@Valid MonitorPageReqVO pageReqVO, HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = monitorService.getMonitorPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "监控管理.xls", "数据", MonitorRespVO.class,
+ BeanUtils.toBean(list, MonitorRespVO.class));
+}
+
+ @PostMapping("/stuMonitor")
+ @Operation(summary = "学生端进入考试返回值")
+ public CommonResult getStuMonitor(@Valid @RequestBody StuMonitorPaperVo stuMonitorPaperVo) {
+ Boolean stuMonitor = monitorService.getStuMonitor(stuMonitorPaperVo);
+ if (stuMonitor)
+ {
+ return success("进入考试成功");
+ }
+ return error(100_200_300,"不在考试时间范围内!");
+
+ }
+ @PostMapping("/stuMonitorQu")
+ @Operation(summary = "学生端考试过程传试题")
+ public void updateStuMonitor(@Valid @RequestBody StuMonitorQuVo stuMonitorQuVo) {
+ monitorService.updateStuMonitor(stuMonitorQuVo);
+ }
+ @PostMapping("/endMonitor")
+ @Operation(summary = "学生端结束考试返回值")
+ public void endStuMonitor(@Valid @RequestBody StuMonitorPaperEndVo stuMonitorPaperEndVo) {
+ monitorService.endStuMonitor(stuMonitorPaperEndVo);
+ }
+
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorPageReqVO.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorPageReqVO.java
new file mode 100644
index 00000000..00bed8a8
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorPageReqVO.java
@@ -0,0 +1,51 @@
+package pc.exam.pp.module.exam.controller.admin.monitor.vo;
+
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import pc.exam.pp.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static pc.exam.pp.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 监控管理分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class MonitorPageReqVO extends PageParam {
+
+@Schema(description = "用户账号", example = "芋艿")
+private String username;
+
+@Schema(description = "用户姓名", example = "赵六")
+private String nickname;
+
+@Schema(description = "班级", example = "芋艿")
+private String className;
+
+@Schema(description = "考试状态", example = "2")
+private String examStatus;
+
+@Schema(description = "成绩")
+private String score;
+
+@Schema(description = "试卷编号")
+private String paperNum;
+
+@Schema(description = "场次", example = "赵六")
+private String taskName;
+
+@Schema(description = "机器ip")
+private String ip;
+
+@Schema(description = "剩余时间")
+@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+private LocalDateTime[] remainingTime;
+
+@Schema(description = "创建时间")
+@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorRespVO.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorRespVO.java
new file mode 100644
index 00000000..8ddf894c
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorRespVO.java
@@ -0,0 +1,58 @@
+package pc.exam.pp.module.exam.controller.admin.monitor.vo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 监控管理 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class MonitorRespVO {
+
+@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19828")
+@ExcelProperty("主键id")
+private String monitorId;
+
+@Schema(description = "用户账号", example = "芋艿")
+@ExcelProperty("用户账号")
+private String username;
+
+@Schema(description = "用户姓名", example = "赵六")
+@ExcelProperty("用户姓名")
+private String nickname;
+
+@Schema(description = "班级", example = "芋艿")
+@ExcelProperty("班级")
+private String className;
+
+@Schema(description = "考试状态", example = "2")
+@ExcelProperty("考试状态")
+private String examStatus;
+
+@Schema(description = "成绩")
+@ExcelProperty("成绩")
+private String score;
+
+@Schema(description = "试卷编号")
+@ExcelProperty("试卷编号")
+private String paperNum;
+
+@Schema(description = "场次", example = "赵六")
+@ExcelProperty("场次")
+private String taskName;
+
+@Schema(description = "机器ip")
+@ExcelProperty("机器ip")
+private String ip;
+
+@Schema(description = "剩余时间")
+@ExcelProperty("剩余时间")
+private LocalDateTime remainingTime;
+
+@Schema(description = "创建时间")
+@ExcelProperty("创建时间")
+private LocalDateTime createTime;
+
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorSaveReqVO.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorSaveReqVO.java
new file mode 100644
index 00000000..94174839
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/MonitorSaveReqVO.java
@@ -0,0 +1,43 @@
+package pc.exam.pp.module.exam.controller.admin.monitor.vo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import jakarta.validation.constraints.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 监控管理新增/修改 Request VO")
+@Data
+public class MonitorSaveReqVO {
+
+@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19828")
+private String monitorId;
+
+@Schema(description = "用户账号", example = "芋艿")
+private String username;
+
+@Schema(description = "用户姓名", example = "赵六")
+private String nickname;
+
+@Schema(description = "班级", example = "芋艿")
+private String className;
+
+@Schema(description = "考试状态", example = "2")
+private String examStatus;
+
+@Schema(description = "成绩")
+private String score;
+
+@Schema(description = "试卷编号")
+private String paperNum;
+
+@Schema(description = "场次", example = "赵六")
+private String taskName;
+
+@Schema(description = "机器ip")
+private String ip;
+
+@Schema(description = "剩余时间")
+private LocalDateTime remainingTime;
+
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorPaperEndVo.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorPaperEndVo.java
new file mode 100644
index 00000000..3e03609f
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorPaperEndVo.java
@@ -0,0 +1,14 @@
+package pc.exam.pp.module.exam.controller.admin.monitor.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 监控管理 学生结束考试 Request VO")
+@Data
+public class StuMonitorPaperEndVo {
+ private String stuId;
+
+ private String score;
+ private String taskId;
+
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorPaperVo.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorPaperVo.java
new file mode 100644
index 00000000..c7307f7a
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorPaperVo.java
@@ -0,0 +1,18 @@
+package pc.exam.pp.module.exam.controller.admin.monitor.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 监控管理 学生进入考试 Request VO")
+@Data
+public class StuMonitorPaperVo {
+
+ private String stuId;
+
+ private String paperId;
+
+ private String ip;
+
+ private String taskId;
+
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorQuVo.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorQuVo.java
new file mode 100644
index 00000000..5bbc692f
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/monitor/vo/StuMonitorQuVo.java
@@ -0,0 +1,24 @@
+package pc.exam.pp.module.exam.controller.admin.monitor.vo;
+
+import jdk.dynalink.linker.LinkerServices;
+import lombok.Data;
+import pc.exam.pp.module.exam.dal.dataobject.EducationPaperScheme;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+@Data
+public class StuMonitorQuVo {
+ private String stuId;
+ private String paperId;
+ private String taskId;
+ private List paperSchemeMaps; // 使用自定义类
+
+ private String score;
+ @Data
+ public static class EducationPaperSchemeMap {
+ private EducationPaperScheme educationPaperScheme;
+ private Map questionResultMap;
+
+ }
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperSessionController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperSessionController.java
index bfe77ba4..1fe2f769 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperSessionController.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperSessionController.java
@@ -5,9 +5,12 @@ import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pc.exam.pp.framework.common.pojo.CommonResult;
+import pc.exam.pp.framework.common.pojo.PageResult;
import pc.exam.pp.module.exam.controller.admin.paper.dto.SessionParamDto;
import pc.exam.pp.module.exam.controller.admin.paper.dto.StatusDto;
+import pc.exam.pp.module.exam.controller.admin.paper.vo.EducationPaperSessionVo;
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperSession;
+import pc.exam.pp.module.exam.dal.dataobject.EducationPaperTask;
import pc.exam.pp.module.exam.service.paper.IEducationPaperSessionService;
import java.util.Date;
@@ -32,9 +35,9 @@ public class EducationPaperSessionController
* 查询试卷场次列表
*/
@GetMapping("/list")
- public CommonResult list(EducationPaperSession educationPaperSession)
+ public CommonResult> list(EducationPaperSessionVo educationPaperSessionVo)
{
- List list = educationPaperSessionService.selectEducationPaperSessionList(educationPaperSession);
+ PageResult list = educationPaperSessionService.selectEducationPaperSessionList(educationPaperSessionVo);
return CommonResult.success(list);
}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/vo/EducationPaperSessionVo.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/vo/EducationPaperSessionVo.java
new file mode 100644
index 00000000..f9772215
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/vo/EducationPaperSessionVo.java
@@ -0,0 +1,52 @@
+package pc.exam.pp.module.exam.controller.admin.paper.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import pc.exam.pp.framework.common.pojo.PageParam;
+
+import java.util.Date;
+@Schema(description = "试卷场次vo")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class EducationPaperSessionVo extends PageParam {
+ /** 主键ID */
+ private String sessionId;
+
+ /** 试卷任务ID */
+ // @Excel(name = "试卷任务ID")
+ private String taskId;
+
+ /** 批次 */
+ // @Excel(name = "批次")
+ private String batch;
+
+ /** 考试开始时间 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ // @Excel(name = "考试开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+ private Date startTime;
+
+ /** 考试结束时间 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ //@Excel(name = "考试结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+ private Date endTime;
+
+ /** 开始考试前分钟,允许入场 */
+ // @Excel(name = "开始考试前分钟,允许入场")
+ private String allowEntry;
+
+ /** 开始考试后分钟,禁止入场 */
+ // @Excel(name = "开始考试后分钟,禁止入场")
+ private String endAllowEntry;
+
+ /** 开始考试后分钟,允许交卷 */
+ // @Excel(name = "开始考试后分钟,允许交卷")
+ private String allowSubmission;
+
+ /** 0启用1不启 */
+ // @Excel(name = "0启用1不启")
+ private String status;
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaper.java
index 3055486a..e92309c6 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaper.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaper.java
@@ -31,6 +31,7 @@ public class EducationPaper extends TenantBaseDO
// @Excel(name = "试卷任务ID")
private String taskId;
+ private String num;
/** 使用次数 */
// @Excel(name = "使用次数")
private String counts;
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaperScheme.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaperScheme.java
index 7ec2e349..2a13f6ee 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaperScheme.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaperScheme.java
@@ -1,6 +1,7 @@
package pc.exam.pp.module.exam.dal.dataobject;
+import com.alibaba.druid.sql.ast.statement.SQLTruncateStatement;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -32,6 +33,9 @@ public class EducationPaperScheme
// @Excel(name = "方案ID")
private String taskId;
+ //题型标题别名
+ private String quTitle;
+
/** 题型 */
// @Excel(name = "题型")
private String spName;
@@ -56,6 +60,8 @@ public class EducationPaperScheme
// @Excel(name = "每题分数")
private String quScores;
+ private String sort;
+
@TableField(exist = false)
private List keyword;
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaperSession.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaperSession.java
index 13d1d284..2d3c677c 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaperSession.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/EducationPaperSession.java
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.experimental.Accessors;
+import org.joda.time.DateTime;
import java.util.Date;
@@ -34,12 +35,12 @@ public class EducationPaperSession
private String batch;
/** 考试开始时间 */
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
// @Excel(name = "考试开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/** 考试结束时间 */
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
//@Excel(name = "考试结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/ExamQuestion.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/ExamQuestion.java
index 7ffee621..ec7d144a 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/ExamQuestion.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/ExamQuestion.java
@@ -31,7 +31,7 @@ public class ExamQuestion extends TenantBaseDO {
/** 题库id */
// @Excel(name = "题库id")
- private String quBankId;
+ private String quBankId;
/** 题库名称 */
// @Excel(name = "题库名称")
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/ExamQuestionKeyword.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/ExamQuestionKeyword.java
index 64661e1f..c73c7996 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/ExamQuestionKeyword.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/ExamQuestionKeyword.java
@@ -3,8 +3,10 @@ package pc.exam.pp.module.exam.dal.dataobject;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import pc.exam.pp.framework.mybatis.core.dataobject.BaseDO;
@@ -18,6 +20,8 @@ import pc.exam.pp.framework.mybatis.core.dataobject.BaseDO;
@TableName(value = "exam_question_keyword", autoResultMap = true)
@Data
@Accessors(chain = true)
+@NoArgsConstructor
+@AllArgsConstructor
public class ExamQuestionKeyword
{
private static final long serialVersionUID = 1L;
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/PaperListResponseVo.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/PaperListResponseVo.java
index d1f517dd..dcae7767 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/PaperListResponseVo.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/PaperListResponseVo.java
@@ -1,42 +1,16 @@
package pc.exam.pp.module.exam.dal.dataobject;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
import java.util.List;
+import java.util.Map;
import java.util.Set;
-
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
public class PaperListResponseVo {
- private List paperId; // 试卷列表
+ private Map paperId; // 试卷ID和名称键值对
private Set selectedIds; // 已选试卷 ID 列表
-
- public PaperListResponseVo() {
- }
-
- public PaperListResponseVo(List paperId, Set selectedIds) {
- this.paperId = paperId;
- this.selectedIds = selectedIds;
- }
-
- public List getPaperId() {
- return paperId;
- }
-
- public void setPaperId(List paperId) {
- this.paperId = paperId;
- }
-
- public Set getSelectedIds() {
- return selectedIds;
- }
-
- public void setSelectedIds(Set selectedIds) {
- this.selectedIds = selectedIds;
- }
-
-
- @Override
- public String toString() {
- return "PaperListResponseVo{" +
- "paperId=" + paperId +
- ", selectedIds=" + selectedIds +
- '}';
- }
}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/monitor/MonitorDO.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/monitor/MonitorDO.java
new file mode 100644
index 00000000..fc7d75e0
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/dataobject/monitor/MonitorDO.java
@@ -0,0 +1,67 @@
+package pc.exam.pp.module.exam.dal.dataobject.monitor;
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import pc.exam.pp.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 监控管理 DO
+ *
+ * @author 管理员
+ */
+@TableName("exam_monitor")
+@KeySequence("exam_monitor_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class MonitorDO extends BaseDO {
+
+/**
+ * 主键id
+ */
+@TableId(type = IdType.INPUT)
+private String monitorId;
+/**
+ * 用户账号
+ */
+private String username;
+/**
+ * 用户姓名
+ */
+private String nickname;
+/**
+ * 班级
+ */
+private String className;
+/**
+ * 考试状态
+ */
+private String examStatus;
+/**
+ * 成绩
+ */
+private String score;
+/**
+ * 试卷编号
+ */
+private String paperNum;
+/**
+ * 场次
+ */
+private String taskName;
+/**
+ * 机器ip
+ */
+private String ip;
+/**
+ * 剩余时间
+ */
+private Long remainingTime;
+
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/monitor/MonitorMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/monitor/MonitorMapper.java
new file mode 100644
index 00000000..ec55c659
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/monitor/MonitorMapper.java
@@ -0,0 +1,34 @@
+package pc.exam.pp.module.exam.dal.mysql.monitor;
+
+
+import pc.exam.pp.framework.common.pojo.PageResult;
+import pc.exam.pp.framework.mybatis.core.query.LambdaQueryWrapperX;
+import pc.exam.pp.framework.mybatis.core.mapper.BaseMapperX;
+import org.apache.ibatis.annotations.Mapper;
+import pc.exam.pp.module.exam.controller.admin.monitor.vo.MonitorPageReqVO;
+import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
+
+/**
+ * 监控管理 Mapper
+ *
+ * @author 管理员
+ */
+ @Mapper
+ public interface MonitorMapper extends BaseMapperX {
+
+ default PageResult selectPage(MonitorPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .likeIfPresent(MonitorDO::getUsername, reqVO.getUsername())
+ .likeIfPresent(MonitorDO::getNickname, reqVO.getNickname())
+ .likeIfPresent(MonitorDO::getClassName, reqVO.getClassName())
+ .eqIfPresent(MonitorDO::getExamStatus, reqVO.getExamStatus())
+ .eqIfPresent(MonitorDO::getScore, reqVO.getScore())
+ .eqIfPresent(MonitorDO::getPaperNum, reqVO.getPaperNum())
+ .likeIfPresent(MonitorDO::getTaskName, reqVO.getTaskName())
+ .eqIfPresent(MonitorDO::getIp, reqVO.getIp())
+ .betweenIfPresent(MonitorDO::getRemainingTime, reqVO.getRemainingTime())
+ .betweenIfPresent(MonitorDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(MonitorDO::getCreateTime));
+ }
+
+ }
\ No newline at end of file
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperMapper.java
index 8a461649..33a9855f 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperMapper.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperMapper.java
@@ -105,7 +105,7 @@ public interface EducationPaperMapper extends BaseMapperX
List selectPaperByTaskIdAndRoll(@Param("taskId")String taskId);
- List getPaperByTaskIdByType(String taskId);
+ List getPaperByTaskIdByType(String taskId);
String getSelectPaperIdBySchemeIds(String row);
@@ -117,5 +117,9 @@ public interface EducationPaperMapper extends BaseMapperX
int changeStatus(@Param("paperId") String paperId
,@Param("status") String status);
+
+ int selectCountPaperList();
+
+
}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSessionMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSessionMapper.java
index 8a3b9e88..917cd178 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSessionMapper.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSessionMapper.java
@@ -4,7 +4,13 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+import pc.exam.pp.framework.common.pojo.PageResult;
+import pc.exam.pp.framework.mybatis.core.mapper.BaseMapperX;
+import pc.exam.pp.framework.mybatis.core.query.LambdaQueryWrapperX;
+import pc.exam.pp.module.exam.controller.admin.paper.vo.EducationPaperSessionVo;
+import pc.exam.pp.module.exam.controller.admin.paper.vo.PaperTaskPageVo;
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperSession;
+import pc.exam.pp.module.exam.dal.dataobject.EducationPaperTask;
/**
* 试卷场次Mapper接口
@@ -13,7 +19,7 @@ import pc.exam.pp.module.exam.dal.dataobject.EducationPaperSession;
* @date 2025-04-17
*/
@Mapper
-public interface EducationPaperSessionMapper
+public interface EducationPaperSessionMapper extends BaseMapperX
{
/**
* 查询试卷场次
@@ -29,7 +35,7 @@ public interface EducationPaperSessionMapper
* @param educationPaperSession 试卷场次
* @return 试卷场次集合
*/
- public List selectEducationPaperSessionList(EducationPaperSession educationPaperSession);
+
/**
* 新增试卷场次
@@ -70,4 +76,18 @@ public interface EducationPaperSessionMapper
int changeStatus(@Param("sessionId") String sessionId
,@Param("status") String status);
+
+ default PageResult selectEducationPaperSessionList(EducationPaperSessionVo pageReqVO) {
+ return selectPage(pageReqVO, new LambdaQueryWrapperX()
+ .likeIfPresent(EducationPaperSession::getStatus , pageReqVO.getStatus())
+ .likeIfPresent(EducationPaperSession::getBatch , pageReqVO.getBatch())
+ .likeIfPresent(EducationPaperSession::getEndAllowEntry , pageReqVO.getEndAllowEntry())
+ .likeIfPresent(EducationPaperSession::getTaskId , pageReqVO.getTaskId())
+ .likeIfPresent(EducationPaperSession::getAllowSubmission , pageReqVO.getAllowSubmission())
+ .likeIfPresent(EducationPaperSession::getAllowEntry , pageReqVO.getAllowEntry())
+
+
+ );
+ }
+
}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperTaskMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperTaskMapper.java
index fcfbc812..c7f87f2e 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperTaskMapper.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperTaskMapper.java
@@ -105,4 +105,8 @@ public interface EducationPaperTaskMapper extends BaseMapperX selectSysFileByQuid(String quId);
+ List selectSysFileByQuidIN(String quId);
+
}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/getpoints/ExamGetPointsService.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/getpoints/ExamGetPointsService.java
new file mode 100644
index 00000000..6a1f300c
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/getpoints/ExamGetPointsService.java
@@ -0,0 +1,15 @@
+package pc.exam.pp.module.exam.service.getpoints;
+
+import pc.exam.pp.module.exam.dal.dataobject.ExamQuestionAnswer;
+
+import java.io.IOException;
+import java.util.List;
+
+public interface ExamGetPointsService {
+
+
+
+ List get_file_point() throws IOException;
+
+ List get_mysql_point();
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/getpoints/ExamGetPointsServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/getpoints/ExamGetPointsServiceImpl.java
new file mode 100644
index 00000000..2465682a
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/getpoints/ExamGetPointsServiceImpl.java
@@ -0,0 +1,62 @@
+package pc.exam.pp.module.exam.service.getpoints;
+
+import org.springframework.stereotype.Service;
+import pc.exam.pp.module.exam.dal.dataobject.ExamQuestionAnswer;
+import pc.exam.pp.module.exam.utils.file.GetDifferencesBetweenFolders;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+@Service
+public class ExamGetPointsServiceImpl implements ExamGetPointsService{
+
+ static final String BASE_DIR = "D:/exam/3/";
+ @Override
+ public List get_file_point() throws IOException {
+ List answerList = new ArrayList<>();
+ AtomicInteger sortCounter = new AtomicInteger(1); // 计数器
+ String path1 = BASE_DIR + "shucai";
+ String path2 = BASE_DIR + "win";
+
+ // 获取 shucai 和 win 文件夹的差异
+ Map differences = GetDifferencesBetweenFolders.getDifferencesBetweenFolders(path1, path2);
+
+ List formattedDifferences = differences.entrySet().stream()
+ .map(entry -> {
+ String key = entry.getKey();
+ String value = entry.getValue();
+ ExamQuestionAnswer answer = new ExamQuestionAnswer();
+ answer.setContent(key); // 设置文件路径
+ answer.setScoreRate("1");
+ //这里设置answer的排序,按照循环次数来
+ answer.setSort(String.valueOf(sortCounter.getAndIncrement())); // 按顺序设置排序值
+ if (value.startsWith("仅存在于 "+path1)) {
+ answer.setContentIn("考察删除");
+ } else if (value.startsWith("仅存在于 "+path2)) {
+ answer.setContentIn("考察名称");
+ } else if (value.startsWith("属性不同")) {
+ answer.setContentIn("考察属性");
+// answer.setContent(key + " -> " + value.split(" vs ")[1]); // 设置属性信息
+ }
+ return answer;
+ })
+ .sorted(Comparator.comparingInt(answer -> Integer.parseInt(answer.getSort()))) // 按 sort 排序
+ .collect(Collectors.toList());
+ answerList.addAll(formattedDifferences);
+
+ return answerList;
+ }
+
+ @Override
+ public List get_mysql_point() {
+
+
+
+ return null;
+ }
+}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorService.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorService.java
new file mode 100644
index 00000000..0bd7048e
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorService.java
@@ -0,0 +1,59 @@
+package pc.exam.pp.module.exam.service.monitor;
+
+import jakarta.validation.*;
+import pc.exam.pp.framework.common.pojo.PageResult;
+import pc.exam.pp.module.exam.controller.admin.monitor.vo.*;
+import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
+
+/**
+ * 监控管理 Service 接口
+ *
+ * @author 管理员
+ */
+ public interface MonitorService {
+
+ /**
+ * 创建监控管理
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ String createMonitor(@Valid MonitorSaveReqVO createReqVO);
+
+ /**
+ * 更新监控管理
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateMonitor(@Valid MonitorSaveReqVO updateReqVO);
+
+ /**
+ * 删除监控管理
+ *
+ * @param id 编号
+ */
+ void deleteMonitor(String id);
+
+ /**
+ * 获得监控管理
+ *
+ * @param id 编号
+ * @return 监控管理
+ */
+ MonitorDO getMonitor(String id);
+
+ /**
+ * 获得监控管理分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 监控管理分页
+ */
+ PageResult getMonitorPage(MonitorPageReqVO pageReqVO);
+
+ Boolean getStuMonitor(StuMonitorPaperVo stuMonitorPaperVo);
+
+ void updateStuMonitor(StuMonitorQuVo stuMonitorQuVo);
+
+ void endStuMonitor(StuMonitorPaperEndVo stuMonitorPaperEndVo);
+
+}
\ No newline at end of file
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java
new file mode 100644
index 00000000..ffa8c860
--- /dev/null
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java
@@ -0,0 +1,226 @@
+package pc.exam.pp.module.exam.service.monitor;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.date.LocalDateTimeUtil;
+import com.alibaba.excel.util.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Service;
+import jakarta.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import pc.exam.pp.framework.common.pojo.PageResult;
+import pc.exam.pp.framework.common.util.json.JsonUtils;
+import pc.exam.pp.framework.common.util.object.BeanUtils;
+
+import pc.exam.pp.module.exam.controller.admin.monitor.vo.*;
+import pc.exam.pp.module.exam.dal.dataobject.*;
+import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
+import pc.exam.pp.module.exam.dal.mysql.monitor.MonitorMapper;
+import pc.exam.pp.module.exam.dal.mysql.paper.*;
+import pc.exam.pp.module.exam.dal.mysql.question.ExamQuestionMapper;
+import pc.exam.pp.module.exam.utils.uuid.IdUtils;
+
+import static pc.exam.pp.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static pc.exam.pp.module.system.enums.ErrorCodeConstants.MONITOR_NOT_EXISTS;
+
+/**
+ * 监控管理 Service 实现类
+ *
+ * @author 管理员
+ */
+@Service
+@Validated
+public class MonitorServiceImpl implements MonitorService {
+ @Autowired
+ private RedisTemplate redisTemplate;
+ @Resource
+ private MonitorMapper monitorMapper;
+ @Resource
+ private StringRedisTemplate stringRedisTemplate;
+ @Resource
+ private ExamQuestionMapper examQuestionMapper;
+ @Resource
+ private EducationPaperMapper educationPaperMapper;
+ @Resource
+ private EducationPaperPersonMapper educationPaperPersonMapper;
+ @Resource
+ private EducationPaperTaskMapper educationPaperTaskMapper;
+ @Resource
+ private EducationPaperParamMapper educationPaperParamMapper;
+ @Resource
+ private EducationPaperSessionMapper educationPaperSessionMapper;
+ @Override
+ public String createMonitor(MonitorSaveReqVO createReqVO) {
+ // 插入
+ MonitorDO monitor = BeanUtils.toBean(createReqVO, MonitorDO.class);
+ monitorMapper.insert(monitor);
+ // 返回
+ return monitor.getMonitorId();
+ }
+
+ @Override
+ public void updateMonitor(MonitorSaveReqVO updateReqVO) {
+ // 校验存在
+ validateMonitorExists(updateReqVO.getMonitorId());
+ // 更新
+ MonitorDO updateObj = BeanUtils.toBean(updateReqVO, MonitorDO.class);
+ monitorMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteMonitor(String id) {
+ // 校验存在
+ validateMonitorExists(id);
+ // 删除
+ monitorMapper.deleteById(id);
+ }
+
+ private void validateMonitorExists(String id) {
+ if (monitorMapper.selectById(id) == null) {
+ throw exception(MONITOR_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public MonitorDO getMonitor(String id) {
+ return monitorMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getMonitorPage(MonitorPageReqVO pageReqVO) {
+ return monitorMapper.selectPage(pageReqVO);
+ }
+ @Override
+ public Boolean getStuMonitor(StuMonitorPaperVo stuMonitorPaperVo) {
+ String key = "userCache:"+stuMonitorPaperVo.getTaskId()+":" + stuMonitorPaperVo.getStuId();
+ MonitorDO info = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get(key),MonitorDO.class);
+ if (StringUtils.isNotBlank(stuMonitorPaperVo.getPaperId())){
+ EducationPaper educationPaper = educationPaperMapper.selectEducationPaperByPaperId(stuMonitorPaperVo.getPaperId());
+ info.setPaperNum(educationPaper.getNum());
+ }
+
+ info.setExamStatus("1");
+
+ info.setIp(stuMonitorPaperVo.getIp());
+
+ if (info.getRemainingTime()==null){
+ stringRedisTemplate.opsForValue().set("userCache:"+stuMonitorPaperVo.getTaskId()+":"+stuMonitorPaperVo.getStuId(), JsonUtils.toJsonString(info));
+ monitorMapper.insert(info);
+ return true;
+ }else {
+ EducationPaperPerson educationPaperPerson = educationPaperPersonMapper.selectByTaskIdAndPersonId(stuMonitorPaperVo.getTaskId(), stuMonitorPaperVo.getStuId());
+ EducationPaperSession educationPaperSession = educationPaperSessionMapper.selectEducationPaperSessionBySessionId(educationPaperPerson.getSessionId());
+
+
+ //结束时间
+ Date endTime = educationPaperSession.getEndTime();
+ //开始时间
+ Date startTime = educationPaperSession.getStartTime();
+ //开始考试前分钟,允许入场
+ String allowEntry = educationPaperSession.getAllowEntry();
+ //开始考试后分钟,禁止入场
+ String endAllowEntry = educationPaperSession.getEndAllowEntry();
+
+ LocalDateTime now = LocalDateTime.now();
+ LocalDateTime start = DateUtil.toLocalDateTime(startTime);
+ LocalDateTime end = DateUtil.toLocalDateTime(endTime);
+
+ // 考试开始前允许入场时间(分钟)
+ int allowEntryMin = Integer.parseInt(allowEntry);
+
+ // 考试开始后允许入场时间(分钟)
+ int endAllowEntryMin = Integer.parseInt(endAllowEntry);
+
+ // 入场允许范围: [start , end + endAllowEntryMin]
+ LocalDateTime entryEnd = end.plusMinutes(endAllowEntryMin);
+
+ boolean isWithinEntryTime = now.isAfter(start) && now.isBefore(entryEnd);
+ System.out.println("是否在允许入场时间段内:" + isWithinEntryTime);
+
+ if (isWithinEntryTime){
+ long remainingSeconds = ChronoUnit.SECONDS.between(LocalDateTime.now(),
+ DateUtil.toLocalDateTime(endTime));
+ info.setRemainingTime(remainingSeconds > 0 ? remainingSeconds : 0);
+ stringRedisTemplate.opsForValue().set("userCache:"+stuMonitorPaperVo.getTaskId()+":"+stuMonitorPaperVo.getStuId(), JsonUtils.toJsonString(info), remainingSeconds, TimeUnit.SECONDS);
+ monitorMapper.updateById(info);
+ return true;
+ }else {
+ return false;
+ }
+ }
+
+ }
+
+ @Override
+ public void updateStuMonitor(StuMonitorQuVo stuMonitorQuVo) {
+ String key = "userCache:"+stuMonitorQuVo.getTaskId()+":" + stuMonitorQuVo.getStuId();
+ MonitorDO info = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get(key),MonitorDO.class);
+ if (info != null) {
+ AtomicInteger totalScore = new AtomicInteger(); // 用于累加总分
+ // 记录答题结果
+ List paperSchemeMaps = stuMonitorQuVo.getPaperSchemeMaps();
+ for (StuMonitorQuVo.EducationPaperSchemeMap paperSchemeMap : paperSchemeMaps) {
+ EducationPaperScheme educationPaperScheme = paperSchemeMap.getEducationPaperScheme();
+ Map questionResultMap = paperSchemeMap.getQuestionResultMap();
+ questionResultMap.forEach((quId, value) -> {
+ if (value) {
+ System.out.println("QuestionId: " + quId + ", boolean: " + value);
+ String quScores = educationPaperScheme.getQuScores();
+ int score = Integer.parseInt(quScores); // 转换为 int 类型的分数
+ totalScore.addAndGet(score); // 累加到总分
+
+ }
+ });
+ }
+
+ // 更新成绩(这里假设一题10分)
+
+ info.setScore(String.valueOf(totalScore));
+
+ // 更新缓存
+ redisTemplate.opsForValue().set(key, info);
+// monitorMapper.updateById(info);
+ }
+
+ }
+
+ @Override
+ public void endStuMonitor(StuMonitorPaperEndVo stuMonitorPaperEndVo) {
+ String key = "userCache:" + stuMonitorPaperEndVo.getTaskId()+":" +stuMonitorPaperEndVo.getStuId();
+ MonitorDO info = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get(key),MonitorDO.class);
+ EducationPaperParam educationPaperParam = educationPaperParamMapper.selectEducationPaperParamByTaskId(stuMonitorPaperEndVo.getTaskId());
+ EducationPaperTask educationPaperTask = educationPaperTaskMapper.selectEducationPaperTaskByTaskId(stuMonitorPaperEndVo.getTaskId());
+ if ("1".equals(educationPaperParam.getSaveGrades())){
+ info.setScore(stuMonitorPaperEndVo.getScore());
+ }else {
+ MonitorDO monitorDO = monitorMapper.selectById(info.getMonitorId());
+ if (Integer.parseInt(monitorDO.getScore()) studentIds = reqVO.getStudentIds();
+ for (String studentId : studentIds) {
+ String key = "userCache:" + reqVO.getTaskId()+":"+studentId;
+ redisTemplate.delete(key);
+ }
return educationPaperPersonMapper.removeSessionStu(reqVO);
}
@Override
public int removeTaskStu(DeleteRequestVo deleteRequestVo) {
+ List studentIds = deleteRequestVo.getStudentIds();
+ for (String studentId : studentIds) {
+ String key = "userCache:" + deleteRequestVo.getTaskId()+":"+studentId;
+ redisTemplate.delete(key);
+ }
return educationPaperPersonMapper.removeTaskStu(deleteRequestVo);
}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperQuServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperQuServiceImpl.java
index d37eb563..bdefe62c 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperQuServiceImpl.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperQuServiceImpl.java
@@ -6,10 +6,12 @@ import pc.exam.pp.module.exam.controller.admin.paper.vo.ExamPaperVo;
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperQu;
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperScheme;
import pc.exam.pp.module.exam.dal.dataobject.ExamQuestion;
+import pc.exam.pp.module.exam.dal.dataobject.SysFileUpload;
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperMapper;
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperQuMapper;
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperSchemeMapper;
import pc.exam.pp.module.exam.dal.mysql.question.ExamQuestionMapper;
+import pc.exam.pp.module.exam.dal.mysql.question.SysFileMapper;
import java.util.List;
@@ -30,6 +32,8 @@ public class EducationPaperQuServiceImpl implements IEducationPaperQuService
private ExamQuestionMapper examQuestionMapper;
@Autowired
private EducationPaperSchemeMapper educationPaperSchemeMapper;
+ @Autowired
+ private SysFileMapper sysFileMapper;
/**
* 查询试卷试题
*
@@ -108,6 +112,14 @@ public class EducationPaperQuServiceImpl implements IEducationPaperQuService
List quIds =educationPaperQuMapper.selectPaperQuByPaperId(paperId);
List examQuestionList=examQuestionMapper.selectExamQuestionListByQuIds(quIds);
+ if (examQuestionList!=null&&examQuestionList.size()>0){
+ for (ExamQuestion examQuestion : examQuestionList) {
+ //查找原始和素材试题文件
+ List sysFileUploads =sysFileMapper.selectSysFileByQuidIN(examQuestion.getQuId());
+ examQuestion.setFileUploads(sysFileUploads);
+ }
+
+ }
String taskid=educationPaperMapper.selectTaskIdByPaperId(paperId);
List educationPaperSchemeList= educationPaperSchemeMapper.selectEducationPaperTaskByTaskId(taskid);
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperServiceImpl.java
index 2874d380..937a4eea 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperServiceImpl.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperServiceImpl.java
@@ -148,11 +148,19 @@ public class EducationPaperServiceImpl implements IEducationPaperService
examQuestionIds.addAll(quId);
}
+ int number=educationPaperMapper.selectCountPaperList();
+
+ // 格式化为8位,不足前面补0
+ String formattedNumber = String.format("%08d", number);
+
+
+
//构建试卷
EducationPaper educationPaper =new EducationPaper();
String uuid = IdUtils.simpleUUID();
educationPaper.setPaperId(uuid);
educationPaper.setTaskId(taskid);
+ educationPaper.setNum(formattedNumber);
educationPaper.setTenantId(TenantContextHolder.getRequiredTenantId());
educationPaperMapper.insertEducationPaper(educationPaper);
@@ -213,8 +221,15 @@ public class EducationPaperServiceImpl implements IEducationPaperService
//构建返回对象
PaperListResponseVo paperListResponseVo=new PaperListResponseVo();
//查找该方案所有的试卷
- List paperByTaskIdByType = educationPaperMapper.getPaperByTaskIdByType(taskId);
- paperListResponseVo.setPaperId(paperByTaskIdByType);
+ List paperByTaskIdByType = educationPaperMapper.getPaperByTaskIdByType(taskId);
+ Map paperMap = new HashMap<>();
+ if (paperByTaskIdByType!=null&&paperByTaskIdByType.size()>0){
+ for (EducationPaper educationPaper : paperByTaskIdByType) {
+ paperMap.put(educationPaper.getPaperId(),educationPaper.getNum());
+ }
+
+ }
+ paperListResponseVo.setPaperId(paperMap);
//
Set selectedIds =new HashSet<>();
//根据选中的方案,查找选中方案下已分配的试卷
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSessionServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSessionServiceImpl.java
index f0f027ff..5733ecc6 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSessionServiceImpl.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSessionServiceImpl.java
@@ -2,6 +2,8 @@ package pc.exam.pp.module.exam.service.paper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import pc.exam.pp.framework.common.pojo.PageResult;
+import pc.exam.pp.module.exam.controller.admin.paper.vo.EducationPaperSessionVo;
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperSession;
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperPersonMapper;
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperSessionMapper;
@@ -41,7 +43,7 @@ public class EducationPaperSessionServiceImpl implements IEducationPaperSessionS
* @return 试卷场次
*/
@Override
- public List selectEducationPaperSessionList(EducationPaperSession educationPaperSession)
+ public PageResult selectEducationPaperSessionList(EducationPaperSessionVo educationPaperSession)
{
return educationPaperSessionMapper.selectEducationPaperSessionList(educationPaperSession);
}
diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperSessionService.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperSessionService.java
index b9fec8ba..2266a8c5 100644
--- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperSessionService.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperSessionService.java
@@ -1,6 +1,8 @@
package pc.exam.pp.module.exam.service.paper;
+import pc.exam.pp.framework.common.pojo.PageResult;
+import pc.exam.pp.module.exam.controller.admin.paper.vo.EducationPaperSessionVo;
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperSession;
import java.util.List;
@@ -27,7 +29,7 @@ public interface IEducationPaperSessionService
* @param educationPaperSession 试卷场次
* @return 试卷场次集合
*/
- public List selectEducationPaperSessionList(EducationPaperSession educationPaperSession);
+ PageResult selectEducationPaperSessionList(EducationPaperSessionVo educationPaperSession);
/**
* 新增试卷场次
diff --git a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/utils/file/GetDifferencesBetweenFolders.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/utils/file/GetDifferencesBetweenFolders.java
similarity index 98%
rename from exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/utils/file/GetDifferencesBetweenFolders.java
rename to exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/utils/file/GetDifferencesBetweenFolders.java
index fd354ae8..d2014b9c 100644
--- a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/utils/file/GetDifferencesBetweenFolders.java
+++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/utils/file/GetDifferencesBetweenFolders.java
@@ -1,4 +1,4 @@
-package pc.exam.pp.module.judgement.controller.utils.file;
+package pc.exam.pp.module.exam.utils.file;
import java.io.IOException;
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 087e48dc..fd845370 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
@@ -7,6 +7,7 @@
+
@@ -47,7 +48,7 @@
- select paper_id, task_id, counts, roll_up, is_ab, status ,create_time,update_time,creator,updater ,deleted from education_paper
+ select paper_id, task_id, num,counts, roll_up, is_ab, status ,create_time,update_time,creator,updater ,deleted from education_paper
@@ -103,8 +104,8 @@ select task_id from education_paper where paper_id=#{paperId}
-