多店铺需求
This commit is contained in:
parent
4a8599c17c
commit
fc51797e2d
|
|
@ -89,7 +89,7 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
|||
throw new CzgException("主店铺配置信息不存在");
|
||||
}
|
||||
if (ShopTypeEnum.ONLY.getValue().equals(shopInfo.getShopType())) {
|
||||
throw new CzgException("数据错误:主单店铺类型为单店");
|
||||
throw new CzgException("数据错误:主店铺类型为单店");
|
||||
}
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), 0) == YesNoEnum.NO.value()) {
|
||||
throw new CzgException("数据错误:当前店铺不是主店");
|
||||
|
|
@ -128,7 +128,7 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
|||
throw new CzgException("主店铺配置信息不存在");
|
||||
}
|
||||
if (ShopTypeEnum.ONLY.getValue().equals(shopInfo.getShopType())) {
|
||||
throw new CzgException("数据错误:主单店铺类型为单店");
|
||||
throw new CzgException("数据错误:主店铺类型为单店");
|
||||
}
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), 0) == YesNoEnum.NO.value()) {
|
||||
throw new CzgException("数据错误:当前店铺不是主店");
|
||||
|
|
@ -157,7 +157,7 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
|||
throw new CzgException("主店铺配置信息不存在");
|
||||
}
|
||||
if (ShopTypeEnum.ONLY.getValue().equals(shopInfo.getShopType())) {
|
||||
throw new CzgException("数据错误:主单店铺类型为单店");
|
||||
throw new CzgException("数据错误:主店铺类型为单店");
|
||||
}
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), 0) == YesNoEnum.NO.value()) {
|
||||
throw new CzgException("数据错误:当前店铺不是主店");
|
||||
|
|
|
|||
|
|
@ -243,9 +243,9 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
|||
public Boolean edit(ShopInfoEditDTO shopInfoEditDTO) {
|
||||
ShopInfo shopInfo;
|
||||
if (!StpKit.USER.isAdmin()) {
|
||||
shopInfo = queryChain().eq(ShopInfo::getId, shopInfoEditDTO.getId()).one();
|
||||
shopInfo = queryChain().eq(ShopInfo::getId, StpKit.USER.getLoginIdAsLong()).one();
|
||||
} else {
|
||||
shopInfo = getById(StpKit.USER.getLoginIdAsLong());
|
||||
shopInfo = getById(shopInfoEditDTO.getId());
|
||||
}
|
||||
if (shopInfo == null) {
|
||||
throw new CzgException("店铺不存在");
|
||||
|
|
@ -260,8 +260,8 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
|||
if (!isHeadShop.equals(shopInfoEditDTO.getIsHeadShop())) {
|
||||
throw new CzgException("禁止修改是否主店");
|
||||
}
|
||||
if (!mainId.equals(shopInfoEditDTO.getMainId())) {
|
||||
throw new CzgException("禁止从新选择店铺设为主店");
|
||||
if (mainId != null && !mainId.equals(shopInfoEditDTO.getMainId())) {
|
||||
throw new CzgException("禁止重新选择店铺设为主店");
|
||||
}
|
||||
if (shopInfoEditDTO.getActivateCode() != null) {
|
||||
activateShop(shopInfo, shopInfoEditDTO.getActivateCode());
|
||||
|
|
|
|||
Loading…
Reference in New Issue