|
@@ -204,6 +204,11 @@ public class GoodsManagerImpl extends BaseServiceImpl<GoodsMapper, GoodsDO> impl
|
|
|
if (goodsDO.getMarketEnable()) {
|
|
|
throw new ServiceException("请先下架商品");
|
|
|
}
|
|
|
+ long count = productStockManager.count(new LambdaQueryWrapper<ProductStockDO>()
|
|
|
+ .eq(ProductStockDO::getGoodsId, id).ge(ProductStockDO::getActualStock,0));
|
|
|
+ if (count>0){
|
|
|
+ throw new ServiceException("该商品在各大仓库还有库存,请先清空库存再删除");
|
|
|
+ }
|
|
|
removeById(id);
|
|
|
//先删除sku在新增
|
|
|
productManager.remove(new LambdaQueryWrapper<ProductDO>().eq(ProductDO::getGoodsId, id));
|