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