diff --git a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/admin/autoTools/AutoToolsController.java b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/admin/autoTools/AutoToolsController.java index 1894ed4d..46853332 100644 --- a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/admin/autoTools/AutoToolsController.java +++ b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/admin/autoTools/AutoToolsController.java @@ -279,6 +279,7 @@ public class AutoToolsController { String interactiveTime = info.getInteractiveTime(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); LocalDateTime targetTime = LocalDateTime.parse(interactiveTime, formatter); + // 获取当前时间 LocalDateTime currentTime = LocalDateTime.now(); Duration duration = Duration.between(currentTime, targetTime); // 两者相差的时间 @@ -414,9 +415,13 @@ public class AutoToolsController { * @return true */ @GetMapping("/stopExamForAdmin") - public CommonResult stopExamForAdmin(@RequestParam("userId") String userId) { + public CommonResult stopExamForAdmin(@RequestParam("userId") String userId, + @RequestParam("taskId") String taskId, + @RequestParam("paperNum") String paperNmu) { + String paperId = educationPaperService.selectPaperByPaperNum(paperNmu); + userId += "_" + taskId + "_" + paperId; // 删除对应的线程池 - taskManager.stopTaskByUserId(userId); + taskManager.stopTask(userId); return CommonResult.success(true); }