商品模块代码提交

This commit is contained in:
Tankaikai 2025-02-21 14:09:01 +08:00
parent 41116b8d7b
commit 0e7475d894
1 changed files with 3 additions and 3 deletions

View File

@ -211,7 +211,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
}
entity.setIsDel(DeleteEnum.NORMAL.value());
entity.setShopId(shopId);
super.save(entity);
super.updateById(entity);
List<ProdSkuDTO> skuList = dto.getSkuList();
// 商品SKU-ID列表
List<Long> skuIdList = prodSkuMapper.selectListByQueryAs(query().select(ProdSku::getId).eq(ProdSku::getProductId, dto.getId()), Long.class);
@ -238,8 +238,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
// 逻辑删除无用的SKU数据
UpdateChain.of(ProdSku.class)
.set(ProdSku::getIsDel, DeleteEnum.DELETED.value())
.in(Product::getId, skuIdList)
.eq(Product::getShopId, shopId)
.in(ProdSku::getId, skuIdList)
.eq(ProdSku::getShopId, shopId)
.update();
return true;
}