商品模块代码提交

This commit is contained in:
Tankaikai 2025-02-16 13:22:59 +08:00
parent 9d86c376ec
commit 84914553d0
3 changed files with 3 additions and 1 deletions

View File

@ -48,7 +48,7 @@ public class ShopProdUnitDTO implements Serializable {
/**
* 店铺id
*/
private String shopId;
private Long shopId;
/**
* 创建时间
*/

View File

@ -78,6 +78,7 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
@Override
public boolean updateShopProdCategory(ShopProdCategoryDTO dto) {
Long shopId = StpKit.USER.getLoginIdAsLong();
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("商品分类已存在");

View File

@ -80,6 +80,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
@Override
public boolean updateShopProdUnit(ShopProdUnitDTO dto) {
Long shopId = StpKit.USER.getLoginIdAsLong();
dto.setShopId(shopId);
boolean exists = super.exists(query().eq(ShopProdUnit::getName, dto.getName()).eq(ShopProdUnit::getShopId, shopId).ne(ShopProdUnit::getId, dto.getId()));
if (exists) {
throw new CzgException("单位名称已存在");