满减活动问题

分类Pid问题
This commit is contained in:
2025-10-23 16:31:39 +08:00
parent 0104323702
commit 7e6b791ac9
6 changed files with 29 additions and 8 deletions

View File

@@ -89,13 +89,14 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
@Override
public void updateShopProdCategory(ShopProdCategoryDTO dto) {
Long shopId = StpKit.USER.getShopId(0L);
Long shopId = StpKit.USER.getShopId();
dto.setShopId(shopId);
boolean exists = super.exists(query().eq(ShopProdCategory::getName, dto.getName()).eq(ShopProdCategory::getShopId, shopId).ne(ShopProdCategory::getId, dto.getId()));
if (exists) {
throw new CzgException("商品分类已存在");
}
ShopProdCategory entity = BeanUtil.copyProperties(dto, ShopProdCategory.class);
entity.setPid(0L);
super.updateById(entity);
}