From 74e042960cc73002795ae5aa88ada1c31094d682 Mon Sep 17 00:00:00 2001 From: yn147 <2270338776@qq.com> Date: 星期三, 24 五月 2023 15:52:25 +0800 Subject: [PATCH] 课程调用id --- src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java b/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java index b43fee9..2321c67 100644 --- a/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java +++ b/src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java @@ -248,14 +248,18 @@ String hql = "from ExerciseCompleteInfo where studentId=? and deleteFlag is false"; List<Object> Params = CollectionUtils.newList(studentId); ExerciseCompleteInfo unique = findUnique(hql, Params, ExerciseCompleteInfo.class); - unique.setDeleteFlag(false); - commonDAO.update(unique); + if(unique!=null) { + unique.setDeleteFlag(false); + commonDAO.update(unique); + } }else { String hql = "from ExerciseCompleteInfo where studentId=? and deleteFlag is false"; List<Object> Params = CollectionUtils.newList(studentId); ExerciseCompleteInfo unique = findUnique(hql, Params, ExerciseCompleteInfo.class); - unique.setDeleteFlag(true); - commonDAO.update(unique); + if(unique!=null){ + unique.setDeleteFlag(true); + commonDAO.update(unique); + } } return new Result(true); } -- Gitblit v1.8.0