From b753a93a4092f2ecbe8f96b5d3cd9be531f24b77 Mon Sep 17 00:00:00 2001 From: wuchunlei Date: Tue, 11 Mar 2025 10:46:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E8=A5=BF=E6=B1=87?= =?UTF-8?q?=E9=80=9A=E5=92=8C=E4=B8=AD=E5=8C=BB=E5=AD=A6=E5=B9=B3=E7=BA=A7?= =?UTF-8?q?=EF=BC=8C=E4=B8=AD=E5=8C=BB=E5=AD=A6vip=E5=8F=AF=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/UserVipController.java | 1 + .../service/impl/UserVipServiceImpl.java | 4 ++-- .../medical/controller/CourseController.java | 20 +++++++++++++++---- .../service/impl/CourseServiceImpl.java | 1 + .../controller/PsycheHomeController.java | 7 +++++++ 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/peanut/modules/common/controller/UserVipController.java b/src/main/java/com/peanut/modules/common/controller/UserVipController.java index 2044b55f..7836ef74 100644 --- a/src/main/java/com/peanut/modules/common/controller/UserVipController.java +++ b/src/main/java/com/peanut/modules/common/controller/UserVipController.java @@ -415,6 +415,7 @@ public class UserVipController { List list = new ArrayList<>(); if ("4".equals(type)){ userVipService.bottomLabel(1,list); + userVipService.bottomLabel(74,list); }else if ("5".equals(type)){ userVipService.bottomLabel(2,list); }else if ("6".equals(type)){ diff --git a/src/main/java/com/peanut/modules/common/service/impl/UserVipServiceImpl.java b/src/main/java/com/peanut/modules/common/service/impl/UserVipServiceImpl.java index fe6e208a..20eb7562 100644 --- a/src/main/java/com/peanut/modules/common/service/impl/UserVipServiceImpl.java +++ b/src/main/java/com/peanut/modules/common/service/impl/UserVipServiceImpl.java @@ -119,7 +119,7 @@ public class UserVipServiceImpl extends ServiceImpl impleme for (CourseToMedicine ctm:list) { CourseMedicine cm = topLabel(ctm.getMedicalId()); 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()==5&&userVip.getType()==6)){//肿瘤学 return userVip; @@ -166,7 +166,7 @@ public class UserVipServiceImpl extends ServiceImpl impleme .eq(CourseToMedicine::getCourseId,courseId)); for (CourseToMedicine ctm:mlist) { CourseMedicine cm = topLabel(ctm.getMedicalId()); - if (cm.getId()==1){//中医学 + if (cm.getId()==1||cm.getId()==74){//中医学、中西汇通 set.add(4); }else if (cm.getId() == 2) {//针灸学 set.add(5); diff --git a/src/main/java/com/peanut/modules/medical/controller/CourseController.java b/src/main/java/com/peanut/modules/medical/controller/CourseController.java index 80ca69c5..de9f53c7 100644 --- a/src/main/java/com/peanut/modules/medical/controller/CourseController.java +++ b/src/main/java/com/peanut/modules/medical/controller/CourseController.java @@ -1,12 +1,10 @@ package com.peanut.modules.medical.controller; 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.ShiroUtils; -import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity; -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.entity.*; import com.peanut.modules.common.to.ParamTo; import com.peanut.modules.medical.service.CourseMedicalService; import com.peanut.modules.medical.service.CourseService; @@ -86,4 +84,18 @@ public class CourseController { return R.ok().put("data",courseList); } + //免费课程 + @RequestMapping("/getFreeCourse") + public R getFreeCourse(){ + MPJLambdaWrapper 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 courseList = courseService.list(wrapper); + return R.ok().put("courseList",courseList); + } + } diff --git a/src/main/java/com/peanut/modules/medical/service/impl/CourseServiceImpl.java b/src/main/java/com/peanut/modules/medical/service/impl/CourseServiceImpl.java index 79611df7..7933072a 100644 --- a/src/main/java/com/peanut/modules/medical/service/impl/CourseServiceImpl.java +++ b/src/main/java/com/peanut/modules/medical/service/impl/CourseServiceImpl.java @@ -171,6 +171,7 @@ public class CourseServiceImpl extends ServiceImpl impl List list = new ArrayList<>();//通过顶级标签获取最下层标签 if (userVipService.isMedicalVip()){ userVipService.bottomLabel(1,list); + userVipService.bottomLabel(74,list); } if (userVipService.isAcupunctureVip()){ userVipService.bottomLabel(2,list); diff --git a/src/main/java/com/peanut/modules/psyche/controller/PsycheHomeController.java b/src/main/java/com/peanut/modules/psyche/controller/PsycheHomeController.java index e69f02c7..7340fef4 100644 --- a/src/main/java/com/peanut/modules/psyche/controller/PsycheHomeController.java +++ b/src/main/java/com/peanut/modules/psyche/controller/PsycheHomeController.java @@ -35,6 +35,8 @@ public class PsycheHomeController { private CourseCatalogueService courseCatalogueService; @Autowired private ShopProductService shopProductService; + @Autowired + private com.peanut.modules.book.service.ShopProductService spService; //获取标签列表 @RequestMapping("/getPsycheLabels") @@ -80,6 +82,11 @@ public class PsycheHomeController { wrapper.orderByAsc(ShopProductToPsycheMarket::getSort); Page shopProductPage = shopProductService.page(new Page<>( 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); }