提交 479d4121 编写于 作者: 郝先瑞

fix(PmsSpuServiceImpl.java): 删除商品属性问题修复

上级 04e1ad2a
......@@ -266,22 +266,22 @@ public class PmsSpuServiceImpl extends ServiceImpl<PmsSpuMapper, PmsSpu> impleme
/**
* 批量删除商品(SPU)
*
* @param goodsIds
* @param spuIds 商品ID集合列表
* @return
*/
@Override
@Transactional
public boolean removeByGoodsIds(List<Long> goodsIds) {
public boolean removeByGoodsIds(List<Long> spuIds) {
boolean result = true;
for (Long goodsId : goodsIds) {
// sku
skuService.remove(new LambdaQueryWrapper<PmsSku>().eq(PmsSku::getSpuId, goodsId));
for (Long spuId : spuIds) {
// SKU
skuService.remove(new LambdaQueryWrapper<PmsSku>().eq(PmsSku::getSpuId, spuId));
// 规格
spuAttributeValueService.remove(new LambdaQueryWrapper<PmsSpuAttributeValue>().eq(PmsSpuAttributeValue::getId, goodsId));
spuAttributeValueService.remove(new LambdaQueryWrapper<PmsSpuAttributeValue>().eq(PmsSpuAttributeValue::getSpuId, spuId));
// 属性
spuAttributeValueService.remove(new LambdaQueryWrapper<PmsSpuAttributeValue>().eq(PmsSpuAttributeValue::getSpuId, goodsId));
// spu
result = this.removeById(goodsId);
spuAttributeValueService.remove(new LambdaQueryWrapper<PmsSpuAttributeValue>().eq(PmsSpuAttributeValue::getSpuId, spuId));
// SPU
result = this.removeById(spuId);
}
return result;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册