This commit is contained in:
wangjinlei
2024-05-07 18:19:17 +08:00
parent b4988a3fd4
commit e7909ba934
2 changed files with 9 additions and 20 deletions

View File

@@ -786,7 +786,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
List<BookEntity> bookByProductId = shopProductBookService.getBookByProductId(buyOrderProduct.getProductId()); List<BookEntity> bookByProductId = shopProductBookService.getBookByProductId(buyOrderProduct.getProductId());
goodsResponseVo.setBooks(bookByProductId); goodsResponseVo.setBooks(bookByProductId);
//设置商品对应的课程目录 //设置商品对应的课程
List<Integer> collect = shopProductCourseDao.selectList(new LambdaQueryWrapper<ShopProductCourseEntity>().eq(ShopProductCourseEntity::getProductId, buyOrderProduct.getProductId())).stream().map(ShopProductCourseEntity::getCatalogueId).collect(Collectors.toList()); List<Integer> collect = shopProductCourseDao.selectList(new LambdaQueryWrapper<ShopProductCourseEntity>().eq(ShopProductCourseEntity::getProductId, buyOrderProduct.getProductId())).stream().map(ShopProductCourseEntity::getCatalogueId).collect(Collectors.toList());
if(collect.size()>0){ if(collect.size()>0){
MPJLambdaWrapper<CourseCatalogueEntity> courseCatalogueEntityMPJLambdaWrapper = new MPJLambdaWrapper<>(); MPJLambdaWrapper<CourseCatalogueEntity> courseCatalogueEntityMPJLambdaWrapper = new MPJLambdaWrapper<>();

View File

@@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; 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.Map; import java.util.Map;
/** /**
@@ -25,27 +27,14 @@ public class MessageController {
private MessageService messageService; private MessageService messageService;
@RequestMapping("/listByPage") @RequestMapping("/listByPage")
public R listByPage(@RequestBody Map<String, Object> params) { public R listByPage(@RequestBody Message message) {
LambdaQueryWrapper<Message> wrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<Message> wrapper = new LambdaQueryWrapper();
if (params.containsKey("title")&& StringUtils.isNotEmpty(params.get("title").toString())) { wrapper.eq(message.getIsBook()==1,Message::getIsBook,1);
wrapper.like(Message::getTitle,params.get("title")); wrapper.eq(message.getIsMedical()==1,Message::getIsMedical,1);
} wrapper.eq(message.getIsSociology()==1,Message::getIsSociology,1);
if (params.containsKey("type")&& StringUtils.isNotEmpty(params.get("type").toString())) {
wrapper.eq(Message::getType,params.get("type"));
}
if (params.containsKey("isBook")&& StringUtils.isNotEmpty(params.get("isBook").toString())) {
wrapper.eq(Message::getIsBook,params.get("isBook"));
}
if (params.containsKey("isMedical")&& StringUtils.isNotEmpty(params.get("isMedical").toString())) {
wrapper.eq(Message::getIsBook,params.get("isMedical"));
}
if (params.containsKey("isSociology")&& StringUtils.isNotEmpty(params.get("isSociology").toString())) {
wrapper.eq(Message::getIsBook,params.get("isSociology"));
}
wrapper.orderByDesc(Message::getCreateTime); wrapper.orderByDesc(Message::getCreateTime);
Page<Message> page = messageService.page(new Page<>( List<Message> messages = messageService.getBaseMapper().selectList(wrapper);
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())), wrapper); return R.ok().put("messages", messages);
return R.ok().put("result", page);
} }
@RequestMapping("/getMessageById") @RequestMapping("/getMessageById")