修改中西汇通和中医学平级,中医学vip可看
This commit is contained in:
@@ -415,6 +415,7 @@ public class UserVipController {
|
|||||||
List list = new ArrayList<>();
|
List list = new ArrayList<>();
|
||||||
if ("4".equals(type)){
|
if ("4".equals(type)){
|
||||||
userVipService.bottomLabel(1,list);
|
userVipService.bottomLabel(1,list);
|
||||||
|
userVipService.bottomLabel(74,list);
|
||||||
}else if ("5".equals(type)){
|
}else if ("5".equals(type)){
|
||||||
userVipService.bottomLabel(2,list);
|
userVipService.bottomLabel(2,list);
|
||||||
}else if ("6".equals(type)){
|
}else if ("6".equals(type)){
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public class UserVipServiceImpl extends ServiceImpl<UserVipDao, UserVip> impleme
|
|||||||
for (CourseToMedicine ctm:list) {
|
for (CourseToMedicine ctm:list) {
|
||||||
CourseMedicine cm = topLabel(ctm.getMedicalId());
|
CourseMedicine cm = topLabel(ctm.getMedicalId());
|
||||||
if (cm != null){
|
if (cm != null){
|
||||||
if ((cm.getId()==1&&userVip.getType()==4)||//中医学
|
if (((cm.getId()==1||cm.getId()==74)&&userVip.getType()==4)||//中医学、中西汇通
|
||||||
(cm.getId()==2&&userVip.getType()==5)||//针灸学
|
(cm.getId()==2&&userVip.getType()==5)||//针灸学
|
||||||
(cm.getId()==5&&userVip.getType()==6)){//肿瘤学
|
(cm.getId()==5&&userVip.getType()==6)){//肿瘤学
|
||||||
return userVip;
|
return userVip;
|
||||||
@@ -166,7 +166,7 @@ public class UserVipServiceImpl extends ServiceImpl<UserVipDao, UserVip> impleme
|
|||||||
.eq(CourseToMedicine::getCourseId,courseId));
|
.eq(CourseToMedicine::getCourseId,courseId));
|
||||||
for (CourseToMedicine ctm:mlist) {
|
for (CourseToMedicine ctm:mlist) {
|
||||||
CourseMedicine cm = topLabel(ctm.getMedicalId());
|
CourseMedicine cm = topLabel(ctm.getMedicalId());
|
||||||
if (cm.getId()==1){//中医学
|
if (cm.getId()==1||cm.getId()==74){//中医学、中西汇通
|
||||||
set.add(4);
|
set.add(4);
|
||||||
}else if (cm.getId() == 2) {//针灸学
|
}else if (cm.getId() == 2) {//针灸学
|
||||||
set.add(5);
|
set.add(5);
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
package com.peanut.modules.medical.controller;
|
package com.peanut.modules.medical.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.common.utils.ShiroUtils;
|
import com.peanut.common.utils.ShiroUtils;
|
||||||
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
|
import com.peanut.modules.common.entity.*;
|
||||||
import com.peanut.modules.common.entity.CourseEntity;
|
|
||||||
import com.peanut.modules.common.entity.CourseMedicine;
|
|
||||||
import com.peanut.modules.common.entity.UserCourseStudying;
|
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
import com.peanut.modules.medical.service.CourseMedicalService;
|
import com.peanut.modules.medical.service.CourseMedicalService;
|
||||||
import com.peanut.modules.medical.service.CourseService;
|
import com.peanut.modules.medical.service.CourseService;
|
||||||
@@ -86,4 +84,18 @@ public class CourseController {
|
|||||||
return R.ok().put("data",courseList);
|
return R.ok().put("data",courseList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//免费课程
|
||||||
|
@RequestMapping("/getFreeCourse")
|
||||||
|
public R getFreeCourse(){
|
||||||
|
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||||
|
wrapper.distinct();
|
||||||
|
wrapper.rightJoin(CourseToMedicine.class,CourseToMedicine::getCourseId,CourseEntity::getId);
|
||||||
|
wrapper.leftJoin(CourseCatalogueEntity.class,CourseCatalogueEntity::getCourseId,CourseEntity::getId);
|
||||||
|
wrapper.eq(CourseCatalogueEntity::getType,0);
|
||||||
|
wrapper.selectAll(CourseEntity.class);
|
||||||
|
wrapper.orderByAsc(CourseEntity::getSort);
|
||||||
|
List<CourseEntity> courseList = courseService.list(wrapper);
|
||||||
|
return R.ok().put("courseList",courseList);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
List list = new ArrayList<>();//通过顶级标签获取最下层标签
|
List list = new ArrayList<>();//通过顶级标签获取最下层标签
|
||||||
if (userVipService.isMedicalVip()){
|
if (userVipService.isMedicalVip()){
|
||||||
userVipService.bottomLabel(1,list);
|
userVipService.bottomLabel(1,list);
|
||||||
|
userVipService.bottomLabel(74,list);
|
||||||
}
|
}
|
||||||
if (userVipService.isAcupunctureVip()){
|
if (userVipService.isAcupunctureVip()){
|
||||||
userVipService.bottomLabel(2,list);
|
userVipService.bottomLabel(2,list);
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ public class PsycheHomeController {
|
|||||||
private CourseCatalogueService courseCatalogueService;
|
private CourseCatalogueService courseCatalogueService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopProductService shopProductService;
|
private ShopProductService shopProductService;
|
||||||
|
@Autowired
|
||||||
|
private com.peanut.modules.book.service.ShopProductService spService;
|
||||||
|
|
||||||
//获取标签列表
|
//获取标签列表
|
||||||
@RequestMapping("/getPsycheLabels")
|
@RequestMapping("/getPsycheLabels")
|
||||||
@@ -80,6 +82,11 @@ public class PsycheHomeController {
|
|||||||
wrapper.orderByAsc(ShopProductToPsycheMarket::getSort);
|
wrapper.orderByAsc(ShopProductToPsycheMarket::getSort);
|
||||||
Page<ShopProduct> shopProductPage = shopProductService.page(new Page<>(
|
Page<ShopProduct> shopProductPage = shopProductService.page(new Page<>(
|
||||||
Long.parseLong(params.get("page").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
Long.parseLong(params.get("page").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
|
for (ShopProduct shopProduct:shopProductPage.getRecords()){
|
||||||
|
if (shopProduct.getIsVipPrice()==1){
|
||||||
|
shopProduct.setVipPrice(spService.getVipPrice(shopProduct));
|
||||||
|
}
|
||||||
|
}
|
||||||
return R.ok().put("shopProductPage",shopProductPage);
|
return R.ok().put("shopProductPage",shopProductPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user