@@ -11,6 +11,7 @@ import com.xboe.api.vo.*;
import com.xboe.module.course.vo.TeacherVo ;
import com.xboe.module.usergroup.entity.UserGroupItem ;
import com.xboe.module.usergroup.service.IUserGroupService ;
import com.xboe.school.study.dao.StudyCourseDao ;
import org.apache.commons.lang3.ArrayUtils ;
import org.apache.commons.lang3.StringUtils ;
import org.springframework.beans.factory.annotation.Autowired ;
@@ -65,7 +66,9 @@ import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping ( value = " /xboe/school/study/course " )
public class StudyCourseApi extends ApiBaseController {
@Autowired
IStudyCourseService service ;
@@ -321,19 +324,8 @@ public class StudyCourseApi extends ApiBaseController{
if ( StringUtils . isEmpty ( token ) ) {
token = request . getHeader ( " token " ) ;
}
//检查是否已存在
StudyCourseItem item = studyService . checkHas ( sci . getStudyId ( ) , sci . getContentId ( ) ) ;
// 20240815 特训营结营考试 临时代码
// if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
// redisTemplate.opsForValue().set(item.getId(),item.getId());
// //设置过期时间为1天
// redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
// }else{
// return success("");
// }
if ( item ! = null ) {
//如果记录存在, 但是进度不100无成情况, 就更新进度, 一期不会有这种情况
if ( item . getProgress ( ) < 100 & & sci . getProgress ( ) > item . getProgress ( ) ) {
@@ -418,14 +410,6 @@ public class StudyCourseApi extends ApiBaseController{
StudyCourseItem item = studyService . checkHas ( sci . getStudyId ( ) , sci . getContentId ( ) ) ;
if ( item ! = null ) {
//如果记录存在, 但是进度不到100, 未完成情况, 就更新进度, 一期不会有这种情况
// 20240815 特训营结营考试 临时代码
// if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
// redisTemplate.opsForValue().set(item.getId(),item.getId());
// //设置过期时间为1天
// redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
// }else{
// return success("");
// }
if ( item . getProgress ( ) < 100 ) {
studyService . updateProcess ( item . getId ( ) , sci . getStudyId ( ) , sci . getCourseId ( ) , sci . getContentTotal ( ) , 100 , token ) ;
}
@@ -531,14 +515,6 @@ public class StudyCourseApi extends ApiBaseController{
token = request . getHeader ( " token " ) ;
}
try {
// 20240815 特训营结营考试 临时代码
// if(itemId != null && redisTemplate.opsForValue().get(itemId)==null){
// redisTemplate.opsForValue().set(itemId,itemId);
// //设置过期时间为1天
// redisTemplate.expire(itemId, 60, TimeUnit.SECONDS);
// }else{
// return success(true);
// }
studyService . finishVideoStudyItem ( itemId , studyId , courseId , cnum , token ) ;
List < StudyCourse > allUserList = thirdApi . getStudyCourseList ( studyId , courseId , token ) ;
log . info ( " 在线课学习记录 " + allUserList ) ;
@@ -720,9 +696,10 @@ public class StudyCourseApi extends ApiBaseController{
return error ( " 查询失败 " , e . getMessage ( ) ) ;
}
}
@RequestMapping ( value = " /study-course-content " , method = { RequestMethod . GET , RequestMethod . POST } )
public JsonResponse < StudyCourseItem > findStudyCourseItem ( String studyId , String contentId ) {
public JsonResponse < StudyCourseItem > findStudyCourseItem ( String studyId , String contentId , HttpServletRequest request ){
if ( StringUtils . isBlank ( studyId ) ) {
return error ( " 无学习信息 " ) ;
}