bug
This commit is contained in:
@@ -34,4 +34,6 @@ public class CourseCatalogueChapterVideoEntity {
|
|||||||
private String playAuth;
|
private String playAuth;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private UserCourseVideoPositionEntity userCourseVideoPositionEntity;
|
private UserCourseVideoPositionEntity userCourseVideoPositionEntity;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String videoUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,21 @@ public class CourseCatalogueChapterServiceImpl extends ServiceImpl<CourseCatalog
|
|||||||
HashMap<String, Object> flag = new HashMap<>();
|
HashMap<String, Object> flag = new HashMap<>();
|
||||||
flag.put("detail",byId);
|
flag.put("detail",byId);
|
||||||
List<CourseCatalogueChapterVideoEntity> courseCatalogueChapterVideoEntities = courseCatalogueChapterVideoDao.selectList(new LambdaQueryWrapper<CourseCatalogueChapterVideoEntity>().eq(CourseCatalogueChapterVideoEntity::getChapterId, chapterId));
|
List<CourseCatalogueChapterVideoEntity> courseCatalogueChapterVideoEntities = courseCatalogueChapterVideoDao.selectList(new LambdaQueryWrapper<CourseCatalogueChapterVideoEntity>().eq(CourseCatalogueChapterVideoEntity::getChapterId, chapterId));
|
||||||
|
for(CourseCatalogueChapterVideoEntity c : courseCatalogueChapterVideoEntities){
|
||||||
|
if(c.getType()==1){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String s_str = "";
|
||||||
|
if(c.getVideo().startsWith("common/")){
|
||||||
|
s_str = "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/";
|
||||||
|
} else if (c.getVideo().startsWith("article/")) {
|
||||||
|
s_str = "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/";
|
||||||
|
}else{
|
||||||
|
s_str = "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/taiHuClass/";
|
||||||
|
}
|
||||||
|
c.setVideoUrl(s_str+c.getVideo());
|
||||||
|
}
|
||||||
|
|
||||||
flag.put("videos",courseCatalogueChapterVideoEntities);
|
flag.put("videos",courseCatalogueChapterVideoEntities);
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -39,6 +36,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
private CourseCatalogueChapterVideoDao courseCatalogueChapterVideoDao;
|
private CourseCatalogueChapterVideoDao courseCatalogueChapterVideoDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserCourseVideoPositionDao userCourseVideoPositionDao;
|
private UserCourseVideoPositionDao userCourseVideoPositionDao;
|
||||||
|
@Autowired
|
||||||
|
private CourseSociologyDao courseSociologyDao;
|
||||||
|
|
||||||
|
|
||||||
//根据标签获取课程列表
|
//根据标签获取课程列表
|
||||||
@@ -104,18 +103,30 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
@Override
|
@Override
|
||||||
public List getMyCourse(int type) {
|
public List getMyCourse(int type) {
|
||||||
Integer uId = ShiroUtils.getUId();
|
Integer uId = ShiroUtils.getUId();
|
||||||
|
//获取所有国学标签
|
||||||
|
List<CourseSociologyEntity> courseSociologyEntities = courseSociologyDao.selectList(null);
|
||||||
MyUserEntity userEntity = userService.getById(uId);
|
MyUserEntity userEntity = userService.getById(uId);
|
||||||
if(userEntity.getVip()!="0"){
|
List<Integer> collect = userCourseBuyDao.selectList(new LambdaQueryWrapper<UserCourseBuyEntity>().eq(UserCourseBuyEntity::getUserId, userEntity.getId())).stream().map(UserCourseBuyEntity::getCourseId).collect(Collectors.toList());
|
||||||
|
if(userEntity.getVip().equals("0")&&collect.size()==0){
|
||||||
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
MPJLambdaWrapper<UserCourseBuyEntity> wrapper = new MPJLambdaWrapper<>();
|
ArrayList<Map> flag = new ArrayList<>();
|
||||||
wrapper.selectAll(CourseEntity.class);
|
for (CourseSociologyEntity c : courseSociologyEntities){
|
||||||
wrapper.select(UserCourseBuyEntity::getEndTime);
|
HashMap<String, Object> stringObjectHashMap = new HashMap<>();
|
||||||
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId,UserCourseBuyEntity::getCourseId);
|
MPJLambdaWrapper<CourseToSociologyEntity> courseToSociologyEntityMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.eq(UserCourseBuyEntity::getUserId,uId);
|
courseToSociologyEntityMPJLambdaWrapper.selectAll(CourseEntity.class);
|
||||||
wrapper.gt(UserCourseBuyEntity::getEndTime,new Date());
|
courseToSociologyEntityMPJLambdaWrapper.leftJoin(CourseEntity.class,CourseEntity::getId,CourseToSociologyEntity::getCourseId);
|
||||||
List<CourseEntity> courseEntities = userCourseBuyDao.selectJoinList(CourseEntity.class, wrapper);
|
courseToSociologyEntityMPJLambdaWrapper.eq(CourseToSociologyEntity::getSociologyId,c.getId());
|
||||||
return courseEntities;
|
courseToSociologyEntityMPJLambdaWrapper.in(userEntity.getVip().equals("0"),CourseToSociologyEntity::getCourseId,collect);
|
||||||
|
List<CourseEntity> courseEntities = courseToSociologyDao.selectJoinList(CourseEntity.class, courseToSociologyEntityMPJLambdaWrapper);
|
||||||
|
if(courseEntities.size()==0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
stringObjectHashMap.put("sociology",c);
|
||||||
|
stringObjectHashMap.put("courseList",courseEntities);
|
||||||
|
flag.add(stringObjectHashMap);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer catalogueCompletion(CourseCatalogueEntity c){
|
private Integer catalogueCompletion(CourseCatalogueEntity c){
|
||||||
|
|||||||
Reference in New Issue
Block a user