通用模块-商品评价

This commit is contained in:
wuchunlei
2024-03-28 10:29:29 +08:00
parent c0431f7280
commit e92dfa8b13
4 changed files with 50 additions and 13 deletions

View File

@@ -198,6 +198,9 @@ public class BookLabelAndMarketController {
if (params.containsKey("goodsType")&&!"".equals(params.get("goodsType").toString())){
wrapper.eq(ShopProduct::getGoodsType,params.get("goodsType").toString());
}
if (params.containsKey("productName")&&!"".equals(params.get("productName").toString())){
wrapper.like(ShopProduct::getProductName,params.get("productName").toString());
}
if (params.containsKey("bookLabelId")&&!"".equals(params.get("bookLabelId").toString())){
String sql = "select product_id from shop_product_to_book_label where del_flag = 0 and book_label_id = "+params.get("bookLabelId");
wrapper.notInSql(ShopProduct::getProductId,sql);
@@ -311,19 +314,29 @@ public class BookLabelAndMarketController {
@RequestMapping(path = "/delToLable")
public R delToLable(String lableId,String productId) {
LambdaQueryWrapper<ShopProductToBookLabel> wrapper = new LambdaQueryWrapper();
wrapper.eq(ShopProductToBookLabel::getBookLabelId,lableId);
wrapper.eq(ShopProductToBookLabel::getProductId,productId);
toLabelService.remove(wrapper);
if(StringUtils.isNotEmpty(productId)){
String[] productIds = productId.split(",");
for(String id : productIds){
LambdaQueryWrapper<ShopProductToBookLabel> wrapper = new LambdaQueryWrapper();
wrapper.eq(ShopProductToBookLabel::getBookLabelId,lableId);
wrapper.eq(ShopProductToBookLabel::getProductId,id);
toLabelService.remove(wrapper);
}
}
return R.ok();
}
@RequestMapping(path = "/delToMarket")
public R delToMarket(String marketId,String productId) {
LambdaQueryWrapper<ShopProductToBookMarket> wrapper = new LambdaQueryWrapper();
wrapper.eq(ShopProductToBookMarket::getBookMarketId,marketId);
wrapper.eq(ShopProductToBookMarket::getProductId,productId);
toMarketService.remove(wrapper);
if(StringUtils.isNotEmpty(productId)){
String[] productIds = productId.split(",");
for(String id : productIds){
LambdaQueryWrapper<ShopProductToBookMarket> wrapper = new LambdaQueryWrapper();
wrapper.eq(ShopProductToBookMarket::getBookMarketId,marketId);
wrapper.eq(ShopProductToBookMarket::getProductId,id);
toMarketService.remove(wrapper);
}
}
return R.ok();
}