Merge branch 'master' of https://gitee.com/wjl2008_admin/nuttyreading-java into zcc
This commit is contained in:
@@ -79,6 +79,19 @@ public class BookLabelAndMarketController {
|
|||||||
return R.ok().put("result", marketTopList);
|
return R.ok().put("result", marketTopList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑商品和营销标签的排序权重
|
||||||
|
* @param map
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/editMarketSort")
|
||||||
|
public R editMarketSort(@RequestBody Map<String,Integer> map){
|
||||||
|
ShopProductToBookMarket toMarket = toMarketService.getById(map.get("id"));
|
||||||
|
toMarket.setSort(map.get("sort"));
|
||||||
|
toMarketService.updateById(toMarket);
|
||||||
|
return R.ok().put("result",toMarket);
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/getLabelById")
|
@RequestMapping(path = "/getLabelById")
|
||||||
public R getLabelById(String id) {
|
public R getLabelById(String id) {
|
||||||
return R.ok().put("result",labelService.getById(id));
|
return R.ok().put("result",labelService.getById(id));
|
||||||
@@ -279,6 +292,7 @@ public class BookLabelAndMarketController {
|
|||||||
if (params.containsKey("bookMarketId")&&!"".equals(params.get("bookMarketId").toString())){
|
if (params.containsKey("bookMarketId")&&!"".equals(params.get("bookMarketId").toString())){
|
||||||
wrapper.eq(ShopProductToBookMarket::getBookMarketId,params.get("bookMarketId").toString());
|
wrapper.eq(ShopProductToBookMarket::getBookMarketId,params.get("bookMarketId").toString());
|
||||||
}
|
}
|
||||||
|
wrapper.orderByAsc(ShopProductBookMarket::getSort);
|
||||||
Page<ShopProductToBookMarket> page = toMarketService.page(new Page<>(
|
Page<ShopProductToBookMarket> page = toMarketService.page(new Page<>(
|
||||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
List<ShopProductToBookMarket> res = page.getRecords();
|
List<ShopProductToBookMarket> res = page.getRecords();
|
||||||
@@ -361,7 +375,8 @@ public class BookLabelAndMarketController {
|
|||||||
wrapper.eq(ShopProductToBookLabel::getBookLabelId,labelId);
|
wrapper.eq(ShopProductToBookLabel::getBookLabelId,labelId);
|
||||||
wrapper.leftJoin(ShopProduct.class,ShopProduct::getProductId,ShopProductToBookLabel::getProductId);
|
wrapper.leftJoin(ShopProduct.class,ShopProduct::getProductId,ShopProductToBookLabel::getProductId);
|
||||||
wrapper.selectAll(ShopProduct.class);
|
wrapper.selectAll(ShopProduct.class);
|
||||||
wrapper.orderByAsc(ShopProductToBookLabel::getSort);
|
// wrapper.orderByAsc(ShopProductToBookLabel::getSort);
|
||||||
|
wrapper.orderByDesc(ShopProduct::getSumSales);
|
||||||
List list = toLabelService.listMaps(wrapper);
|
List list = toLabelService.listMaps(wrapper);
|
||||||
return R.ok().put("result", list);
|
return R.ok().put("result", list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -247,7 +247,13 @@ public class BuyOrderController {
|
|||||||
totalPrice = totalPrice.add(getShoppingAmount(buyOrder));
|
totalPrice = totalPrice.add(getShoppingAmount(buyOrder));
|
||||||
|
|
||||||
//减去积分抵扣
|
//减去积分抵扣
|
||||||
totalPrice = totalPrice.subtract(buyOrder.getJfDeduction());
|
|
||||||
|
totalPrice = totalPrice.subtract(buyOrder.getJfDeduction()==null?BigDecimal.ZERO:buyOrder.getJfDeduction());
|
||||||
|
|
||||||
|
|
||||||
|
if(buyOrder.getRealMoney().compareTo(totalPrice)!=0){
|
||||||
|
return R.error("系统错误订单金额异常!");
|
||||||
|
}
|
||||||
|
|
||||||
String orderSn = IdWorker.getTimeId().substring(0, 32);
|
String orderSn = IdWorker.getTimeId().substring(0, 32);
|
||||||
buyOrder.setOrderSn(orderSn);
|
buyOrder.setOrderSn(orderSn);
|
||||||
@@ -293,7 +299,7 @@ public class BuyOrderController {
|
|||||||
recordTransaction(buyOrder, user, totalPrice);
|
recordTransaction(buyOrder, user, totalPrice);
|
||||||
}
|
}
|
||||||
//记录用户积分消费情况
|
//记录用户积分消费情况
|
||||||
if(buyOrder.getJfDeduction().compareTo(BigDecimal.ZERO) > 0){
|
if(buyOrder.getJfDeduction()!=null&&buyOrder.getJfDeduction().compareTo(BigDecimal.ZERO) > 0){
|
||||||
recordJfTransaction(buyOrder, user, buyOrder.getJfDeduction());
|
recordJfTransaction(buyOrder, user, buyOrder.getJfDeduction());
|
||||||
}
|
}
|
||||||
//消费用户积分并记录用户积分消费记录
|
//消费用户积分并记录用户积分消费记录
|
||||||
@@ -874,6 +880,9 @@ public class BuyOrderController {
|
|||||||
|
|
||||||
|
|
||||||
private boolean useJfCoin(MyUserEntity user,BigDecimal jf){
|
private boolean useJfCoin(MyUserEntity user,BigDecimal jf){
|
||||||
|
if(jf==null){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if(user.getJf().compareTo(jf)>=0){
|
if(user.getJf().compareTo(jf)>=0){
|
||||||
user.setJf(user.getJf().subtract(jf));
|
user.setJf(user.getJf().subtract(jf));
|
||||||
this.myUserService.updateById(user);
|
this.myUserService.updateById(user);
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ public class ShopProductController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取关联订单列表
|
* 获取关联商品列表
|
||||||
*
|
*
|
||||||
* @param productId
|
* @param productId
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.common.dao;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.peanut.modules.common.entity.SysCourseDirectEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SysCourseDirectDao extends MPJBaseMapper<SysCourseDirectEntity> {
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.peanut.modules.common.entity;
|
package com.peanut.modules.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
@@ -18,8 +19,17 @@ public class CourseToMedicineMarketEntity {
|
|||||||
|
|
||||||
private Integer medicineMarketId;
|
private Integer medicineMarketId;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CourseMedicineMarketEntity courseMedicineMarketEntity;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CourseEntity courseEntity;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.peanut.modules.common.entity;
|
package com.peanut.modules.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
@@ -18,8 +19,17 @@ public class CourseToSociologyMarketEntity {
|
|||||||
|
|
||||||
private Integer sociologyMarketId;
|
private Integer sociologyMarketId;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CourseSociologyMarketEntity courseSociologyMarketEntity;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CourseEntity courseEntity;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.peanut.modules.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("sys_course_direct")
|
||||||
|
public class SysCourseDirectEntity {
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
private String buyRecord;
|
||||||
|
|
||||||
|
private String useRecord;
|
||||||
|
|
||||||
|
private String studyRecord;
|
||||||
|
|
||||||
|
private String vipRecord;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.peanut.modules.common.to;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EditCourseRecordDto {
|
||||||
|
private Integer type;
|
||||||
|
private Integer recordType;
|
||||||
|
private String content;
|
||||||
|
}
|
||||||
@@ -1,17 +1,13 @@
|
|||||||
package com.peanut.modules.master.controller;
|
package com.peanut.modules.master.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.common.dao.CourseCatalogueChapterVideoDao;
|
import com.peanut.modules.common.dao.CourseCatalogueChapterVideoDao;
|
||||||
import com.peanut.modules.common.entity.CourseCatalogueChapterEntity;
|
import com.peanut.modules.common.entity.*;
|
||||||
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
|
import com.peanut.modules.common.to.EditCourseRecordDto;
|
||||||
import com.peanut.modules.common.entity.CourseCatalogueEntity;
|
|
||||||
import com.peanut.modules.common.entity.CourseEntity;
|
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
import com.peanut.modules.master.service.CourseCatalogueChapterService;
|
import com.peanut.modules.master.service.*;
|
||||||
import com.peanut.modules.master.service.CourseCatalogueChapterVideoService;
|
|
||||||
import com.peanut.modules.master.service.CourseCatalogueService;
|
|
||||||
import com.peanut.modules.master.service.CourseService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@@ -34,6 +30,8 @@ public class CourseController {
|
|||||||
private CourseCatalogueChapterService courseCatalogueChapterService;
|
private CourseCatalogueChapterService courseCatalogueChapterService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CourseCatalogueChapterVideoService courseCatalogueChapterVideoService;
|
private CourseCatalogueChapterVideoService courseCatalogueChapterVideoService;
|
||||||
|
@Autowired
|
||||||
|
private SysCourseDirectService sysCourseDirectService;
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/getCourseList")
|
@RequestMapping("/getCourseList")
|
||||||
@@ -129,6 +127,26 @@ public class CourseController {
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取课程说明
|
||||||
|
* @param map
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getCourseRecord")
|
||||||
|
public R getCourseRecord(@RequestBody Map<String,Integer> map){
|
||||||
|
SysCourseDirectEntity info = sysCourseDirectService.getOne(new LambdaQueryWrapper<SysCourseDirectEntity>().eq(SysCourseDirectEntity::getType, map.get("type")));
|
||||||
|
return R.ok().put("result",info);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/editCourseRecord")
|
||||||
|
public R editCourseRecord(@RequestBody EditCourseRecordDto editCourseRecordDto){
|
||||||
|
SysCourseDirectEntity sysCourseDirectEntity = sysCourseDirectService.editCourseRecord(editCourseRecordDto);
|
||||||
|
return R.ok().put("result",sysCourseDirectEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/editCourseCatalogueChapterVideo")
|
@RequestMapping("/editCourseCatalogueChapterVideo")
|
||||||
public R editCourseCatalogueChapterVideo(@RequestBody CourseCatalogueChapterVideoEntity courseCatalogueChapterVideoEntity){
|
public R editCourseCatalogueChapterVideo(@RequestBody CourseCatalogueChapterVideoEntity courseCatalogueChapterVideoEntity){
|
||||||
courseCatalogueChapterVideoService.updateById(courseCatalogueChapterVideoEntity);
|
courseCatalogueChapterVideoService.updateById(courseCatalogueChapterVideoEntity);
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package com.peanut.modules.master.controller;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.peanut.common.utils.ObjectUtils;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.common.entity.CourseEntity;
|
import com.peanut.modules.common.entity.*;
|
||||||
import com.peanut.modules.common.entity.CourseMedicineMarketEntity;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
|
||||||
import com.peanut.modules.master.service.CourseMedicineMarketService;
|
import com.peanut.modules.master.service.CourseMedicineMarketService;
|
||||||
import com.peanut.modules.master.service.CourseService;
|
import com.peanut.modules.master.service.CourseService;
|
||||||
import com.peanut.modules.master.service.CourseToMedicineMarketService;
|
import com.peanut.modules.master.service.CourseToMedicineMarketService;
|
||||||
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController("masterCourseMedicineMarket")
|
@RestController("masterCourseMedicineMarket")
|
||||||
@@ -40,58 +41,41 @@ public class CourseMedicineMarketController {
|
|||||||
return R.ok().put("result", marketsTree);
|
return R.ok().put("result", marketsTree);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取营销标签列表
|
|
||||||
*/
|
|
||||||
@RequestMapping(path = "/getMakertListByPid")
|
|
||||||
public R getMakertListByPid(String pid) {
|
|
||||||
LambdaQueryWrapper<CourseMedicineMarketEntity> wrapper = new LambdaQueryWrapper();
|
|
||||||
wrapper.eq(CourseMedicineMarketEntity::getPid,pid);
|
|
||||||
wrapper.orderByAsc(CourseMedicineMarketEntity::getSort);
|
|
||||||
wrapper.orderByAsc(CourseMedicineMarketEntity::getCreateTime);
|
|
||||||
List<CourseMedicineMarketEntity> marketTopList = marketService.list(wrapper);
|
|
||||||
return R.ok().put("result", marketTopList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping(path = "/getMarketById")
|
@RequestMapping(path = "/getMarketById")
|
||||||
public R getMarketById(String id) {
|
public R getMarketById(@RequestBody Map<String,Integer> map) {
|
||||||
|
int id = map.get("id");
|
||||||
return R.ok().put("result",marketService.getById(id));
|
return R.ok().put("result",marketService.getById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/saveOrUpdateMarket")
|
@RequestMapping("/addSociologyMarket")
|
||||||
public R saveOrUpdateMarket(@RequestBody CourseMedicineMarketEntity market) {
|
public R addSociologyMarket(@RequestBody CourseMedicineMarketEntity courseMedicineMarketEntity){
|
||||||
if (market.getId()==null){
|
marketService.save(courseMedicineMarketEntity);
|
||||||
if(market.getPid()==0){
|
return R.ok().put("result",courseMedicineMarketEntity);
|
||||||
marketService.save(market);
|
}
|
||||||
return R.ok().put("result",market);
|
|
||||||
}else {
|
@RequestMapping("/editSociologyMarket")
|
||||||
CourseMedicineMarketEntity m = marketService.getById(market.getPid());
|
public R editSociologyMarket(@RequestBody CourseMedicineMarketEntity courseMedicineMarketEntity){
|
||||||
if (m.getIsLast()==1){
|
CourseMedicineMarketEntity old = marketService.getById(courseMedicineMarketEntity.getId());
|
||||||
return R.error("请将父标签设置为非最后一集");
|
if(courseMedicineMarketEntity.getIsLast()==1&&old.getIsLast()==0){//非终节点到终结点,要排除是否存在子集
|
||||||
}else {
|
Integer integer = marketService.getBaseMapper().selectCount(new LambdaQueryWrapper<CourseMedicineMarketEntity>().eq(CourseMedicineMarketEntity::getPid, courseMedicineMarketEntity.getId()));
|
||||||
marketService.save(market);
|
if(integer>0){
|
||||||
return R.ok().put("result",market);
|
return R.error("请先清空子集再操作!");
|
||||||
}
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
if (market.getIsLast() == 1){
|
|
||||||
List mList = marketService.list(new LambdaQueryWrapper<CourseMedicineMarketEntity>()
|
|
||||||
.eq(CourseMedicineMarketEntity::getPid,market.getId()));
|
|
||||||
if (mList.size()>0){
|
|
||||||
return R.error("请先删除子集,再设置为最后一集");
|
|
||||||
}else {
|
|
||||||
marketService.saveOrUpdate(market);
|
|
||||||
return R.ok().put("result",market);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
marketService.saveOrUpdate(market);
|
|
||||||
return R.ok().put("result",market);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(courseMedicineMarketEntity.getIsLast()==0&&old.getIsLast()==1){
|
||||||
|
Integer integer = toMarketService.getBaseMapper().selectCount(new LambdaQueryWrapper<CourseToMedicineMarketEntity>().eq(CourseToMedicineMarketEntity::getMedicineMarketId, courseMedicineMarketEntity.getId()));
|
||||||
|
if(integer>0){
|
||||||
|
return R.error("请先清空绑定的课程后,再操作");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
marketService.updateById(courseMedicineMarketEntity);
|
||||||
|
return R.ok().put("result",courseMedicineMarketEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/delMarket")
|
@RequestMapping(path = "/delMarket")
|
||||||
public R delMarket(String id) {
|
public R delMarket(@RequestBody Map<String ,Integer> map) {
|
||||||
|
int id = map.get("id");
|
||||||
CourseMedicineMarketEntity market = marketService.getById(id);
|
CourseMedicineMarketEntity market = marketService.getById(id);
|
||||||
if (market.getIsLast()==1){
|
if (market.getIsLast()==1){
|
||||||
MPJLambdaWrapper<CourseToMedicineMarketEntity> wrapper = new MPJLambdaWrapper();
|
MPJLambdaWrapper<CourseToMedicineMarketEntity> wrapper = new MPJLambdaWrapper();
|
||||||
@@ -114,66 +98,55 @@ public class CourseMedicineMarketController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取营销标签下课程
|
|
||||||
*/
|
|
||||||
@RequestMapping(path = "/getCourseByMarketId")
|
@RequestMapping(path = "/getCourseByMarketId")
|
||||||
public R getCourseByMarket(@RequestBody Map<String, Object> params) {
|
public R getCourseByMarketId(@RequestBody Map<String,Integer> map){
|
||||||
MPJLambdaWrapper<CourseToMedicineMarketEntity> wrapper = new MPJLambdaWrapper();
|
int marketId = map.get("marketId");
|
||||||
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId, CourseToMedicineMarketEntity::getCourseId);
|
List<CourseToMedicineMarketEntity> courseByMarketId = toMarketService.getCourseByMarketId(marketId);
|
||||||
wrapper.selectAll(CourseEntity.class);
|
return R.ok().put("list",courseByMarketId);
|
||||||
wrapper.like(CourseEntity::getTitle,params.get("title"));
|
}
|
||||||
wrapper.eq(CourseToMedicineMarketEntity::getMedicineMarketId,params.get("marketId"));
|
|
||||||
Page res = toMarketService.pageMaps(new Page<>(
|
@RequestMapping("/editMarketSort")
|
||||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())), wrapper);
|
public R editMarketSort(@RequestBody Map<String,Integer> map){
|
||||||
return R.ok().put("result", res);
|
CourseToMedicineMarketEntity info = toMarketService.getOne(new LambdaQueryWrapper<CourseToMedicineMarketEntity>().eq(CourseToMedicineMarketEntity::getCourseId, map.get("courseId")).eq(CourseToMedicineMarketEntity::getMedicineMarketId, map.get("marketId")),false);
|
||||||
|
info.setSort(map.get("sort"));
|
||||||
|
toMarketService.updateById(info);
|
||||||
|
return R.ok().put("result",info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取未关联课程列表
|
* 获取未关联课程列表
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/getNotToMarketList")
|
@RequestMapping("/getNotToMarketList")
|
||||||
public R getNotToMarketList(@RequestBody Map params){
|
public R getNotToMarketList(@RequestBody ParamTo param){
|
||||||
LambdaQueryWrapper<CourseEntity> wrapper = new LambdaQueryWrapper();
|
List<Integer> collect1 = toMarketService.getBaseMapper().selectList(new LambdaQueryWrapper<CourseToMedicineMarketEntity>().eq(CourseToMedicineMarketEntity::getMedicineMarketId, param.getId())).stream().map(CourseToMedicineMarketEntity::getCourseId).collect(Collectors.toList());
|
||||||
wrapper.like(CourseEntity::getTitle,params.get("title"));
|
LambdaQueryWrapper<CourseEntity> wrapper1 = new LambdaQueryWrapper<>();
|
||||||
if (params.containsKey("marketId")&&!"".equals(params.get("marketId").toString())){
|
wrapper1.notIn(collect1.size()>0,CourseEntity::getId,collect1);
|
||||||
String sql = "select course_id from course_to_market where del_flag = 0 and market_id = "+params.get("marketId");
|
wrapper1.like(StringUtils.isNotBlank(param.getKeywords()),CourseEntity::getTitle,param.getKeywords());
|
||||||
wrapper.notInSql(CourseEntity::getId,sql);
|
Page<CourseEntity> page1 = courseService.page(new Page<>(param.getPage(), param.getLimit()), wrapper1);
|
||||||
}
|
return R.ok().put("page",page1);
|
||||||
Page<CourseEntity> page = courseService.page(new Page<>(
|
|
||||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
|
||||||
return R.ok().put("result", page);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/saveToMarket")
|
@RequestMapping("/bindCourseAndMedicineMarket")
|
||||||
public R saveToMarket(@RequestBody Map params) {
|
public R bindCourseAndMedicineMarket(@RequestBody Map<String,Integer> map){
|
||||||
if (!StringUtils.isEmpty(params.get("courseId").toString())){
|
int marketId = map.get("marketId");
|
||||||
String[] ids = params.get("courseId").toString().split(",");
|
int courseId = map.get("courseId");
|
||||||
if (ids.length > 0) {
|
Integer integer = toMarketService.getBaseMapper().selectCount(new LambdaQueryWrapper<CourseToMedicineMarketEntity>().eq(CourseToMedicineMarketEntity::getMedicineMarketId, marketId).eq(CourseToMedicineMarketEntity::getCourseId, courseId));
|
||||||
for (String id : ids) {
|
if(integer>0){
|
||||||
CourseToMedicineMarketEntity toMarket = new CourseToMedicineMarketEntity();
|
return R.error("不可重复绑定");
|
||||||
toMarket.setMedicineMarketId(Integer.parseInt(params.get("marketId").toString()));
|
|
||||||
toMarket.setCourseId(Integer.parseInt(id));
|
|
||||||
toMarketService.save(toMarket);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
CourseToMedicineMarketEntity courseToMedicineMarketEntity = new CourseToMedicineMarketEntity();
|
||||||
|
courseToMedicineMarketEntity.setMedicineMarketId(marketId);
|
||||||
|
courseToMedicineMarketEntity.setCourseId(courseId);
|
||||||
|
toMarketService.save(courseToMedicineMarketEntity);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/delToMarket")
|
@RequestMapping("/unbindCourseAndMedicineMarket")
|
||||||
public R delToMarket(String marketId,String courseId) {
|
public R unbindCourseAndMedicineMarket(@RequestBody Map<String,Integer> map){
|
||||||
if(StringUtils.isNotEmpty(courseId)){
|
int marketId = map.get("marketId");
|
||||||
String[] productIds = courseId.split(",");
|
int courseId = map.get("courseId");
|
||||||
for(String id : productIds){
|
toMarketService.getBaseMapper().delete(new LambdaQueryWrapper<CourseToMedicineMarketEntity>().eq(CourseToMedicineMarketEntity::getMedicineMarketId,marketId).eq(CourseToMedicineMarketEntity::getCourseId,courseId));
|
||||||
LambdaQueryWrapper<CourseToMedicineMarketEntity> wrapper = new LambdaQueryWrapper();
|
return R.ok();
|
||||||
wrapper.eq(CourseToMedicineMarketEntity::getMedicineMarketId,marketId);
|
|
||||||
wrapper.eq(CourseToMedicineMarketEntity::getCourseId,id);
|
|
||||||
toMarketService.remove(wrapper);
|
|
||||||
}
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
return R.error("参数为空");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package com.peanut.modules.master.controller;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.peanut.common.utils.ObjectUtils;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.common.entity.*;
|
import com.peanut.modules.common.entity.*;
|
||||||
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
import com.peanut.modules.master.service.*;
|
import com.peanut.modules.master.service.*;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController("masterCourseSociologyMarket")
|
@RestController("masterCourseSociologyMarket")
|
||||||
@@ -37,58 +40,41 @@ public class CourseSociologyMarketController {
|
|||||||
return R.ok().put("result", courseSociologyMarketEntities);
|
return R.ok().put("result", courseSociologyMarketEntities);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取营销标签列表
|
|
||||||
*/
|
|
||||||
@RequestMapping(path = "/getMakertListByPid")
|
|
||||||
public R getMakertListByPid(String pid) {
|
|
||||||
LambdaQueryWrapper<CourseSociologyMarketEntity> wrapper = new LambdaQueryWrapper();
|
|
||||||
wrapper.eq(CourseSociologyMarketEntity::getPid,pid);
|
|
||||||
wrapper.orderByAsc(CourseSociologyMarketEntity::getSort);
|
|
||||||
wrapper.orderByAsc(CourseSociologyMarketEntity::getCreateTime);
|
|
||||||
List<CourseSociologyMarketEntity> marketTopList = marketService.list(wrapper);
|
|
||||||
return R.ok().put("result", marketTopList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping(path = "/getMarketById")
|
@RequestMapping(path = "/getMarketById")
|
||||||
public R getMarketById(String id) {
|
public R getMarketById(@RequestBody Map<String,Integer> map) {
|
||||||
|
int id = map.get("id");
|
||||||
return R.ok().put("result",marketService.getById(id));
|
return R.ok().put("result",marketService.getById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/saveOrUpdateMarket")
|
@RequestMapping("/addSociologyMarket")
|
||||||
public R saveOrUpdateMarket(@RequestBody CourseSociologyMarketEntity market) {
|
public R addSociologyMarket(@RequestBody CourseSociologyMarketEntity courseSociologyMarketEntity){
|
||||||
if (market.getId()==null){
|
marketService.save(courseSociologyMarketEntity);
|
||||||
if(market.getPid()==0){
|
return R.ok().put("market",courseSociologyMarketEntity);
|
||||||
marketService.save(market);
|
}
|
||||||
return R.ok().put("result",market);
|
|
||||||
}else {
|
@RequestMapping("/editSociologyMarket")
|
||||||
CourseSociologyMarketEntity m = marketService.getById(market.getPid());
|
public R editSociologyMarket(@RequestBody CourseSociologyMarketEntity courseSociologyMarketEntity){
|
||||||
if (m.getIsLast()==1){
|
CourseSociologyMarketEntity old = marketService.getById(courseSociologyMarketEntity.getId());
|
||||||
return R.error("请将父标签设置为非最后一集");
|
if(courseSociologyMarketEntity.getIsLast()==1&&old.getIsLast()==0){//非终节点到终结点,要排除是否存在子集
|
||||||
}else {
|
Integer integer = marketService.getBaseMapper().selectCount(new LambdaQueryWrapper<CourseSociologyMarketEntity>().eq(CourseSociologyMarketEntity::getPid, courseSociologyMarketEntity.getId()));
|
||||||
marketService.save(market);
|
if(integer>0){
|
||||||
return R.ok().put("result",market);
|
return R.error("请先清空子集再操作!");
|
||||||
}
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
if (market.getIsLast() == 1){
|
|
||||||
List mList = marketService.list(new LambdaQueryWrapper<CourseSociologyMarketEntity>()
|
|
||||||
.eq(CourseSociologyMarketEntity::getPid,market.getId()));
|
|
||||||
if (mList.size()>0){
|
|
||||||
return R.error("请先删除子集,再设置为最后一集");
|
|
||||||
}else {
|
|
||||||
marketService.saveOrUpdate(market);
|
|
||||||
return R.ok().put("result",market);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
marketService.saveOrUpdate(market);
|
|
||||||
return R.ok().put("result",market);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(courseSociologyMarketEntity.getIsLast()==0&&old.getIsLast()==1){
|
||||||
|
Integer integer = toMarketService.getBaseMapper().selectCount(new LambdaQueryWrapper<CourseToSociologyMarketEntity>().eq(CourseToSociologyMarketEntity::getSociologyMarketId, courseSociologyMarketEntity.getId()));
|
||||||
|
if(integer>0){
|
||||||
|
return R.error("请先清空绑定的课程后,再操作");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
marketService.updateById(courseSociologyMarketEntity);
|
||||||
|
return R.ok().put("market",courseSociologyMarketEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/delMarket")
|
@RequestMapping(path = "/delMarket")
|
||||||
public R delMarket(String id) {
|
public R delMarket(@RequestBody Map<String ,Integer> map) {
|
||||||
|
int id = map.get("id");
|
||||||
CourseSociologyMarketEntity market = marketService.getById(id);
|
CourseSociologyMarketEntity market = marketService.getById(id);
|
||||||
if (market.getIsLast()==1){
|
if (market.getIsLast()==1){
|
||||||
MPJLambdaWrapper<CourseToSociologyMarketEntity> wrapper = new MPJLambdaWrapper();
|
MPJLambdaWrapper<CourseToSociologyMarketEntity> wrapper = new MPJLambdaWrapper();
|
||||||
@@ -111,66 +97,115 @@ public class CourseSociologyMarketController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/editMarketSort")
|
||||||
|
public R editMarketSort(@RequestBody Map<String,Integer> map){
|
||||||
|
CourseToSociologyMarketEntity info = toMarketService.getOne(new LambdaQueryWrapper<CourseToSociologyMarketEntity>()
|
||||||
|
.eq(CourseToSociologyMarketEntity::getSociologyMarketId, map.get("marketId"))
|
||||||
|
.eq(CourseToSociologyMarketEntity::getCourseId, map.get("courseId")), false);
|
||||||
|
info.setSort(map.get("sort"));
|
||||||
|
toMarketService.updateById(info);
|
||||||
|
return R.ok().put("result",info);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getCourseListByMarketId")
|
||||||
|
public R getCourseListByMarketId(@RequestBody Map<String,Integer> map){
|
||||||
|
List<CourseToSociologyMarketEntity> marketId = toMarketService.getCourseListByMarketId(map.get("marketId"));
|
||||||
|
return R.ok().put("list",marketId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取营销标签下课程
|
* 获取营销标签下课程
|
||||||
*/
|
*/
|
||||||
@RequestMapping(path = "/getCourseByMarketId")
|
// @RequestMapping(path = "/getCourseByMarketId")
|
||||||
public R getCourseByMarket(@RequestBody Map<String, Object> params) {
|
// public R getCourseByMarket(@RequestBody Map<String, Object> params) {
|
||||||
MPJLambdaWrapper<CourseToSociologyMarketEntity> wrapper = new MPJLambdaWrapper();
|
// MPJLambdaWrapper<CourseToSociologyMarketEntity> wrapper = new MPJLambdaWrapper();
|
||||||
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId, CourseToSociologyMarketEntity::getCourseId);
|
// wrapper.leftJoin(CourseEntity.class,CourseEntity::getId, CourseToSociologyMarketEntity::getCourseId);
|
||||||
wrapper.selectAll(CourseEntity.class);
|
// wrapper.selectAll(CourseEntity.class);
|
||||||
wrapper.like(CourseEntity::getTitle,params.get("title"));
|
// wrapper.like(CourseEntity::getTitle,params.get("title"));
|
||||||
wrapper.eq(CourseToSociologyMarketEntity::getSociologyMarketId,params.get("marketId"));
|
// wrapper.eq(CourseToSociologyMarketEntity::getSociologyMarketId,params.get("marketId"));
|
||||||
Page res = toMarketService.pageMaps(new Page<>(
|
// Page res = toMarketService.pageMaps(new Page<>(
|
||||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())), wrapper);
|
// Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())), wrapper);
|
||||||
return R.ok().put("result", res);
|
// return R.ok().put("result", res);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@RequestMapping("/getNotToMarketList")
|
||||||
|
public R getNotToMarketList(@RequestBody ParamTo param){
|
||||||
|
List<Integer> collect = toMarketService.getBaseMapper().selectList(new LambdaQueryWrapper<CourseToSociologyMarketEntity>().eq(CourseToSociologyMarketEntity::getSociologyMarketId, param.getId())).stream().map(CourseToSociologyMarketEntity::getCourseId).collect(Collectors.toList());
|
||||||
|
LambdaQueryWrapper<CourseEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.notIn(collect.size()>0,CourseEntity::getId,collect);
|
||||||
|
wrapper.like(StringUtils.isNotBlank(param.getKeywords()),CourseEntity::getTitle,param.getKeywords());
|
||||||
|
Page<CourseEntity> page = courseService.page(new Page<>(param.getPage(), param.getLimit()), wrapper);
|
||||||
|
return R.ok().put("page",page);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取未关联课程列表
|
* 获取未关联课程列表
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/getNotToMarketList")
|
// @RequestMapping("/getNotToMarketList")
|
||||||
public R getNotToMarketList(@RequestBody Map params){
|
// public R getNotToMarketList(@RequestBody Map params){
|
||||||
LambdaQueryWrapper<CourseEntity> wrapper = new LambdaQueryWrapper();
|
// LambdaQueryWrapper<CourseEntity> wrapper = new LambdaQueryWrapper();
|
||||||
wrapper.like(CourseEntity::getTitle,params.get("title"));
|
// wrapper.like(CourseEntity::getTitle,params.get("title"));
|
||||||
if (params.containsKey("marketId")&&!"".equals(params.get("marketId").toString())){
|
// if (params.containsKey("marketId")&&!"".equals(params.get("marketId").toString())){
|
||||||
String sql = "select course_id from course_to_market where del_flag = 0 and market_id = "+params.get("marketId");
|
// String sql = "select course_id from course_to_market where del_flag = 0 and market_id = "+params.get("marketId");
|
||||||
wrapper.notInSql(CourseEntity::getId,sql);
|
// wrapper.notInSql(CourseEntity::getId,sql);
|
||||||
}
|
// }
|
||||||
Page<CourseEntity> page = courseService.page(new Page<>(
|
// Page<CourseEntity> page = courseService.page(new Page<>(
|
||||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
// Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
return R.ok().put("result", page);
|
// return R.ok().put("result", page);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@RequestMapping(path = "/saveToMarket")
|
@RequestMapping("/bindCourseAndSociologyMarket")
|
||||||
public R saveToMarket(@RequestBody Map params) {
|
public R bindCourseAndSociologyMarket(@RequestBody Map<String,Integer> map){
|
||||||
if (!StringUtils.isEmpty(params.get("courseId").toString())){
|
int marketId = map.get("marketId");
|
||||||
String[] ids = params.get("courseId").toString().split(",");
|
int courseId = map.get("courseId");
|
||||||
if (ids.length > 0) {
|
Integer integer = toMarketService.getBaseMapper().selectCount(new LambdaQueryWrapper<CourseToSociologyMarketEntity>().eq(CourseToSociologyMarketEntity::getSociologyMarketId, marketId).eq(CourseToSociologyMarketEntity::getCourseId, courseId));
|
||||||
for (String id : ids) {
|
if(integer>0){
|
||||||
CourseToSociologyMarketEntity toMarket = new CourseToSociologyMarketEntity();
|
return R.error("不可重复绑定");
|
||||||
toMarket.setSociologyMarketId(Integer.parseInt(params.get("marketId").toString()));
|
|
||||||
toMarket.setCourseId(Integer.parseInt(id));
|
|
||||||
toMarketService.save(toMarket);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
CourseToSociologyMarketEntity courseToSociologyMarketEntity = new CourseToSociologyMarketEntity();
|
||||||
|
courseToSociologyMarketEntity.setSociologyMarketId(marketId);
|
||||||
|
courseToSociologyMarketEntity.setCourseId(courseId);
|
||||||
|
toMarketService.save(courseToSociologyMarketEntity);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/delToMarket")
|
@RequestMapping("/unbindCourseAndSociologyMarket")
|
||||||
public R delToMarket(String marketId,String courseId) {
|
public R unbindCourseAndSociologyMarket(@RequestBody Map<String,Integer> map){
|
||||||
if(StringUtils.isNotEmpty(courseId)){
|
int marketId = map.get("marketId");
|
||||||
String[] productIds = courseId.split(",");
|
int courseId = map.get("courseId");
|
||||||
for(String id : productIds){
|
toMarketService.getBaseMapper().delete(new LambdaQueryWrapper<CourseToSociologyMarketEntity>().eq(CourseToSociologyMarketEntity::getSociologyMarketId,marketId).eq(CourseToSociologyMarketEntity::getCourseId,courseId));
|
||||||
LambdaQueryWrapper<CourseToSociologyMarketEntity> wrapper = new LambdaQueryWrapper();
|
return R.ok();
|
||||||
wrapper.eq(CourseToSociologyMarketEntity::getSociologyMarketId,marketId);
|
|
||||||
wrapper.eq(CourseToSociologyMarketEntity::getCourseId,id);
|
|
||||||
toMarketService.remove(wrapper);
|
|
||||||
}
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
return R.error("参数为空");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @RequestMapping(path = "/saveToMarket")
|
||||||
|
// public R saveToMarket(@RequestBody Map params) {
|
||||||
|
// if (!StringUtils.isEmpty(params.get("courseId").toString())){
|
||||||
|
// String[] ids = params.get("courseId").toString().split(",");
|
||||||
|
// if (ids.length > 0) {
|
||||||
|
// for (String id : ids) {
|
||||||
|
// CourseToSociologyMarketEntity toMarket = new CourseToSociologyMarketEntity();
|
||||||
|
// toMarket.setSociologyMarketId(Integer.parseInt(params.get("marketId").toString()));
|
||||||
|
// toMarket.setCourseId(Integer.parseInt(id));
|
||||||
|
// toMarketService.save(toMarket);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return R.ok();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @RequestMapping(path = "/delToMarket")
|
||||||
|
// public R delToMarket(String marketId,String courseId) {
|
||||||
|
// if(StringUtils.isNotEmpty(courseId)){
|
||||||
|
// String[] productIds = courseId.split(",");
|
||||||
|
// for(String id : productIds){
|
||||||
|
// LambdaQueryWrapper<CourseToSociologyMarketEntity> wrapper = new LambdaQueryWrapper();
|
||||||
|
// wrapper.eq(CourseToSociologyMarketEntity::getSociologyMarketId,marketId);
|
||||||
|
// wrapper.eq(CourseToSociologyMarketEntity::getCourseId,id);
|
||||||
|
// toMarketService.remove(wrapper);
|
||||||
|
// }
|
||||||
|
// return R.ok();
|
||||||
|
// }
|
||||||
|
// return R.error("参数为空");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,18 @@ public class MedicineLabelAndMarketController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品和营销标签下的排序权重
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/editMarketSort")
|
||||||
|
public R editMarketSort(@RequestBody Map<String,Integer> map){
|
||||||
|
ShopProductToMedicineMarket toMarket = toMarketService.getById(map.get("id"));
|
||||||
|
toMarket.setSort(map.get("sort"));
|
||||||
|
toMarketService.updateById(toMarket);
|
||||||
|
return R.ok().put("result",toMarket);
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/delLabel")
|
@RequestMapping(path = "/delLabel")
|
||||||
public R delLabel(String id) {
|
public R delLabel(String id) {
|
||||||
ShopProductMedicineLabel label = labelService.getById(id);
|
ShopProductMedicineLabel label = labelService.getById(id);
|
||||||
@@ -279,6 +291,7 @@ public class MedicineLabelAndMarketController {
|
|||||||
if (params.containsKey("medicineMarketId")&&!"".equals(params.get("medicineMarketId").toString())){
|
if (params.containsKey("medicineMarketId")&&!"".equals(params.get("medicineMarketId").toString())){
|
||||||
wrapper.eq(ShopProductToMedicineMarket::getMedicineMarketId,params.get("medicineMarketId").toString());
|
wrapper.eq(ShopProductToMedicineMarket::getMedicineMarketId,params.get("medicineMarketId").toString());
|
||||||
}
|
}
|
||||||
|
wrapper.orderByAsc(ShopProductToMedicineMarket::getSort);
|
||||||
Page<ShopProductToMedicineMarket> page = toMarketService.page(new Page<>(
|
Page<ShopProductToMedicineMarket> page = toMarketService.page(new Page<>(
|
||||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
List<ShopProductToMedicineMarket> res = page.getRecords();
|
List<ShopProductToMedicineMarket> res = page.getRecords();
|
||||||
|
|||||||
@@ -226,6 +226,14 @@ public class SociologyLabelAndMarketController {
|
|||||||
return R.ok().put("result", page);
|
return R.ok().put("result", page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/editMarketSort")
|
||||||
|
public R editMarketSort(@RequestBody Map<String,Integer> map){
|
||||||
|
ShopProductToSociologyMarket toMarket = toMarketService.getById(map.get("id"));
|
||||||
|
toMarket.setSort(map.get("sort"));
|
||||||
|
toMarketService.updateById(toMarket);
|
||||||
|
return R.ok().put("market",toMarket);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取书标签列表
|
* 获取书标签列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
package com.peanut.modules.master.service;
|
package com.peanut.modules.master.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.CourseEntity;
|
||||||
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface CourseToMedicineMarketService extends IService<CourseToMedicineMarketEntity> {
|
public interface CourseToMedicineMarketService extends IService<CourseToMedicineMarketEntity> {
|
||||||
|
|
||||||
|
List<CourseToMedicineMarketEntity> getCourseByMarketId(int marketId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
package com.peanut.modules.master.service;
|
package com.peanut.modules.master.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.CourseEntity;
|
||||||
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
||||||
import com.peanut.modules.common.entity.CourseToSociologyMarketEntity;
|
import com.peanut.modules.common.entity.CourseToSociologyMarketEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface CourseToSociologyMarketService extends IService<CourseToSociologyMarketEntity> {
|
public interface CourseToSociologyMarketService extends IService<CourseToSociologyMarketEntity> {
|
||||||
|
|
||||||
|
List<CourseToSociologyMarketEntity> getCourseListByMarketId(int marketId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.peanut.modules.master.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.SysCourseDirectEntity;
|
||||||
|
import com.peanut.modules.common.to.EditCourseRecordDto;
|
||||||
|
|
||||||
|
public interface SysCourseDirectService extends IService<SysCourseDirectEntity> {
|
||||||
|
|
||||||
|
SysCourseDirectEntity editCourseRecord(EditCourseRecordDto editCourseRecordDto);
|
||||||
|
}
|
||||||
@@ -52,8 +52,8 @@ public class CourseMedicineServiceImpl extends ServiceImpl<CourseMedicineDao, Co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(old.getIsLast()==1&& courseMedicine.getIsLast()==0){
|
if(old.getIsLast()==1&& courseMedicine.getIsLast()==0){
|
||||||
CourseToMedicine courseToSociologyEntity = toMedicalDao.selectOne(new LambdaQueryWrapper<CourseToMedicine>().eq(CourseToMedicine::getMedicalId, courseMedicine.getId()));
|
Integer integer = toMedicalDao.selectCount(new LambdaQueryWrapper<CourseToMedicine>().eq(CourseToMedicine::getMedicalId, courseMedicine.getId()));
|
||||||
if(courseToSociologyEntity!=null){
|
if(integer>0){
|
||||||
return R.error(502,"更新失败,请先把此项与课程的关联关系清空后才可把此标签变成普通标签");
|
return R.error(502,"更新失败,请先把此项与课程的关联关系清空后才可把此标签变成普通标签");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,37 @@
|
|||||||
package com.peanut.modules.master.service.impl;
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.peanut.modules.common.dao.CourseDao;
|
||||||
|
import com.peanut.modules.common.dao.CourseMedicineMarketDao;
|
||||||
import com.peanut.modules.common.dao.CourseToMedicineMarketDao;
|
import com.peanut.modules.common.dao.CourseToMedicineMarketDao;
|
||||||
|
import com.peanut.modules.common.entity.CourseEntity;
|
||||||
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
||||||
import com.peanut.modules.master.service.CourseToMedicineMarketService;
|
import com.peanut.modules.master.service.CourseToMedicineMarketService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service("masterCourseToMarketService")
|
@Service("masterCourseToMarketService")
|
||||||
public class CourseToMedicineMarketServiceImpl extends ServiceImpl<CourseToMedicineMarketDao, CourseToMedicineMarketEntity> implements CourseToMedicineMarketService {
|
public class CourseToMedicineMarketServiceImpl extends ServiceImpl<CourseToMedicineMarketDao, CourseToMedicineMarketEntity> implements CourseToMedicineMarketService {
|
||||||
|
@Autowired
|
||||||
|
private CourseMedicineMarketDao courseMedicineMarketDao;
|
||||||
|
@Autowired
|
||||||
|
private CourseDao courseDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CourseToMedicineMarketEntity> getCourseByMarketId(int marketId) {
|
||||||
|
List<CourseToMedicineMarketEntity> courseToMedicineMarketEntities = this.getBaseMapper().selectList(new LambdaQueryWrapper<CourseToMedicineMarketEntity>()
|
||||||
|
.eq(CourseToMedicineMarketEntity::getMedicineMarketId, marketId)
|
||||||
|
.orderByAsc(CourseToMedicineMarketEntity::getSort));
|
||||||
|
for (CourseToMedicineMarketEntity c :courseToMedicineMarketEntities){
|
||||||
|
c.setCourseMedicineMarketEntity(courseMedicineMarketDao.selectById(c.getMedicineMarketId()));
|
||||||
|
c.setCourseEntity(courseDao.selectById(c.getCourseId()));
|
||||||
|
}
|
||||||
|
return courseToMedicineMarketEntities;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,40 @@
|
|||||||
package com.peanut.modules.master.service.impl;
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.peanut.modules.common.dao.CourseDao;
|
||||||
|
import com.peanut.modules.common.dao.CourseSociologyMarketDao;
|
||||||
import com.peanut.modules.common.dao.CourseToMedicineMarketDao;
|
import com.peanut.modules.common.dao.CourseToMedicineMarketDao;
|
||||||
import com.peanut.modules.common.dao.CourseToSociologyMarketDao;
|
import com.peanut.modules.common.dao.CourseToSociologyMarketDao;
|
||||||
|
import com.peanut.modules.common.entity.CourseEntity;
|
||||||
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
|
||||||
import com.peanut.modules.common.entity.CourseToSociologyMarketEntity;
|
import com.peanut.modules.common.entity.CourseToSociologyMarketEntity;
|
||||||
import com.peanut.modules.master.service.CourseToMedicineMarketService;
|
import com.peanut.modules.master.service.CourseToMedicineMarketService;
|
||||||
import com.peanut.modules.master.service.CourseToSociologyMarketService;
|
import com.peanut.modules.master.service.CourseToSociologyMarketService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service("masterCourseToSociologyMarketService")
|
@Service("masterCourseToSociologyMarketService")
|
||||||
public class CourseToSociologyMarketServiceImpl extends ServiceImpl<CourseToSociologyMarketDao, CourseToSociologyMarketEntity> implements CourseToSociologyMarketService {
|
public class CourseToSociologyMarketServiceImpl extends ServiceImpl<CourseToSociologyMarketDao, CourseToSociologyMarketEntity> implements CourseToSociologyMarketService {
|
||||||
|
@Autowired
|
||||||
|
private CourseSociologyMarketDao courseSociologyMarketDao;
|
||||||
|
@Autowired
|
||||||
|
private CourseDao courseDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CourseToSociologyMarketEntity> getCourseListByMarketId(int marketId) {
|
||||||
|
List<CourseToSociologyMarketEntity> courseToSociologyMarketEntities = this.getBaseMapper().selectList(new LambdaQueryWrapper<CourseToSociologyMarketEntity>()
|
||||||
|
.eq(CourseToSociologyMarketEntity::getSociologyMarketId, marketId)
|
||||||
|
.orderByAsc(CourseToSociologyMarketEntity::getSort));
|
||||||
|
for (CourseToSociologyMarketEntity c : courseToSociologyMarketEntities){
|
||||||
|
c.setCourseSociologyMarketEntity(courseSociologyMarketDao.selectById(c.getSociologyMarketId()));
|
||||||
|
c.setCourseEntity(courseDao.selectById(c.getCourseId()));
|
||||||
|
}
|
||||||
|
return courseToSociologyMarketEntities;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
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.modules.common.dao.SysCourseDirectDao;
|
||||||
|
import com.peanut.modules.common.entity.SysCourseDirectEntity;
|
||||||
|
import com.peanut.modules.common.to.EditCourseRecordDto;
|
||||||
|
import com.peanut.modules.master.service.SysCourseDirectService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("masterSysCourseDirect")
|
||||||
|
public class SysCourseDirectServiceImpl extends ServiceImpl<SysCourseDirectDao, SysCourseDirectEntity> implements SysCourseDirectService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysCourseDirectEntity editCourseRecord(EditCourseRecordDto editCourseRecordDto) {
|
||||||
|
SysCourseDirectEntity one = this.getOne(new LambdaQueryWrapper<SysCourseDirectEntity>().eq(SysCourseDirectEntity::getType, editCourseRecordDto.getType()));
|
||||||
|
switch (editCourseRecordDto.getRecordType()){
|
||||||
|
case 0:
|
||||||
|
one.setBuyRecord(editCourseRecordDto.getContent());
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
one.setUseRecord(editCourseRecordDto.getContent());
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
one.setStudyRecord(editCourseRecordDto.getContent());
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
one.setVipRecord(editCourseRecordDto.getContent());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.updateById(one);
|
||||||
|
return one;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,8 +12,10 @@ import com.peanut.modules.common.dao.CourseCatalogueChapterVideoDao;
|
|||||||
import com.peanut.modules.common.entity.CourseCatalogueChapterEntity;
|
import com.peanut.modules.common.entity.CourseCatalogueChapterEntity;
|
||||||
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
|
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
|
||||||
import com.peanut.modules.common.entity.CourseEntity;
|
import com.peanut.modules.common.entity.CourseEntity;
|
||||||
|
import com.peanut.modules.common.entity.SysCourseDirectEntity;
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
import com.peanut.modules.master.service.CourseCatalogueChapterVideoService;
|
import com.peanut.modules.master.service.CourseCatalogueChapterVideoService;
|
||||||
|
import com.peanut.modules.master.service.SysCourseDirectService;
|
||||||
import com.peanut.modules.sociology.service.CourseCatalogueChapterService;
|
import com.peanut.modules.sociology.service.CourseCatalogueChapterService;
|
||||||
import com.peanut.modules.sociology.service.CourseService;
|
import com.peanut.modules.sociology.service.CourseService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -38,6 +40,8 @@ public class CourseController {
|
|||||||
private CourseCatalogueChapterService courseCatalogueChapterService;
|
private CourseCatalogueChapterService courseCatalogueChapterService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CourseCatalogueChapterVideoService courseCatalogueChapterVideoService;
|
private CourseCatalogueChapterVideoService courseCatalogueChapterVideoService;
|
||||||
|
@Autowired
|
||||||
|
private SysCourseDirectService sysCourseDirectService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户最近学习课程列表
|
* 获取用户最近学习课程列表
|
||||||
@@ -53,7 +57,7 @@ public class CourseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取营销标签下的课程列表
|
* 获取国学营销标签下的课程列表
|
||||||
* @param param
|
* @param param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -63,6 +67,26 @@ public class CourseController {
|
|||||||
return R.ok().put("courseList",marketCourseList);
|
return R.ok().put("courseList",marketCourseList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取课程说明
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getSociologyCourseRecord")
|
||||||
|
public R getSociologyCourseRecord(){
|
||||||
|
SysCourseDirectEntity byId = sysCourseDirectService.getById(2);
|
||||||
|
return R.ok().put("result",byId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取国学课程价格
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getCoursePrice")
|
||||||
|
public R getCoursePrice(){
|
||||||
|
List coursePrice = courseService.getCoursePrice();
|
||||||
|
return R.ok().put("list",coursePrice);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取国学标签下的课程列表
|
* 获取国学标签下的课程列表
|
||||||
* @param param
|
* @param param
|
||||||
@@ -136,7 +160,7 @@ public class CourseController {
|
|||||||
|
|
||||||
@RequestMapping("/getMyCourse")
|
@RequestMapping("/getMyCourse")
|
||||||
public R getMyCourse(@RequestBody Map<String,Integer> map){
|
public R getMyCourse(@RequestBody Map<String,Integer> map){
|
||||||
List<CourseEntity> courses = courseService.getMyCourse(map.get("type"));
|
List courses = courseService.getMyCourse(map.get("type"));
|
||||||
return R.ok().put("courses",courses);
|
return R.ok().put("courses",courses);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,5 +22,7 @@ public interface CourseService extends IService<CourseEntity> {
|
|||||||
|
|
||||||
Map<String, Object> getCourseDetail(Integer id);
|
Map<String, Object> getCourseDetail(Integer id);
|
||||||
|
|
||||||
List<CourseEntity> getMyCourse(int type);
|
List getMyCourse(int type);
|
||||||
|
|
||||||
|
List getCoursePrice();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
public Page<CourseEntity> getMarketCourseList(ParamTo param) {
|
public Page<CourseEntity> getMarketCourseList(ParamTo param) {
|
||||||
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.selectAll(CourseEntity.class);
|
wrapper.selectAll(CourseEntity.class);
|
||||||
wrapper.leftJoin(CourseToMedicineMarketEntity.class, CourseToMedicineMarketEntity::getCourseId,CourseEntity::getId);
|
wrapper.leftJoin(CourseToSociologyMarketEntity.class, CourseToSociologyMarketEntity::getCourseId,CourseEntity::getId);
|
||||||
wrapper.eq(CourseToMedicineMarketEntity::getMedicineMarketId,param.getId());
|
wrapper.eq(CourseToSociologyMarketEntity::getSociologyMarketId,param.getId());
|
||||||
wrapper.orderByAsc(CourseToSociologyEntity::getSort);
|
wrapper.orderByAsc(CourseToSociologyEntity::getSort);
|
||||||
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), CourseEntity.class, wrapper);
|
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), CourseEntity.class, wrapper);
|
||||||
return courseEntityPage;
|
return courseEntityPage;
|
||||||
@@ -131,6 +131,32 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List getCoursePrice() {
|
||||||
|
//获取所有国学标签
|
||||||
|
List<CourseSociologyEntity> courseSociologyEntities = courseSociologyDao.selectList(null);
|
||||||
|
ArrayList<Map> flag = new ArrayList<>();
|
||||||
|
for (CourseSociologyEntity c : courseSociologyEntities){
|
||||||
|
HashMap<String, Object> stringObjectHashMap = new HashMap<>();
|
||||||
|
MPJLambdaWrapper<CourseToSociologyEntity> courseToSociologyEntityMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
||||||
|
courseToSociologyEntityMPJLambdaWrapper.selectAll(CourseEntity.class);
|
||||||
|
courseToSociologyEntityMPJLambdaWrapper.leftJoin(CourseEntity.class,CourseEntity::getId,CourseToSociologyEntity::getCourseId);
|
||||||
|
courseToSociologyEntityMPJLambdaWrapper.eq(CourseToSociologyEntity::getSociologyId,c.getId());
|
||||||
|
List<CourseEntity> courseEntities = courseToSociologyDao.selectJoinList(CourseEntity.class, courseToSociologyEntityMPJLambdaWrapper);
|
||||||
|
if(courseEntities.size()==0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (CourseEntity co:courseEntities){
|
||||||
|
List<CourseCatalogueEntity> courseCatalogueEntities = courseCatalogueDao.selectList(new LambdaQueryWrapper<CourseCatalogueEntity>().eq(CourseCatalogueEntity::getCourseId, co.getId()).orderByAsc(CourseCatalogueEntity::getSort));
|
||||||
|
co.setCourseCatalogueEntityList(courseCatalogueEntities);
|
||||||
|
}
|
||||||
|
stringObjectHashMap.put("sociology",c);
|
||||||
|
stringObjectHashMap.put("courseList",courseEntities);
|
||||||
|
flag.add(stringObjectHashMap);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
private Integer catalogueCompletion(CourseCatalogueEntity c){
|
private Integer catalogueCompletion(CourseCatalogueEntity c){
|
||||||
List<CourseCatalogueChapterEntity> courseCatalogueChapterEntities = courseCatalogueChapterDao.selectList(new LambdaQueryWrapper<CourseCatalogueChapterEntity>().eq(CourseCatalogueChapterEntity::getCatalogueId, c.getId()));
|
List<CourseCatalogueChapterEntity> courseCatalogueChapterEntities = courseCatalogueChapterDao.selectList(new LambdaQueryWrapper<CourseCatalogueChapterEntity>().eq(CourseCatalogueChapterEntity::getCatalogueId, c.getId()));
|
||||||
Integer act = 0;
|
Integer act = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user