From 2822021f30be64ca500e2f35f2ec5f631223596b Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Wed, 17 Jul 2024 16:01:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE=E6=94=B9?= =?UTF-8?q?,=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/study/service/impl/StudySignupServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudySignupServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudySignupServiceImpl.java index 38852b1e..e111cd20 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudySignupServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudySignupServiceImpl.java @@ -4,10 +4,12 @@ import java.io.IOException; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.List; +import java.util.Optional; import javax.transaction.Transactional; import com.xboe.module.course.dao.CourseContentDao; +import com.xboe.module.course.dto.CourseContentDto; import com.xboe.module.course.entity.CourseContent; import com.xboe.school.study.dao.StudyCourseItemDao; import com.xboe.school.study.entity.StudyCourseItem; @@ -80,7 +82,7 @@ public class StudySignupServiceImpl implements IStudySignupService{ //添加到课程学习 LocalDateTime now=LocalDateTime.now(); String sql="SELECT * from boe_course_content " + - "where course_id = '"+signup.getCourseId()+"'"; + "where course_id = '?1'"; StudyCourse sc=new StudyCourse(); sc.setAddTime(now); sc.setAid(signup.getAid()); @@ -97,7 +99,7 @@ public class StudySignupServiceImpl implements IStudySignupService{ sc.setStatusTime(now); sc.setLastTime(sc.getAddTime()); sc.setTotalDuration(0); - List courseContents = contentDao.findListByHql(sql); + List courseContents = contentDao.sqlFindList("SELECT * from boe_course_content where course_id = "+ signup.getCourseId()); if (!courseContents.isEmpty()) { log.info("查看在线课集合内容数据(共 {} 条记录)", courseContents.size()); for (CourseContent c : courseContents) {