From d95159cc2ae2315c6272d6ce13e32ceef27a49fc Mon Sep 17 00:00:00 2001 From: "YOHO\\20373" <2037305722@qq.com> Date: Tue, 20 May 2025 23:26:30 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pp/module/exam/service/monitor/MonitorServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 index f2ecf979..1bfe9dde 100644 --- 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 @@ -115,6 +115,9 @@ public class MonitorServiceImpl implements MonitorService { public long getStuMonitor(StuMonitorPaperVo stuMonitorPaperVo) { String key = "userCache:"+stuMonitorPaperVo.getTaskId()+":" + stuMonitorPaperVo.getStuId(); MonitorDO info = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get(key),MonitorDO.class); + if (info==null){ + return 0L; + } if (StringUtils.isNotBlank(stuMonitorPaperVo.getPaperId())){ EducationPaper educationPaper = educationPaperMapper.selectEducationPaperByPaperId(stuMonitorPaperVo.getPaperId()); String counts = educationPaper.getCounts(); @@ -199,7 +202,7 @@ public class MonitorServiceImpl implements MonitorService { info.setRemainingTime((long) examTime.toLocalTime().toSecondOfDay()); stringRedisTemplate.opsForValue().set("userCache:"+stuMonitorPaperVo.getTaskId()+":"+stuMonitorPaperVo.getStuId(), JsonUtils.toJsonString(info)); - + monitorMapper.updateById(info); return (long) examTime.toLocalTime().toSecondOfDay();