mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2025-01-03 17:42:20 +08:00
fix(PmsSpuServiceImpl.java): 删除商品属性问题修复
This commit is contained in:
parent
04e1ad2a84
commit
479d4121cf
@ -266,22 +266,22 @@ public class PmsSpuServiceImpl extends ServiceImpl<PmsSpuMapper, PmsSpu> impleme
|
|||||||
/**
|
/**
|
||||||
* 批量删除商品(SPU)
|
* 批量删除商品(SPU)
|
||||||
*
|
*
|
||||||
* @param goodsIds
|
* @param spuIds 商品ID集合列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public boolean removeByGoodsIds(List<Long> goodsIds) {
|
public boolean removeByGoodsIds(List<Long> spuIds) {
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
for (Long goodsId : goodsIds) {
|
for (Long spuId : spuIds) {
|
||||||
// sku
|
// SKU
|
||||||
skuService.remove(new LambdaQueryWrapper<PmsSku>().eq(PmsSku::getSpuId, goodsId));
|
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));
|
spuAttributeValueService.remove(new LambdaQueryWrapper<PmsSpuAttributeValue>().eq(PmsSpuAttributeValue::getSpuId, spuId));
|
||||||
// spu
|
// SPU
|
||||||
result = this.removeById(goodsId);
|
result = this.removeById(spuId);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user