|
|
|
|
@@ -9,6 +9,7 @@ import com.peanut.common.utils.R;
|
|
|
|
|
import com.peanut.modules.common.dao.ShopProductToLabelDao;
|
|
|
|
|
import com.peanut.modules.book.service.*;
|
|
|
|
|
import com.peanut.modules.common.entity.*;
|
|
|
|
|
import com.peanut.modules.common.service.CoursePsycheService;
|
|
|
|
|
import com.peanut.modules.common.service.MessageService;
|
|
|
|
|
import com.peanut.modules.common.to.ParamTo;
|
|
|
|
|
import com.peanut.modules.medical.service.CourseMedicalService;
|
|
|
|
|
@@ -18,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RestController
|
|
|
|
|
@@ -58,6 +60,8 @@ public class VisitorController {
|
|
|
|
|
private MessageService messageService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private com.peanut.modules.sociology.service.ShopProductService medicineShopProductService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private CoursePsycheService coursePsycheService;
|
|
|
|
|
|
|
|
|
|
//新书
|
|
|
|
|
@RequestMapping("/getNewBook")
|
|
|
|
|
@@ -223,6 +227,7 @@ public class VisitorController {
|
|
|
|
|
wrapper.eq(message.getIsBook()==1,Message::getIsBook,1);
|
|
|
|
|
wrapper.eq(message.getIsMedical()==1,Message::getIsMedical,1);
|
|
|
|
|
wrapper.eq(message.getIsSociology()==1,Message::getIsSociology,1);
|
|
|
|
|
wrapper.eq(message.getIsPsyche()==1,Message::getIsPsyche,1);
|
|
|
|
|
wrapper.orderByDesc(Message::getCreateTime);
|
|
|
|
|
List<Message> messages = messageService.getBaseMapper().selectList(wrapper);
|
|
|
|
|
return R.ok().put("messages", messages);
|
|
|
|
|
@@ -262,4 +267,38 @@ public class VisitorController {
|
|
|
|
|
Page<CourseEntity> marketCourseList = sociologyCourseService.getMarketCourseList(param);
|
|
|
|
|
return R.ok().put("courseList",marketCourseList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取心灵空间标签树
|
|
|
|
|
@RequestMapping("/getCoursePsycheTree")
|
|
|
|
|
public R getCoursePsycheTree(){
|
|
|
|
|
List<CoursePsyche> psychesTree = coursePsycheService.getCoursePsycheTree();
|
|
|
|
|
return R.ok().put("labels",psychesTree);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 心灵空间营销标签下商品列表
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/getPsycheMarketShopProductList")
|
|
|
|
|
public R getPsycheMarketShopProductList(@RequestBody Map params){
|
|
|
|
|
MPJLambdaWrapper<ShopProduct> wrapper = new MPJLambdaWrapper();
|
|
|
|
|
wrapper.selectAll(ShopProduct.class);
|
|
|
|
|
wrapper.rightJoin(ShopProductToPsycheMarket.class,ShopProductToPsycheMarket::getProductId,ShopProduct::getProductId);
|
|
|
|
|
if (params.containsKey("psycheMarketId")&&!"".equals(params.get("psycheMarketId").toString())){
|
|
|
|
|
wrapper.eq(ShopProductToPsycheMarket::getPsycheMarketId,params.get("psycheMarketId").toString());
|
|
|
|
|
}
|
|
|
|
|
Page<ShopProduct> page = productService.page(new Page<>(
|
|
|
|
|
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
|
|
|
|
return R.ok().put("result", page);
|
|
|
|
|
}
|
|
|
|
|
//心灵空间营销标签下的课程列表
|
|
|
|
|
@RequestMapping("/getPsycheMarketCourseList")
|
|
|
|
|
public R getPsycheMarketCourseList(@RequestBody Map params){
|
|
|
|
|
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
|
|
|
|
wrapper.selectAll(CourseEntity.class);
|
|
|
|
|
wrapper.leftJoin(CourseToPsycheMarket.class, CourseToPsycheMarket::getCourseId,CourseEntity::getId);
|
|
|
|
|
wrapper.eq(CourseToPsycheMarket::getPsycheMarketId,params.get("id"));
|
|
|
|
|
wrapper.orderByAsc(CourseToPsyche::getSort);
|
|
|
|
|
Page<CourseEntity> courseEntityPage = courseService.page(new Page<>(
|
|
|
|
|
Long.parseLong(params.get("page").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
|
|
|
|
return R.ok().put("courseList",courseEntityPage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|