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

@@ -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<>();