命名错误,课程营销标签分开的bug
This commit is contained in:
@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.common.utils.ShiroUtils;
|
||||
import com.peanut.modules.common.entity.CourseEntity;
|
||||
import com.peanut.modules.common.entity.CourseMarketEntity;
|
||||
import com.peanut.modules.common.entity.CourseMedical;
|
||||
import com.peanut.modules.common.entity.CourseMedicineMarketEntity;
|
||||
import com.peanut.modules.common.entity.CourseMedicine;
|
||||
import com.peanut.modules.common.to.ParamTo;
|
||||
import com.peanut.modules.medical.service.CourseMarketService;
|
||||
import com.peanut.modules.medical.service.CourseMedicalService;
|
||||
@@ -32,7 +32,7 @@ public class HomeController {
|
||||
//获取医学标签列表
|
||||
@RequestMapping("/getMedicalLabels")
|
||||
public R getMedicalLabels(@RequestBody ParamTo param){
|
||||
List<CourseMedical> sociologyLabels = medicalService.getMedicalLabels(param.getId());
|
||||
List<CourseMedicine> sociologyLabels = medicalService.getMedicalLabels(param.getId());
|
||||
return R.ok().put("labels",sociologyLabels);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class HomeController {
|
||||
*/
|
||||
@RequestMapping(path = "/courseMarketTree")
|
||||
public R courseMarketTree() {
|
||||
List<CourseMarketEntity> labelsTree = courseMarketService.courseMarketTree();
|
||||
List<CourseMedicineMarketEntity> labelsTree = courseMarketService.courseMarketTree();
|
||||
return R.ok().put("result", labelsTree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.peanut.modules.medical.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.CourseMarketEntity;
|
||||
import com.peanut.modules.common.entity.CourseMedicineMarketEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CourseMarketService extends IService<CourseMarketEntity> {
|
||||
public interface CourseMarketService extends IService<CourseMedicineMarketEntity> {
|
||||
|
||||
List<CourseMarketEntity> courseMarketTree();
|
||||
List<CourseMedicineMarketEntity> courseMarketTree();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.peanut.modules.medical.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.CourseMedical;
|
||||
import com.peanut.modules.common.entity.CourseMedicine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CourseMedicalService extends IService<CourseMedical> {
|
||||
public interface CourseMedicalService extends IService<CourseMedicine> {
|
||||
|
||||
List<CourseMedical> getMedicalLabels(Integer id);
|
||||
List<CourseMedicine> getMedicalLabels(Integer id);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.peanut.modules.medical.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.peanut.modules.common.dao.CourseMarketDao;
|
||||
import com.peanut.modules.common.entity.CourseMarketEntity;
|
||||
import com.peanut.modules.common.dao.CourseMedicineMarketDao;
|
||||
import com.peanut.modules.common.entity.CourseMedicineMarketEntity;
|
||||
import com.peanut.modules.medical.service.CourseMarketService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -14,15 +14,15 @@ import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service("medicalCourseMarketService")
|
||||
public class CourseMarketServiceImpl extends ServiceImpl<CourseMarketDao, CourseMarketEntity> implements CourseMarketService {
|
||||
public class CourseMarketServiceImpl extends ServiceImpl<CourseMedicineMarketDao, CourseMedicineMarketEntity> implements CourseMarketService {
|
||||
|
||||
@Autowired
|
||||
private CourseMarketDao courseMarketDao;
|
||||
private CourseMedicineMarketDao courseMedicineMarketDao;
|
||||
|
||||
@Override
|
||||
public List<CourseMarketEntity> courseMarketTree() {
|
||||
List<CourseMarketEntity> markets = courseMarketDao.selectList(new QueryWrapper<>());
|
||||
List<CourseMarketEntity> marketsTree = markets.stream().filter((courseMarketEntity) ->
|
||||
public List<CourseMedicineMarketEntity> courseMarketTree() {
|
||||
List<CourseMedicineMarketEntity> markets = courseMedicineMarketDao.selectList(new QueryWrapper<>());
|
||||
List<CourseMedicineMarketEntity> marketsTree = markets.stream().filter((courseMarketEntity) ->
|
||||
courseMarketEntity.getPid() == 0
|
||||
).map((market)->{
|
||||
market.setChildren(getMarketChildrens(market,markets));
|
||||
@@ -33,8 +33,8 @@ public class CourseMarketServiceImpl extends ServiceImpl<CourseMarketDao, Course
|
||||
return marketsTree;
|
||||
}
|
||||
|
||||
private List<CourseMarketEntity> getMarketChildrens(CourseMarketEntity root,List<CourseMarketEntity> all){
|
||||
List<CourseMarketEntity> children = all.stream().filter(courseMarketEntity -> {
|
||||
private List<CourseMedicineMarketEntity> getMarketChildrens(CourseMedicineMarketEntity root, List<CourseMedicineMarketEntity> all){
|
||||
List<CourseMedicineMarketEntity> children = all.stream().filter(courseMarketEntity -> {
|
||||
return root.getId().equals(courseMarketEntity.getPid());
|
||||
}).map(courseMarketEntity -> {
|
||||
courseMarketEntity.setChildren(getMarketChildrens(courseMarketEntity, all));
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.peanut.modules.medical.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.peanut.modules.common.dao.CourseMedicalDao;
|
||||
import com.peanut.modules.common.entity.CourseMedical;
|
||||
import com.peanut.modules.common.dao.CourseMedicineDao;
|
||||
import com.peanut.modules.common.entity.CourseMedicine;
|
||||
import com.peanut.modules.medical.service.CourseMedicalService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -11,14 +11,14 @@ import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service("medicineCourseMedicalService")
|
||||
public class CourseMedicalServiceImpl extends ServiceImpl<CourseMedicalDao, CourseMedical> implements CourseMedicalService {
|
||||
public class CourseMedicalServiceImpl extends ServiceImpl<CourseMedicineDao, CourseMedicine> implements CourseMedicalService {
|
||||
|
||||
@Override
|
||||
public List<CourseMedical> getMedicalLabels(Integer id) {
|
||||
LambdaQueryWrapper<CourseMedical> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CourseMedical::getPid,id);
|
||||
wrapper.orderByAsc(CourseMedical::getSort);
|
||||
List<CourseMedical> list = this.list(wrapper);
|
||||
public List<CourseMedicine> getMedicalLabels(Integer id) {
|
||||
LambdaQueryWrapper<CourseMedicine> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CourseMedicine::getPid,id);
|
||||
wrapper.orderByAsc(CourseMedicine::getSort);
|
||||
List<CourseMedicine> list = this.list(wrapper);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.modules.common.dao.CourseDao;
|
||||
import com.peanut.modules.common.entity.CourseEntity;
|
||||
import com.peanut.modules.common.entity.CourseToMarketEntity;
|
||||
import com.peanut.modules.common.entity.CourseToMedical;
|
||||
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
||||
import com.peanut.modules.common.entity.CourseToMedicine;
|
||||
import com.peanut.modules.common.entity.UserToCourseEntity;
|
||||
import com.peanut.modules.common.to.ParamTo;
|
||||
import com.peanut.modules.medical.service.CourseService;
|
||||
@@ -23,8 +23,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
public Page<CourseEntity> getMedicalCourseList(ParamTo param) {
|
||||
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(CourseEntity.class);
|
||||
wrapper.leftJoin(CourseToMedical.class,CourseToMedical::getCourseId,CourseEntity::getId);
|
||||
wrapper.eq(CourseToMedical::getMedicalId,param.getId());
|
||||
wrapper.leftJoin(CourseToMedicine.class, CourseToMedicine::getCourseId,CourseEntity::getId);
|
||||
wrapper.eq(CourseToMedicine::getMedicalId,param.getId());
|
||||
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()),CourseEntity.class, wrapper);
|
||||
return courseEntityPage;
|
||||
}
|
||||
@@ -33,8 +33,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
public Page<CourseEntity> getMarketCourseList(ParamTo param) {
|
||||
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(CourseEntity.class);
|
||||
wrapper.leftJoin(CourseToMarketEntity.class,CourseToMarketEntity::getCourseId,CourseEntity::getId);
|
||||
wrapper.eq(CourseToMarketEntity::getMarketId,param.getId());
|
||||
wrapper.leftJoin(CourseToMedicineMarketEntity.class, CourseToMedicineMarketEntity::getCourseId,CourseEntity::getId);
|
||||
wrapper.eq(CourseToMedicineMarketEntity::getMedicineMarketId,param.getId());
|
||||
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), CourseEntity.class, wrapper);
|
||||
return courseEntityPage;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
public List<CourseEntity> getUserLateCourseList(ParamTo param) {
|
||||
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(CourseEntity.class);
|
||||
wrapper.rightJoin(CourseToMedical.class,CourseToMedical::getCourseId,CourseEntity::getId);
|
||||
wrapper.rightJoin(CourseToMedicine.class, CourseToMedicine::getCourseId,CourseEntity::getId);
|
||||
wrapper.leftJoin(UserToCourseEntity.class,UserToCourseEntity::getCourseId,CourseEntity::getId);
|
||||
wrapper.eq(UserToCourseEntity::getUserId,param.getId());
|
||||
wrapper.orderByDesc(UserToCourseEntity::getUpdateTime);
|
||||
|
||||
Reference in New Issue
Block a user