From a26ee1c707951a2626c1402373ad503548c7227b Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Thu, 15 Aug 2024 15:42:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E5=BC=80=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/xboe/school/study/api/StudyCourseApi.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/api/StudyCourseApi.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/api/StudyCourseApi.java index e9961391..122a97b3 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/api/StudyCourseApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/api/StudyCourseApi.java @@ -327,7 +327,7 @@ public class StudyCourseApi extends ApiBaseController{ StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId()); // 20240815 特训营结营考试 临时代码 - if(redisTemplate.opsForValue().get(item.getId())==null){ + if(item != null && redisTemplate.opsForValue().get(item.getId())==null){ redisTemplate.opsForValue().set(item.getId(),item.getId()); //设置过期时间为1天 redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS); @@ -419,7 +419,7 @@ public class StudyCourseApi extends ApiBaseController{ if(item!=null) { //如果记录存在,但是进度不到100,未完成情况,就更新进度,一期不会有这种情况 // 20240815 特训营结营考试 临时代码 - if(redisTemplate.opsForValue().get(item.getId())==null){ + if(item != null && redisTemplate.opsForValue().get(item.getId())==null){ redisTemplate.opsForValue().set(item.getId(),item.getId()); //设置过期时间为1天 redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS); @@ -532,7 +532,7 @@ public class StudyCourseApi extends ApiBaseController{ } try { // 20240815 特训营结营考试 临时代码 - if(redisTemplate.opsForValue().get(itemId)==null){ + if(itemId != null && redisTemplate.opsForValue().get(itemId)==null){ redisTemplate.opsForValue().set(itemId,itemId); //设置过期时间为1天 redisTemplate.expire(itemId, 60, TimeUnit.SECONDS);