Merge branch 'master' of https://gitee.com/wjl2008_admin/nuttyreading-java into zcc
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
package com.peanut.modules.master.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.CourseMarketEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CourseMarketService extends IService<CourseMarketEntity> {
|
||||
|
||||
List<CourseMarketEntity> marketTree();
|
||||
|
||||
}
|
||||
@@ -2,13 +2,13 @@ package com.peanut.modules.master.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.entity.CourseMedical;
|
||||
import com.peanut.modules.common.entity.CourseMedicine;
|
||||
import java.util.List;
|
||||
|
||||
public interface CourseMedicalService extends IService<CourseMedical> {
|
||||
List<CourseMedical> getCourseMedicalList();
|
||||
public interface CourseMedicalService extends IService<CourseMedicine> {
|
||||
List<CourseMedicine> getCourseMedicalList();
|
||||
|
||||
R delCourseMedical(int id);
|
||||
|
||||
R editCourseMedical(CourseMedical courseMedical);
|
||||
R editCourseMedical(CourseMedicine courseMedicine);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.peanut.modules.master.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.CourseMedicineMarketEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CourseMedicineMarketService extends IService<CourseMedicineMarketEntity> {
|
||||
|
||||
List<CourseMedicineMarketEntity> marketTree();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.peanut.modules.master.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.CourseMedicineMarketEntity;
|
||||
import com.peanut.modules.common.entity.CourseSociologyMarketEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CourseSociologyMarketService extends IService<CourseSociologyMarketEntity> {
|
||||
|
||||
List<CourseSociologyMarketEntity> marketTree();
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.peanut.modules.master.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.CourseToMarketEntity;
|
||||
|
||||
public interface CourseToMarketService extends IService<CourseToMarketEntity> {
|
||||
}
|
||||
@@ -2,9 +2,9 @@ package com.peanut.modules.master.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.entity.CourseToMedical;
|
||||
import com.peanut.modules.common.entity.CourseToMedicine;
|
||||
|
||||
public interface CourseToMedicalService extends IService<CourseToMedical> {
|
||||
public interface CourseToMedicalService extends IService<CourseToMedicine> {
|
||||
|
||||
R bindCourseAndMedical(CourseToMedical toMedical);
|
||||
R bindCourseAndMedical(CourseToMedicine toMedical);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.peanut.modules.master.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
||||
|
||||
public interface CourseToMedicineMarketService extends IService<CourseToMedicineMarketEntity> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.peanut.modules.master.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
||||
import com.peanut.modules.common.entity.CourseToSociologyMarketEntity;
|
||||
|
||||
public interface CourseToSociologyMarketService extends IService<CourseToSociologyMarketEntity> {
|
||||
}
|
||||
@@ -2,9 +2,9 @@ package com.peanut.modules.master.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.master.service.CourseMarketService;
|
||||
import com.peanut.modules.common.dao.CourseMedicineMarketDao;
|
||||
import com.peanut.modules.common.entity.CourseMedicineMarketEntity;
|
||||
import com.peanut.modules.master.service.CourseMedicineMarketService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -13,16 +13,16 @@ import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service("masterCourseMarketService")
|
||||
public class CourseMarketServiceImpl extends ServiceImpl<CourseMarketDao, CourseMarketEntity> implements CourseMarketService {
|
||||
public class CourseMedicineMarketServiceImpl extends ServiceImpl<CourseMedicineMarketDao, CourseMedicineMarketEntity> implements CourseMedicineMarketService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private CourseMarketDao marketDao;
|
||||
private CourseMedicineMarketDao marketDao;
|
||||
|
||||
@Override
|
||||
public List<CourseMarketEntity> marketTree() {
|
||||
List<CourseMarketEntity> markets = marketDao.selectList(new QueryWrapper<>());
|
||||
List<CourseMarketEntity> marketsTree = markets.stream().filter((courseMarketEntity) ->
|
||||
public List<CourseMedicineMarketEntity> marketTree() {
|
||||
List<CourseMedicineMarketEntity> markets = marketDao.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));
|
||||
@@ -3,10 +3,10 @@ package com.peanut.modules.master.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.dao.CourseMedicalDao;
|
||||
import com.peanut.modules.common.dao.CourseToMedicalDao;
|
||||
import com.peanut.modules.common.entity.CourseMedical;
|
||||
import com.peanut.modules.common.entity.CourseToMedical;
|
||||
import com.peanut.modules.common.dao.CourseMedicineDao;
|
||||
import com.peanut.modules.common.dao.CourseToMedicineDao;
|
||||
import com.peanut.modules.common.entity.CourseMedicine;
|
||||
import com.peanut.modules.common.entity.CourseToMedicine;
|
||||
import com.peanut.modules.master.service.CourseMedicalService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -16,25 +16,25 @@ import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service("masterCourseMedicalService")
|
||||
public class CourseMedicalServiceImpl extends ServiceImpl<CourseMedicalDao, CourseMedical> implements CourseMedicalService {
|
||||
public class CourseMedicineServiceImpl extends ServiceImpl<CourseMedicineDao, CourseMedicine> implements CourseMedicalService {
|
||||
|
||||
@Autowired
|
||||
private CourseToMedicalDao toMedicalDao;
|
||||
private CourseToMedicineDao toMedicalDao;
|
||||
|
||||
@Override
|
||||
public List<CourseMedical> getCourseMedicalList() {
|
||||
public List<CourseMedicine> getCourseMedicalList() {
|
||||
return this.medicals(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R delCourseMedical(int id) {
|
||||
//查看下一级是否存在
|
||||
int count = this.count(new LambdaQueryWrapper<CourseMedical>().eq(CourseMedical::getPid, id));
|
||||
int count = this.count(new LambdaQueryWrapper<CourseMedicine>().eq(CourseMedicine::getPid, id));
|
||||
if(count>0){
|
||||
return R.error(501,"删除失败,请先删除子项目后再尝试");
|
||||
}
|
||||
//查看绑定关系是否存在
|
||||
Integer integer = toMedicalDao.selectCount(new LambdaQueryWrapper<CourseToMedical>().eq(CourseToMedical::getMedicalId, id));
|
||||
Integer integer = toMedicalDao.selectCount(new LambdaQueryWrapper<CourseToMedicine>().eq(CourseToMedicine::getMedicalId, id));
|
||||
if(integer>0){
|
||||
return R.error(502,"删除失败,请先解绑课程与国学标签的绑定关系");
|
||||
}
|
||||
@@ -43,29 +43,29 @@ public class CourseMedicalServiceImpl extends ServiceImpl<CourseMedicalDao, Cour
|
||||
}
|
||||
|
||||
@Override
|
||||
public R editCourseMedical(CourseMedical courseMedical) {
|
||||
CourseMedical old = this.getById(courseMedical.getId());
|
||||
if(old.getIsLast()==0&&courseMedical.getIsLast()==1){
|
||||
CourseMedical one = this.getOne(new LambdaQueryWrapper<CourseMedical>().eq(CourseMedical::getPid, courseMedical.getId()));
|
||||
public R editCourseMedical(CourseMedicine courseMedicine) {
|
||||
CourseMedicine old = this.getById(courseMedicine.getId());
|
||||
if(old.getIsLast()==0&& courseMedicine.getIsLast()==1){
|
||||
CourseMedicine one = this.getOne(new LambdaQueryWrapper<CourseMedicine>().eq(CourseMedicine::getPid, courseMedicine.getId()));
|
||||
if(one!=null){
|
||||
return R.error(501,"更新失败,请先清空此项的下级标签,才能将此标签变成终极标签");
|
||||
}
|
||||
}
|
||||
if(old.getIsLast()==1&&courseMedical.getIsLast()==0){
|
||||
CourseToMedical courseToSociologyEntity = toMedicalDao.selectOne(new LambdaQueryWrapper<CourseToMedical>().eq(CourseToMedical::getMedicalId, courseMedical.getId()));
|
||||
if(old.getIsLast()==1&& courseMedicine.getIsLast()==0){
|
||||
CourseToMedicine courseToSociologyEntity = toMedicalDao.selectOne(new LambdaQueryWrapper<CourseToMedicine>().eq(CourseToMedicine::getMedicalId, courseMedicine.getId()));
|
||||
if(courseToSociologyEntity!=null){
|
||||
return R.error(502,"更新失败,请先把此项与课程的关联关系清空后才可把此标签变成普通标签");
|
||||
}
|
||||
}
|
||||
this.updateById(courseMedical);
|
||||
return R.ok().put("sociology",courseMedical);
|
||||
this.updateById(courseMedicine);
|
||||
return R.ok().put("sociology", courseMedicine);
|
||||
}
|
||||
|
||||
private List<CourseMedical> medicals(int id){
|
||||
List<CourseMedical> list = this.list(new LambdaQueryWrapper<CourseMedical>().eq(CourseMedical::getPid, id));
|
||||
for (CourseMedical c : list){
|
||||
private List<CourseMedicine> medicals(int id){
|
||||
List<CourseMedicine> list = this.list(new LambdaQueryWrapper<CourseMedicine>().eq(CourseMedicine::getPid, id));
|
||||
for (CourseMedicine c : list){
|
||||
if(c.getIsLast()!=1){
|
||||
List<CourseMedical> so = this.medicals(c.getId());
|
||||
List<CourseMedicine> so = this.medicals(c.getId());
|
||||
c.setChildren(so);
|
||||
}
|
||||
}
|
||||
@@ -23,18 +23,14 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
@Service("masterCourseService")
|
||||
public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> implements CourseService {
|
||||
@Autowired
|
||||
private CourseCategoryDao courseCategoryDao;
|
||||
@Autowired
|
||||
private CourseToCategoryDao courseToCategoryDao;
|
||||
@Autowired
|
||||
private CourseSociologyDao courseSociologyDao;
|
||||
@Autowired
|
||||
private CourseToSociologyDao courseToSociologyDao;
|
||||
@Autowired
|
||||
private CourseMedicalDao medicalDao;
|
||||
private CourseMedicineDao medicalDao;
|
||||
@Autowired
|
||||
private CourseToMedicalDao toMedicalDao;
|
||||
private CourseToMedicineDao toMedicalDao;
|
||||
@Autowired
|
||||
private CourseCatalogueDao courseCatalogueDao;
|
||||
@Autowired
|
||||
@@ -47,37 +43,6 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
Integer limit = Integer.valueOf(map.get("limit").toString());
|
||||
Integer page = Integer.valueOf(map.get("page").toString());
|
||||
LambdaQueryWrapper<CourseEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
if(map.get("type").toString().equals("1")){
|
||||
Integer categoryId = Integer.valueOf(map.get("categoryId").toString());
|
||||
List<Integer> collect;
|
||||
if(categoryId==0){
|
||||
LambdaQueryWrapper<CourseCategoryEntity> courseCategoryEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
courseCategoryEntityLambdaQueryWrapper.eq(CourseCategoryEntity::getIsLast,1);
|
||||
collect = courseCategoryDao.selectList(courseCategoryEntityLambdaQueryWrapper).stream().map(CourseCategoryEntity::getId).collect(Collectors.toList());
|
||||
}else{
|
||||
collect = this.categoryIds(categoryId);
|
||||
}
|
||||
if(collect.size()>0){
|
||||
List<Integer> collect1 = courseToCategoryDao.selectList(new LambdaQueryWrapper<CourseToCategoryEntity>().in(CourseToCategoryEntity::getCategoryId, collect)).stream().map(CourseToCategoryEntity::getCourseId).collect(Collectors.toList());
|
||||
wrapper.in(collect1.size()>0,CourseEntity::getId,collect1);
|
||||
}else{
|
||||
return new Page();
|
||||
}
|
||||
} else if (map.get("type").toString().equals("2")) {
|
||||
Integer sociologyId = Integer.valueOf(map.get("sociologyId").toString());
|
||||
List<Integer> c;
|
||||
if(sociologyId==0){
|
||||
c = courseSociologyDao.selectList(new LambdaQueryWrapper<CourseSociologyEntity>().eq(CourseSociologyEntity::getIsLast,1)).stream().map(CourseSociologyEntity::getId).collect(Collectors.toList());
|
||||
}else{
|
||||
c = this.sociologyIds(sociologyId);
|
||||
}
|
||||
if(c.size()>0){
|
||||
List<Integer> collect = courseToSociologyDao.selectList(new LambdaQueryWrapper<CourseToSociologyEntity>().in(CourseToSociologyEntity::getSociologyId, c)).stream().map(CourseToSociologyEntity::getCourseId).collect(Collectors.toList());
|
||||
wrapper.in(collect.size()>0,CourseEntity::getId,collect);
|
||||
}else{
|
||||
return new Page();
|
||||
}
|
||||
}
|
||||
|
||||
if(ObjectUtils.isNotBlank(map,"keywords")){
|
||||
wrapper.like(CourseEntity::getTitle,map.get("keywords").toString());
|
||||
@@ -129,20 +94,20 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
|
||||
@Override
|
||||
public List<CourseEntity> getCourseListForMedical(int medicalId) {
|
||||
MPJLambdaWrapper<CourseToMedical> wrapper = new MPJLambdaWrapper<>();
|
||||
MPJLambdaWrapper<CourseToMedicine> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(CourseEntity.class);
|
||||
wrapper.selectAs(CourseToMedical::getId,"bindId");
|
||||
wrapper.selectAs(CourseToMedical::getSort,"toSociologySort");
|
||||
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId,CourseToMedical::getCourseId);
|
||||
wrapper.eq(CourseToMedical::getMedicalId,medicalId);
|
||||
wrapper.orderByAsc(CourseToMedical::getSort);
|
||||
wrapper.selectAs(CourseToMedicine::getId,"bindId");
|
||||
wrapper.selectAs(CourseToMedicine::getSort,"toSociologySort");
|
||||
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId, CourseToMedicine::getCourseId);
|
||||
wrapper.eq(CourseToMedicine::getMedicalId,medicalId);
|
||||
wrapper.orderByAsc(CourseToMedicine::getSort);
|
||||
List<CourseEntity> courseEntities = toMedicalDao.selectJoinList(CourseEntity.class, wrapper);
|
||||
return courseEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page getCourseListCanMedical(ParamTo param) {
|
||||
List<Integer> collect = toMedicalDao.selectList(new LambdaQueryWrapper<CourseToMedical>().eq(CourseToMedical::getMedicalId, param.getId())).stream().map(CourseToMedical::getCourseId).collect(Collectors.toList());
|
||||
List<Integer> collect = toMedicalDao.selectList(new LambdaQueryWrapper<CourseToMedicine>().eq(CourseToMedicine::getMedicalId, param.getId())).stream().map(CourseToMedicine::getCourseId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<CourseEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
if (collect.size() != 0){
|
||||
wrapper.notIn(CourseEntity::getId,collect);
|
||||
@@ -192,20 +157,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
}
|
||||
}
|
||||
|
||||
private List<Integer> categoryIds(Integer id){
|
||||
ArrayList<Integer> integers = new ArrayList<>();
|
||||
CourseCategoryEntity courseCategoryEntity = courseCategoryDao.selectById(id);
|
||||
if(courseCategoryEntity.getIsLast()==1){
|
||||
integers.add(id);
|
||||
}else{
|
||||
List<CourseCategoryEntity> courseCategoryEntities = courseCategoryDao.selectList(new LambdaQueryWrapper<CourseCategoryEntity>().eq(CourseCategoryEntity::getPid, id));
|
||||
for (CourseCategoryEntity c : courseCategoryEntities ){
|
||||
List<Integer> integers1 = this.categoryIds(c.getId());
|
||||
integers.addAll(integers1);
|
||||
}
|
||||
}
|
||||
return integers;
|
||||
}
|
||||
|
||||
|
||||
private List<Integer> sociologyIds(Integer id){
|
||||
ArrayList<Integer> integers = new ArrayList<>();
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.peanut.modules.master.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.peanut.modules.common.dao.CourseMedicineMarketDao;
|
||||
import com.peanut.modules.common.dao.CourseSociologyMarketDao;
|
||||
import com.peanut.modules.common.entity.CourseMedicineMarketEntity;
|
||||
import com.peanut.modules.common.entity.CourseSociologyMarketEntity;
|
||||
import com.peanut.modules.master.service.CourseMedicineMarketService;
|
||||
import com.peanut.modules.master.service.CourseSociologyMarketService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service("masterCourseSociologyMarketService")
|
||||
public class CourseSociologyMarketServiceImpl extends ServiceImpl<CourseSociologyMarketDao, CourseSociologyMarketEntity> implements CourseSociologyMarketService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private CourseSociologyMarketDao marketDao;
|
||||
|
||||
@Override
|
||||
public List<CourseSociologyMarketEntity> marketTree() {
|
||||
List<CourseSociologyMarketEntity> markets = marketDao.selectList(new QueryWrapper<>());
|
||||
List<CourseSociologyMarketEntity> marketsTree = markets.stream().filter((courseSociologyMarketEntity) ->
|
||||
courseSociologyMarketEntity.getPid() == 0
|
||||
).map((market)->{
|
||||
market.setChildren(getMarketChildrens(market,markets));
|
||||
return market;
|
||||
}).sorted((sort1,sort2)->{
|
||||
return (sort1.getSort() == null? 0 : sort1.getSort()) - (sort2.getSort()==null?0:sort2.getSort());
|
||||
}).collect(Collectors.toList());
|
||||
return marketsTree;
|
||||
}
|
||||
|
||||
private List<CourseSociologyMarketEntity> getMarketChildrens(CourseSociologyMarketEntity root, List<CourseSociologyMarketEntity> all){
|
||||
List<CourseSociologyMarketEntity> children = all.stream().filter(CourseSociologyMarketEntity -> {
|
||||
return root.getId().equals(CourseSociologyMarketEntity.getPid());
|
||||
}).map(courseMarketEntity -> {
|
||||
courseMarketEntity.setChildren(getMarketChildrens(courseMarketEntity, all));
|
||||
return courseMarketEntity;
|
||||
}).sorted((sort1,sort2)->{
|
||||
return (sort1.getSort()==null?0:sort1.getSort()) - (sort2.getSort()==null?0:sort2.getSort());
|
||||
}).collect(Collectors.toList());
|
||||
return children;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.peanut.modules.master.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.peanut.modules.common.dao.CourseToMarketDao;
|
||||
import com.peanut.modules.common.entity.CourseToMarketEntity;
|
||||
import com.peanut.modules.master.service.CourseToMarketService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service("masterCourseToMarketService")
|
||||
public class CourseToMarketServiceImpl extends ServiceImpl<CourseToMarketDao, CourseToMarketEntity> implements CourseToMarketService {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.peanut.modules.master.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.peanut.modules.common.dao.CourseToMedicineMarketDao;
|
||||
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
||||
import com.peanut.modules.master.service.CourseToMedicineMarketService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service("masterCourseToMarketService")
|
||||
public class CourseToMedicineMarketServiceImpl extends ServiceImpl<CourseToMedicineMarketDao, CourseToMedicineMarketEntity> implements CourseToMedicineMarketService {
|
||||
}
|
||||
@@ -3,19 +3,19 @@ package com.peanut.modules.master.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.dao.CourseToMedicalDao;
|
||||
import com.peanut.modules.common.entity.CourseToMedical;
|
||||
import com.peanut.modules.common.dao.CourseToMedicineDao;
|
||||
import com.peanut.modules.common.entity.CourseToMedicine;
|
||||
import com.peanut.modules.master.service.CourseToMedicalService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service("masterCourseToMedicalService")
|
||||
public class CourseToMedicalServiceImpl extends ServiceImpl<CourseToMedicalDao, CourseToMedical> implements CourseToMedicalService {
|
||||
public class CourseToMedicineServiceImpl extends ServiceImpl<CourseToMedicineDao, CourseToMedicine> implements CourseToMedicalService {
|
||||
@Override
|
||||
public R bindCourseAndMedical(CourseToMedical toMedical) {
|
||||
public R bindCourseAndMedical(CourseToMedicine toMedical) {
|
||||
//去重
|
||||
CourseToMedical one = this.getOne(new LambdaQueryWrapper<CourseToMedical>().eq(CourseToMedical::getCourseId, toMedical.getCourseId()).eq(CourseToMedical::getMedicalId, toMedical.getMedicalId()));
|
||||
CourseToMedicine one = this.getOne(new LambdaQueryWrapper<CourseToMedicine>().eq(CourseToMedicine::getCourseId, toMedical.getCourseId()).eq(CourseToMedicine::getMedicalId, toMedical.getMedicalId()));
|
||||
if(one != null){
|
||||
return R.error(501,"绑定失败,绑定关系已将存在");
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.peanut.modules.master.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.peanut.modules.common.dao.CourseToMedicineMarketDao;
|
||||
import com.peanut.modules.common.dao.CourseToSociologyMarketDao;
|
||||
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
||||
import com.peanut.modules.common.entity.CourseToSociologyMarketEntity;
|
||||
import com.peanut.modules.master.service.CourseToMedicineMarketService;
|
||||
import com.peanut.modules.master.service.CourseToSociologyMarketService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service("masterCourseToSociologyMarketService")
|
||||
public class CourseToSociologyMarketServiceImpl extends ServiceImpl<CourseToSociologyMarketDao, CourseToSociologyMarketEntity> implements CourseToSociologyMarketService {
|
||||
}
|
||||
Reference in New Issue
Block a user