From 0a29a9a3a980df26c958ea9ecbe549851a15a5b4 Mon Sep 17 00:00:00 2001 From: "YOHO\\20373" <2037305722@qq.com> Date: Tue, 3 Jun 2025 16:37:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=B3=A8=E9=87=8A=EF=BC=8C=E8=AF=95=E5=8D=B7=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=B8=8B=E6=83=B3=E5=90=8C=E9=A2=98=E5=9E=8B=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/monitor/MonitorController.java | 86 ++++++++-------- .../admin/paper/EducationPaperController.java | 23 +++-- .../paper/EducationPaperParamController.java | 10 ++ .../paper/EducationPaperPersonController.java | 11 +++ .../paper/EducationPaperSchemeController.java | 17 +++- .../EducationPaperSessionController.java | 5 + .../paper/EducationPaperTaskController.java | 23 ++++- .../dal/mysql/paper/EducationPaperMapper.java | 51 ++++++++-- .../paper/EducationPaperParamMapper.java | 5 + .../paper/EducationPaperPersonMapper.java | 97 +++++++++++++++++-- .../mysql/paper/EducationPaperQuMapper.java | 26 ++++- .../paper/EducationPaperSchemeMapper.java | 9 ++ .../paper/EducationPaperSessionMapper.java | 15 ++- .../mysql/paper/EducationPaperTaskMapper.java | 48 +++++++-- .../exam/service/monitor/MonitorService.java | 10 +- .../service/monitor/MonitorTaskService.java | 2 +- .../EducationPaperSchemeServiceImpl.java | 2 + .../paper/EducationPaperServiceImpl.java | 2 +- .../service/paper/IEducationPaperService.java | 39 ++++++-- .../paper/IEducationPaperSessionService.java | 11 +++ .../paper/IEducationPaperTaskService.java | 39 ++++++-- .../infra/enums/ErrorCodeConstants.java | 1 + 22 files changed, 429 insertions(+), 103 deletions(-) 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 index 91c8f5a5..b972f637 100644 --- 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 @@ -35,55 +35,55 @@ import static pc.exam.pp.module.infra.enums.ErrorCodeConstants.DEMO03_MONITOR_TI @RequestMapping("/exam/monitor") @Validated public class MonitorController { -@Resource -private MonitorService monitorService; + @Resource + private MonitorService monitorService; -@PostMapping("/create") -@Operation(summary = "创建监控管理") -public CommonResult createMonitor(@Valid @RequestBody MonitorSaveReqVO createReqVO) { - return success(monitorService.createMonitor(createReqVO)); -} + @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); -} + @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); -} + @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("/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("/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)); -} + @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 = "学生端进入考试返回值") diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperController.java index 6cb0369c..7a516f63 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperController.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperController.java @@ -85,7 +85,7 @@ public class EducationPaperController } /** - * 学生端返回一张试卷 + * 学生端根据任务id返回 考试信息 */ @GetMapping("/stuInfoPaper") public CommonResult stuInfoPaper(@RequestParam("taskid") String taskid) @@ -132,8 +132,11 @@ public class EducationPaperController } - - + /** + * 抽卷方式调整 + * @param educationPaper + * @return + */ @PostMapping("/update") public CommonResult update(@RequestBody EducationPaper educationPaper) { @@ -197,9 +200,13 @@ public class EducationPaperController return CommonResult.success(educationPaperService.getPaperByTaskIdByType(requestData.getTaskId(), requestData.getRows())); } + /** + * 更改试卷任务状态 + * @param statusDto + * @return + */ - - @PutMapping("/updatePaperStatus") // 更符合RESTful规范 + @PutMapping("/updatePaperStatus") public CommonResult updateTaskStatus(@RequestBody StatusDto statusDto) { // 改为Integer类型 return CommonResult.success( educationPaperService.changeStatus(statusDto.getPaperId(), statusDto.getStatus()) @@ -207,7 +214,11 @@ public class EducationPaperController } - + /** + * 学生端 返回试卷任务列表 + * @param paperPageVo + * @return + */ @GetMapping("/stulist") public CommonResult> stulist(PaperPageVo paperPageVo) { diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperParamController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperParamController.java index 2b3bbd96..69e55e53 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperParamController.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperParamController.java @@ -62,6 +62,11 @@ public class EducationPaperParamController return CommonResult.success(educationPaperParamService.deleteEducationPaperParamByParamIds(paramIds)); } + /** + * 步骤条 (考场) + * @param taskId + * @return + */ @GetMapping( "/check-can-enter-step4/{taskId}") public CommonResult ckeckSession(@PathVariable("taskId") String taskId){ EducationPaperParam educationPaperParam = educationPaperParamService.selectEducationPaperParamByTaskId(taskId); @@ -74,6 +79,11 @@ public class EducationPaperParamController } return CommonResult.success("200"); } + /** + * 步骤条 (考场) + * @param taskId + * @return + */ @GetMapping( "/check-can-enter-step4NoMsg/{taskId}") public CommonResult ckeckSessionNoMsg(@PathVariable("taskId") String taskId){ EducationPaperParam educationPaperParam = educationPaperParamService.selectEducationPaperParamByTaskId(taskId); diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperPersonController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperPersonController.java index 9fe6791a..8a02bbc9 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperPersonController.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperPersonController.java @@ -131,11 +131,22 @@ public class EducationPaperPersonController } + /** + * 删除场次学生 + * @param reqVO + * @return + */ @DeleteMapping("/removeSessionStu") public CommonResult removeSessionStu(@RequestBody StudentSessionReqVO reqVO) { return CommonResult.success(educationPaperPersonService.removeSessionStu(reqVO)); } + + /** + * 删除任务学生 + * @param deleteRequestVo + * @return + */ @DeleteMapping("/removeTaskStu") public CommonResult removeTaskStu(@RequestBody DeleteRequestVo deleteRequestVo) { return CommonResult.success(educationPaperPersonService.removeTaskStu(deleteRequestVo)); diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperSchemeController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperSchemeController.java index 0728e85d..9c893561 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperSchemeController.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperSchemeController.java @@ -5,6 +5,7 @@ import org.springframework.web.bind.annotation.*; import pc.exam.pp.framework.common.pojo.CommonResult; import pc.exam.pp.module.exam.dal.dataobject.EducationPaperScheme; import pc.exam.pp.module.exam.dal.dataobject.EducationPaperTask; +import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperSchemeMapper; import pc.exam.pp.module.exam.service.paper.IEducationPaperSchemeService; import pc.exam.pp.module.exam.service.paper.IEducationPaperService; import pc.exam.pp.module.exam.service.paper.IEducationPaperTaskService; @@ -13,6 +14,8 @@ import java.util.List; import static pc.exam.pp.module.infra.enums.ErrorCodeConstants.DEMO03_PAPER_TASK_DEL_EXISTS; import static pc.exam.pp.module.infra.enums.ErrorCodeConstants.DEMO03_PAPER_TASK_ADD_EXISTS; +import static pc.exam.pp.module.infra.enums.ErrorCodeConstants.DEMO03_PAPER_SCHEMES_ADD_EXISTS; + /** * 试卷方案Controller @@ -30,6 +33,8 @@ public class EducationPaperSchemeController private IEducationPaperService educationPaperService; @Autowired private IEducationPaperTaskService educationPaperTaskService; + @Autowired + private EducationPaperSchemeMapper educationPaperSchemeMapper; /** * 查询试卷方案列表 */ @@ -70,13 +75,23 @@ public class EducationPaperSchemeController EducationPaperTask educationPaperTask = educationPaperTaskService.selectEducationPaperTaskByTaskId(educationPaperScheme.getTaskId()); String taskType = educationPaperTask.getTaskType(); - if ( "0".equals(taskType)||"1".equals(taskType)||"3".equals(taskType)) { + //有卷子列表的 要判断方案下是否有卷子 + if ("0".equals(taskType)||"1".equals(taskType)||"3".equals(taskType)) { List strings = educationPaperService.selectPaperByTaskId(educationPaperScheme.getTaskId()); if (strings!=null&&strings.size()>0){ return CommonResult.error(DEMO03_PAPER_TASK_ADD_EXISTS); } } + List educationPaperSchemes = educationPaperSchemeMapper.selectEducationPaperTaskByTaskId(educationPaperScheme.getTaskId()); + //判断 方案下 是否有同题型 + String spName = educationPaperScheme.getSpName(); + boolean exists = educationPaperSchemes.stream() + .anyMatch(scheme -> spName.equals(scheme.getSpName())); + + if (exists) { + return CommonResult.error(DEMO03_PAPER_SCHEMES_ADD_EXISTS); + } return CommonResult.success(educationPaperSchemeService.insertEducationPaperScheme(educationPaperScheme)); } 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 5c878f8f..a5ec95d0 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 @@ -133,6 +133,11 @@ public class EducationPaperSessionController return CommonResult.success("修改成功"); } + /** + * 更改状态 + * @param statusDto + * @return + */ @PutMapping("/updateSessionStatus") public CommonResult updateSessionStatus(@RequestBody StatusDto statusDto) { return CommonResult.success( diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperTaskController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperTaskController.java index 0f6c4762..64a4ca5b 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperTaskController.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/EducationPaperTaskController.java @@ -99,6 +99,9 @@ public class EducationPaperTaskController { return CommonResult.success(educationPaperTaskService.deleteEducationPaperTaskByTaskId(taskId)); } + /** + * 批量删除试卷任务 + */ @DeleteMapping("/{taskIds}") public CommonResult removeIds(@PathVariable String[] taskIds ) { @@ -152,16 +155,20 @@ public class EducationPaperTaskController } - + /** + * 模板库 复制 + * @param tempDto + * @return + */ @PostMapping("/submitSelection") public CommonResult submitSelection(@RequestBody TempDto tempDto) { System.out.println("接收到的任务ID: " + tempDto.getTaskId()); - System.out.println("接收到的选项: " + tempDto.getOptions()); + System.out.println("接收到的选项: " + tempDto.getOptions()); String taskId = tempDto.getTaskId(); if (taskId == null || taskId.trim().isEmpty()) { return CommonResult.error(INTERNAL_SERVER_ERROR.getCode(),"缺失模板方案参数Id!"); } - List options = tempDto.getOptions(); + List options = tempDto.getOptions(); if (options!=null&&options.size()>0){ educationPaperTaskService.submitSelection(tempDto); @@ -174,6 +181,11 @@ public class EducationPaperTaskController return CommonResult.success("复制成功"); } + /** + * 更改 任务状态 + * @param statusDto + * @return + */ @PutMapping("/updateTaskStatus") public CommonResult updateTaskStatus(@RequestBody StatusDto statusDto) { return CommonResult.success( @@ -182,6 +194,11 @@ public class EducationPaperTaskController } + /** + * 学生端 根据taskid返回 试卷信息 + * @param taskId + * @return + */ @GetMapping(value = "/getPaperBytaskId") public CommonResult getPaperBytaskId(@RequestParam(value = "taskId") String taskId) { 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 b80ebf1c..ee419848 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 @@ -94,9 +94,9 @@ public interface EducationPaperMapper extends BaseMapperX ,@Param("tId") Long tId ); String selectTaskIdByPaperId(String paperId); - + //查找方案下所有试卷id List selectPaperByTaskId(String taskId); - + //根据试卷id,批量设置试卷格式 public int updateEducationByids(@Param("strings")List strings); List selectPaperRandomByTaskId(String taskId); @@ -105,25 +105,62 @@ public interface EducationPaperMapper extends BaseMapperX void updatePaperGuByRollup(String taskId); - + /** + * 根据试卷任务id查找试卷id集合 + * @param taskId + * @return + */ List selectPaperByTaskIdAndRoll(@Param("taskId")String taskId); - + //查找该方案所有的试卷 List getPaperByTaskIdByType(String taskId); + /** + * 查找选中方案下已分配的试卷 + * @param row + * @return + */ String getSelectPaperIdBySchemeIds(String row); + /** + * 批量设置试卷抽卷方式(自选) + * @param strings + * @return + */ int updateEducationByidsThree(@Param("strings")List strings); + /** + * 分局任务id查找任务下的 试卷 + * @param taskId + * @return + */ List selectPaperListByTaskId(String taskId); + /** + * 批量插入试卷 + * @param educationPapers + */ void insertEducationPaperList(List educationPapers); + /** + * 改变试卷状态 + * @param paperId + * @param status + * @return + */ int changeStatus(@Param("paperId") String paperId ,@Param("status") String status); + /** + * 查找试卷个数 + * @return + */ int selectCountPaperList(); - + /** + * 查找试卷列表 + * @param paperPageVo + * @return + */ default PageResult selectStuEducationPaperList(PaperPageVo paperPageVo) { return selectPage(paperPageVo, new LambdaQueryWrapperX() .likeIfPresent(EducationPaper::getTaskId, paperPageVo.getTaskId()) @@ -131,7 +168,9 @@ public interface EducationPaperMapper extends BaseMapperX .eq(EducationPaper::getStatus, 0) ); } - + /** + * 根据方案获取试卷下拉 + */ List selectPaperIdAndNumByTaskId(String taskId); } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperParamMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperParamMapper.java index 361b9e7c..fbcf69c9 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperParamMapper.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperParamMapper.java @@ -65,6 +65,11 @@ public interface EducationPaperParamMapper */ public int deleteEducationPaperParamByParamIds(String[] paramIds); + /** + * 根据任务id查找 试卷任务参数对象 + * @param taskId + * @return + */ EducationPaperParam selectEducationPaperParamByTaskId(String taskId); } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperPersonMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperPersonMapper.java index c63cca34..83b61db9 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperPersonMapper.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperPersonMapper.java @@ -78,46 +78,125 @@ public interface EducationPaperPersonMapper public int deleteEducationPaperPersonByTaskIds(String[] taskIds); - - - - + /** + * 根据用户id查找用户信息 + * @param personId + * @return + */ PersonRepDto selectUserById(String personId); + /** + * 查找 班级名称 + * @param classId + * @return + */ String selectUserClassName(Long classId); + /** + * 查找试卷人员分配对象列表 + * @param examPersonVo + * @return + */ List selectEducationPaperPersonBySessionId(ExamPersonVo examPersonVo); - + /** + * 查找试卷人员分配对象列表(分配该场次的人员) + * @param sessionStuPageReqVO + * @return + */ List selectEducationPaperPersonByNotInSessionId(SessionStuPageReqVO sessionStuPageReqVO); + /** + * 根据班级名称找id + * @param className + * @return + */ Long selectUserClassIdByName(String className); - + /** + * 批量插入试卷人员分配对象 + * @param educationPaperPeople + */ void insertEducationPaperPersonList(List educationPaperPeople); + /** + * 删除场次的试卷人员分配对象 + * @param reqVO + * @return + */ int removeSessionStu(StudentSessionReqVO reqVO); + /** + * 批量删除场次 + * @param sessionIds + */ void deleteEducationPaperPersonBySessionkIds(String[] sessionIds); + /** + * 根据试卷任务id和学生id,查找卷人员分配对象 + * @param taskId + * @param studentId + * @return + */ EducationPaperPerson selectByTaskIdAndPersonId(@Param("taskId") String taskId, @Param("studentId") String studentId); + /** + * 根据试卷任务id和学生id,更新试卷人员分配对象 + * @param existing + */ void updateByTaskIdAndStuId(EducationPaperPerson existing); + /** + * 批量删除 场次分配的学生 + * @param deleteRequestVo + * @return + */ int removeTaskStu(DeleteRequestVo deleteRequestVo); + /** + * 查找试卷人员分配对象列表(没有分配该场次的人员) + * @param sessionStuPageReqVO + * @return + */ List selectEducationPaperPersonBySessionIdNotIn(SessionStuPageReqVO sessionStuPageReqVO); + /** + * 根据试卷任务id查找该任务下的 学生id + * @param taskId + * @return + */ List selectStuIdByTaskId(String taskId); + /** + * 根据学生id查找该学生分配的试卷任务列表 + * @param loginUserId + * @return + */ List selectTaskIdByStuid(Long loginUserId); + /** + * 根据场次id返回数量 + * @param sessionId + * @return + */ long selectEducationPaperPersonBySessionIdTotal(String sessionId); - + /** + * 根据试卷任务id返回数量 + * @param taskId + * @return + */ long selectEducationPaperPersonByTaskIdTotal(String taskId); - + /** + * 查找 不在该场次或没有分配场次学生的个数 + * @param sessionStuPageReqVO + * @return + */ long selectEducationPaperPersonByNotInSessionIdTotal(SessionStuPageReqVO sessionStuPageReqVO); - + /** + * 查找分配该场次学生的个数 + * @param sessionStuPageReqVO + * @return + */ long selectEducationPaperPersonBySessionIdNotInTotal(SessionStuPageReqVO sessionStuPageReqVO); } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperQuMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperQuMapper.java index 0b2e0769..6bc7ae6f 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperQuMapper.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperQuMapper.java @@ -64,16 +64,38 @@ public interface EducationPaperQuMapper */ public int deleteEducationPaperQuByPaperIds(String[] paperIds); + /** + * 批量插入 + * @param educationPaperQus + */ void insertEducationPaperQuList(List educationPaperQus); - + /** + * 根据试卷id返回 该试卷下的试题id + * @param paperId + * @return + */ List selectPaperQuByPaperId(String paperId); - + /** + * 根据试卷id返回试卷试题对象集合 + * @param paperId + * @return + */ List selectPaperQuListByPaperId(String paperId); + /** + * 改变试卷状态 + * @param changePaperQuVo + * @return + */ boolean changePaperQu(ChangePaperQuVo changePaperQuVo); + /** + * 随机抽取一个试题 + * @param changePaperQuVo + * @return + */ String selectRamdomQuId(ChangePaperQuVo changePaperQuVo); diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSchemeMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSchemeMapper.java index 5bec2d92..ab5c623b 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSchemeMapper.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSchemeMapper.java @@ -64,8 +64,17 @@ public interface EducationPaperSchemeMapper */ public int deleteEducationPaperSchemeBySchemeIds(String[] schemeIds); + /** + * 根据试卷任务id查询 试卷方案集合 + * @param taskid + * @return + */ List selectEducationPaperTaskByTaskId(String taskid); + /** + * 批量插入 试卷方案 + * @param educationPaperSchemeList + */ void insertEducationPaperSchemeList(List educationPaperSchemeList); } 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 eb81bf58..b266fbba 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 @@ -69,15 +69,20 @@ public interface EducationPaperSessionMapper extends BaseMapperX selectEducationPaperSessionByTaskId(String taskId); - + //批量插入试卷场次对象 void insertEducationPaperSessionList(List educationPaperSessions); - + /** + * 改变状态 + * @param sessionId + * @param status + * @return + */ 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()) @@ -90,7 +95,7 @@ public interface EducationPaperSessionMapper extends BaseMapperX getSpecialityList(); - + /** + * 获取题型列表 + */ List getCourseList(); - + /** + * 获取关键字 + */ List getKeywords(); - + /** + * 获取知识点 + */ List getPoints(@Param("id") Long id); - + /* + 按照方案返回试题数量 + */ Integer getQuCount(@Param("taskSpecialty") String taskSpecialty ,@Param("spName") String spName ,@Param("quLevel")String quLevel ,@Param("pointName") List pointName ,@Param("keyword") List keyword ,@Param("tId") Long tId); - + //根据id结合查找 知识点 名称 List selectPointByid(List list); - + //根据名称查找 知识点 id Long getPointIdByName(String name); - + /** + * 改变试卷任务状态 + */ boolean changeStatus(@Param("taskId")String taskId,@Param("status") String status); + /** + * 根据试卷任务id返回名称 + * @param taskId + * @return + */ String selectEducationPaperTaskNameByid(String taskId); + /** + * 根据班级id返回对应班级名称 + * @param classId + * @return + */ String selectStuClassNameByClassId(Long classId); + /** + * 根据试卷种类 返回 试卷任务集合 + * @param id + * @return + */ List selectEducationPaperTaskByTaskType(String id); + /** + * 根据试卷任务id随机抽取 试卷id + * @param taskId + * @return + */ String selectPaperQuByPaperId(String taskId); } 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 index 8d6bc15b..e0cbe482 100644 --- 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 @@ -52,14 +52,14 @@ import java.util.List; * @return 监控管理分页 */ PageResult getMonitorPage(MonitorPageReqVO pageReqVO); - + //学生端进入考试返回值 long getStuMonitor(StuMonitorPaperVo stuMonitorPaperVo); - + //学生端考试过程传试题 Boolean updateStuMonitor(StuMonitorQuVo stuMonitorQuVo); - + //学生端结束考试返回值 void endStuMonitor(StuMonitorPaperEndVo stuMonitorPaperEndVo); - + //根据种类获得试卷任务 List getPaperTaskList(String id); - + //改变考生状态 Boolean updateMonitorStatus(StuMonitorStatusVo stuMonitorStatusVo); } \ 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/MonitorTaskService.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorTaskService.java index b01ec5ba..36e0767d 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorTaskService.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorTaskService.java @@ -7,7 +7,7 @@ import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO; import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorTaskDO; public interface MonitorTaskService { - + //获得监控管理分页 PageResult getMonitorPage(PaperTaskPageVo pageReqVO); } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSchemeServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSchemeServiceImpl.java index e0f4646c..da177f78 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSchemeServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSchemeServiceImpl.java @@ -55,6 +55,8 @@ public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeSer @Override public int insertEducationPaperScheme(EducationPaperScheme educationPaperScheme) { + + String uuid = IdUtils.simpleUUID(); educationPaperScheme.setSchemeId(uuid); 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 29ad2a8f..7d688845 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 @@ -364,7 +364,7 @@ public class EducationPaperServiceImpl implements IEducationPaperService List educationPaperSchemeList= educationPaperSchemeMapper.selectEducationPaperTaskByTaskId(taskid); List examQuestionIds = new ArrayList<>(); - int totalScore = 0; + int totalScore = 0; for (EducationPaperScheme educationPaperScheme : educationPaperSchemeList) { try { diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperService.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperService.java index 72b587b5..4a41de1a 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperService.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperService.java @@ -72,34 +72,59 @@ public interface IEducationPaperService public int addPaperList(Integer num, String taskid, String taskSpecialty); - + //查找方案下所有试卷id List selectPaperByTaskId(String taskId); - + //根据试卷id,批量设置试卷格式 public int updateEducationByids(List strings); List selectPaperRandomByTaskId(String taskId); - + //根据试卷id,批量清空试卷格式 public int updateRandomByids(List strings); void updatePaperGuByRollup(String taskId); - + //查找方案下所有不是此抽卷方式的试卷id List selectPaperByTaskIdAndRoll(String taskId); - + /** + * 根据方案获取已经设置好的试卷 + */ PaperListResponseVo getPaperByTaskIdByType(String taskId, List rows); public int updateEducationByidsThree(List strings); + /** + * 更改试卷任务状态 + * @param paperId + * @param status + * @return + */ int changeStatus(String paperId, String status); - + /** + * 学生端 返回试卷任务列表 + * @param paperPageVo + * @return + */ PageResult selectStuEducationPaperList(PaperPageVo paperPageVo); + /** + * 学生端根据任务id返回 考试信息 + * @param taskid + * @return + */ ExamPaperVo stuInfoPaper(String taskid); + /** + * 下载试卷 + * @param paperIds + * @param response + * @throws Exception + */ void downloadWord(String[] paperIds, HttpServletResponse response) throws Exception; - + /** + * 根据方案获取试卷下拉 + */ List selectPaperIdAndNumByTaskId(String taskId); } 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 b2ec1352..26715576 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 @@ -64,7 +64,18 @@ public interface IEducationPaperSessionService */ public int deleteEducationPaperSessionBySessionId(String sessionId); + /** + * 更改状态 + * @param sessionId + * @param status + * @return + */ int changeStatus(String sessionId, String status); + /** + * 根据任务id查找 考试时间 + * @param taskId + * @return + */ Time getAnswerTime(String taskId); } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperTaskService.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperTaskService.java index b0d65d31..06b6972b 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperTaskService.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperTaskService.java @@ -67,24 +67,51 @@ public interface IEducationPaperTaskService * @return 结果 */ public int deleteEducationPaperTaskByTaskId(String taskId); - + /** + * 获取专业列表 + */ List getSpecialityList(); - + /** + * 获取题型列表 + */ List getCourseList(); - + /** + * 获取关键字 + */ List getKeywords(); - + /** + * 获取知识点 + */ List getPoints(String name); - + /* + 按照方案返回试题数量 + */ Integer getQuCount(SchemeParam param); + /** + * 模板库 复制 + * @param tempDto + */ void submitSelection(TempDto tempDto); + /** + * 改变试卷任务状态 + * @param taskId + * @param status + * @return + */ boolean changeStatus(String taskId, String status); + /** + * 学生端 根据试卷任务id返回 进入考试信息 + * @param taskId + * @return + */ ExamPaperVo selectPaperQuByPaperId(String taskId); - + /** + * 查询试卷任务列表(学生端) + */ PageResult selectEducationPaperTaskListByStu(PaperTaskPageVo educationPaperTask); } diff --git a/exam-module-infra/exam-module-infra-api/src/main/java/pc/exam/pp/module/infra/enums/ErrorCodeConstants.java b/exam-module-infra/exam-module-infra-api/src/main/java/pc/exam/pp/module/infra/enums/ErrorCodeConstants.java index 0da6c87f..1723caf7 100644 --- a/exam-module-infra/exam-module-infra-api/src/main/java/pc/exam/pp/module/infra/enums/ErrorCodeConstants.java +++ b/exam-module-infra/exam-module-infra-api/src/main/java/pc/exam/pp/module/infra/enums/ErrorCodeConstants.java @@ -77,6 +77,7 @@ public interface ErrorCodeConstants { // ========== 试卷方案 1-001-901-900 ========== ErrorCode DEMO03_PAPER_TASK_DEL_EXISTS = new ErrorCode(1-001-901-901, "该方案下已有试卷不能删除!"); ErrorCode DEMO03_PAPER_TASK_ADD_EXISTS = new ErrorCode(1-001-901-901, "该方案下已有试卷不能新增!"); + ErrorCode DEMO03_PAPER_SCHEMES_ADD_EXISTS = new ErrorCode(1-001-902-902, "该方案下已有相同的题型!"); // ========== 监控管理 1-001-606-000 ========== ErrorCode DEMO03_MONITOR_TIME_EXISTS = new ErrorCode(1-001-606-001, "该考试不在考场时间范围内!"); ErrorCode DEMO03_MONITOR_SESSION_EXISTS = new ErrorCode(1-001-606-002, "考生状态未在考试中!请联系管理员");