This commit is contained in:
wangjinlei
2024-05-09 18:08:37 +08:00
parent 14c70bb6c5
commit 452a246875
5 changed files with 21 additions and 8 deletions

View File

@@ -14,4 +14,6 @@ public class CourseCatalogueVo {
private String CourseCatalogueTitle;
private String image;
private Integer days;
}

View File

@@ -5,6 +5,7 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.R;
import com.peanut.modules.common.entity.BookEntity;
import com.peanut.modules.common.entity.ShopProduct;
import com.peanut.modules.common.entity.ShopProductCourseEntity;
import com.peanut.modules.common.to.ParamTo;
import com.peanut.modules.common.vo.CourseCatalogueVo;
import com.peanut.modules.master.service.ShopProductService;
@@ -182,6 +183,11 @@ public class ShopProductController {
return R.ok().put("page",canBindProductAndCourse);
}
@RequestMapping("/bindProductAndCourse")
public R bindProductAndCourse(@RequestBody ShopProductCourseEntity shopProductCourseEntity){
shopProductService.bindProductAndCourse(shopProductCourseEntity);
return null;
}

View File

@@ -3,10 +3,7 @@ package com.peanut.modules.master.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.common.utils.R;
import com.peanut.modules.common.entity.BookEntity;
import com.peanut.modules.common.entity.CourseCatalogueEntity;
import com.peanut.modules.common.entity.CourseEntity;
import com.peanut.modules.common.entity.ShopProduct;
import com.peanut.modules.common.entity.*;
import com.peanut.modules.common.to.ParamTo;
import com.peanut.modules.common.vo.CourseCatalogueVo;
@@ -55,4 +52,6 @@ public interface ShopProductService extends IService<ShopProduct> {
List<CourseCatalogueVo> getHasBindProductAndCourse(int productId);
Map<String, Object> getCanBindProductAndCourse(ParamTo param);
void bindProductAndCourse(ShopProductCourseEntity shopProductCourseEntity);
}

View File

@@ -233,6 +233,7 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
wrapper.select(CourseEntity::getImage);
wrapper.selectAs(CourseEntity::getId,"courseId");
wrapper.selectAs(CourseCatalogueEntity::getId,"catalogueId");
wrapper.select(ShopProductCourseEntity::getDays);
wrapper.leftJoin(CourseCatalogueEntity.class,CourseCatalogueEntity::getId,ShopProductCourseEntity::getCatalogueId);
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId,ShopProductCourseEntity::getCourseId);
wrapper.eq(ShopProductCourseEntity::getProductId,productId);
@@ -255,6 +256,11 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
return flag;
}
@Override
public void bindProductAndCourse(ShopProductCourseEntity shopProductCourseEntity) {
}
@Override
public Map<String, Object> getProductToLabel(Integer productId) {
HashMap<String, Object> flag = new HashMap<>();

View File

@@ -4,10 +4,10 @@
<mapper namespace="com.peanut.modules.common.dao.CourseCatalogueDao">
<select id="getCanBindProductAndCourse" resultType="com.peanut.modules.common.vo.CourseCatalogueVo">
select
t1.id as courseId,
t2.id as courseCatalogueId,
t1.title as courseTitle,
t2.title as CourseCatalogueTitle,
t2.id as courseId,
t1.id as catalogueId,
t2.title as courseTitle,
t1.title as CourseCatalogueTitle,
t2.image
from course_catalogue t1
left join course t2 on t1.course_id = t2.id