优化我的课程
This commit is contained in:
@@ -162,29 +162,38 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
@Override
|
@Override
|
||||||
public Page<CourseEntity> getUserCourseBuy(Map<String, Object> param) {
|
public Page<CourseEntity> getUserCourseBuy(Map<String, Object> param) {
|
||||||
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.leftJoin(CourseToMedicine.class,CourseToMedicine::getCourseId,CourseEntity::getId);
|
wrapper.rightJoin(CourseToMedicine.class,CourseToMedicine::getCourseId,CourseEntity::getId);
|
||||||
if (userVipService.isSociologyVip()){
|
//开通的会员下的课程
|
||||||
wrapper.leftJoin(CourseCatalogueEntity.class,CourseCatalogueEntity::getCourseId,CourseEntity::getId);
|
List list = new ArrayList<>();//通过顶级标签获取最下层标签
|
||||||
wrapper.leftJoin(UserCourseBuyEntity.class,UserCourseBuyEntity::getCatalogueId,CourseCatalogueEntity::getId);
|
if (userVipService.isMedicalVip()){
|
||||||
wrapper.eq(UserCourseBuyEntity::getUserId,ShiroUtils.getUId());
|
userVipService.bottomLabel(1,list);
|
||||||
|
}
|
||||||
|
if (userVipService.isChineseWesternVip()){
|
||||||
|
userVipService.bottomLabel(74,list);
|
||||||
|
}
|
||||||
|
if (userVipService.isAcupunctureVip()){
|
||||||
|
userVipService.bottomLabel(2,list);
|
||||||
|
}
|
||||||
|
if (userVipService.istumorVip()){
|
||||||
|
userVipService.bottomLabel(5,list);
|
||||||
|
}
|
||||||
|
if (userVipService.isPsycheVip()){
|
||||||
|
userVipService.bottomLabel(4,list);
|
||||||
|
}
|
||||||
|
//购买的课程
|
||||||
|
List buyList = userCourseBuyDao.selectList(new LambdaQueryWrapper<UserCourseBuyEntity>()
|
||||||
|
.eq(UserCourseBuyEntity::getUserId,ShiroUtils.getUId()))
|
||||||
|
.stream().map(UserCourseBuyEntity::getCourseId).collect(Collectors.toList());
|
||||||
|
if (list.size()>0&&buyList.size()>0){
|
||||||
|
wrapper.and(t->t.in(CourseToMedicine::getMedicalId,list).or().in(CourseToMedicine::getCourseId,buyList));
|
||||||
}else {
|
}else {
|
||||||
List list = new ArrayList<>();//通过顶级标签获取最下层标签
|
if (list.size()>0){
|
||||||
if (userVipService.isMedicalVip()){
|
wrapper.in(CourseToMedicine::getMedicalId,list);
|
||||||
userVipService.bottomLabel(1,list);
|
}else if (buyList.size()>0){
|
||||||
|
wrapper.in(CourseToMedicine::getCourseId,buyList);
|
||||||
|
}else {
|
||||||
|
return new Page<>();
|
||||||
}
|
}
|
||||||
if (userVipService.isChineseWesternVip()){
|
|
||||||
userVipService.bottomLabel(74,list);
|
|
||||||
}
|
|
||||||
if (userVipService.isAcupunctureVip()){
|
|
||||||
userVipService.bottomLabel(2,list);
|
|
||||||
}
|
|
||||||
if (userVipService.istumorVip()){
|
|
||||||
userVipService.bottomLabel(5,list);
|
|
||||||
}
|
|
||||||
if (userVipService.isPsycheVip()){
|
|
||||||
userVipService.bottomLabel(4,list);
|
|
||||||
}
|
|
||||||
wrapper.in(CourseToMedicine::getMedicalId,list);
|
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(param.get("medicalId").toString())){
|
if (StringUtils.isNotEmpty(param.get("medicalId").toString())){
|
||||||
wrapper.eq(CourseToMedicine::getMedicalId,param.get("medicalId"));
|
wrapper.eq(CourseToMedicine::getMedicalId,param.get("medicalId"));
|
||||||
|
|||||||
Reference in New Issue
Block a user