This commit is contained in:
wangjinlei
2024-05-31 13:37:11 +08:00
parent 3085b79976
commit 02f4c63062
4 changed files with 24 additions and 1 deletions

View File

@@ -463,7 +463,7 @@ public class ShopProductController {
}
/**
* 删除
* 删除(废弃)
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] productIds) {

View File

@@ -73,6 +73,12 @@ public class ShopProductController {
return R.ok();
}
@RequestMapping("/delShopProduct")
public R delShopProduct(@RequestBody Map<String,Integer> map){
int productId = map.get("productId");
return shopProductService.delShopProduct(productId);
}
@RequestMapping("/bindProductAndBookMarket")
public R bindProductAndBookMarket(@RequestBody Map<String,String> map){
String[] productIds = map.get("productId").split(",");

View File

@@ -56,4 +56,6 @@ public interface ShopProductService extends IService<ShopProduct> {
R bindProductAndCourse(ShopProductCourseEntity shopProductCourseEntity);
R unbindProductAndCourse(int productId,int catalogueId);
R delShopProduct(int productId);
}

View File

@@ -275,6 +275,21 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
return R.ok();
}
@Override
public R delShopProduct(int productId){
//清除连带绑定关系
shopProductToMedicineLabelDao.delete(new LambdaQueryWrapper<ShopProductToMedicineLabel>().eq(ShopProductToMedicineLabel::getProductId,productId));
shopProductToMedicineMarketDao.delete(new LambdaQueryWrapper<ShopProductToMedicineMarket>().eq(ShopProductToMedicineMarket::getProductId,productId));
shopProductToSociologyLabelDao.delete(new LambdaQueryWrapper<ShopProductToSociologyLabel>().eq(ShopProductToSociologyLabel::getProductId,productId));
shopProductToSociologyMarketDao.delete(new LambdaQueryWrapper<ShopProductToSociologyMarket>().eq(ShopProductToSociologyMarket::getProductId,productId));
shopProductToBookLabelDao.delete(new LambdaQueryWrapper<ShopProductToBookLabel>().eq(ShopProductToBookLabel::getProductId,productId));
shopProductToBookMarketDao.delete(new LambdaQueryWrapper<ShopProductToBookMarket>().eq(ShopProductToBookMarket::getProductId,productId));
shopProductBookDao.delete(new LambdaQueryWrapper<ShopProductBookEntity>().eq(ShopProductBookEntity::getProductId, productId));
shopProductCourseDao.delete(new LambdaQueryWrapper<ShopProductCourseEntity>().eq(ShopProductCourseEntity::getProductId,productId));
this.removeById(productId);
return R.ok();
}
@Override
public Map<String, Object> getProductToLabel(Integer productId) {
HashMap<String, Object> flag = new HashMap<>();