1
0
Эх сурвалжийг харах

fixed 平台方账户操作权限判断

fushengqian 5 сар өмнө
parent
commit
c7d47ee003

+ 6 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/BannerServiceImpl.java

@@ -117,6 +117,9 @@ public class BannerServiceImpl extends ServiceImpl<MtBannerMapper, MtBanner> imp
         if (mtBanner.getMerchantId() == null || mtBanner.getMerchantId() <= 0) {
         if (mtBanner.getMerchantId() == null || mtBanner.getMerchantId() <= 0) {
             throw new BusinessCheckException("新增焦点图失败:所属商户不能为空!");
             throw new BusinessCheckException("新增焦点图失败:所属商户不能为空!");
         }
         }
+        if (mtBanner.getMerchantId() == null || mtBanner.getMerchantId() < 1) {
+            throw new BusinessCheckException("平台方帐号无法执行该操作,请使用商户帐号操作");
+        }
         mtBanner.setStoreId(storeId);
         mtBanner.setStoreId(storeId);
         mtBanner.setStatus(StatusEnum.ENABLED.getKey());
         mtBanner.setStatus(StatusEnum.ENABLED.getKey());
         mtBanner.setUpdateTime(new Date());
         mtBanner.setUpdateTime(new Date());
@@ -176,6 +179,9 @@ public class BannerServiceImpl extends ServiceImpl<MtBannerMapper, MtBanner> imp
         if (mtBanner == null) {
         if (mtBanner == null) {
             throw new BusinessCheckException("该Banner状态异常");
             throw new BusinessCheckException("该Banner状态异常");
         }
         }
+        if (bannerDto.getMerchantId() == null || bannerDto.getMerchantId() < 1) {
+            throw new BusinessCheckException("平台方帐号无法执行该操作,请使用商户帐号操作");
+        }
 
 
         mtBanner.setId(bannerDto.getId());
         mtBanner.setId(bannerDto.getId());
         if (bannerDto.getImage() != null) {
         if (bannerDto.getImage() != null) {

+ 3 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/CateServiceImpl.java

@@ -224,6 +224,9 @@ public class CateServiceImpl extends ServiceImpl<MtGoodsCateMapper, MtGoodsCate>
         if (reqDto.getMerchantId() != null && reqDto.getMerchantId() > 0) {
         if (reqDto.getMerchantId() != null && reqDto.getMerchantId() > 0) {
             mtCate.setMerchantId(reqDto.getMerchantId());
             mtCate.setMerchantId(reqDto.getMerchantId());
         }
         }
+        if (mtCate.getMerchantId() == null || mtCate.getMerchantId() < 1) {
+            throw new BusinessCheckException("平台方帐号无法执行该操作,请使用商户帐号操作");
+        }
         if (reqDto.getStoreId() != null) {
         if (reqDto.getStoreId() != null) {
             mtCate.setStoreId(reqDto.getStoreId());
             mtCate.setStoreId(reqDto.getStoreId());
         }
         }

+ 1 - 1
fuint-application/src/main/java/com/fuint/common/service/impl/GoodsServiceImpl.java

@@ -224,7 +224,7 @@ public class GoodsServiceImpl extends ServiceImpl<MtGoodsMapper, MtGoods> implem
                 mtGoods.setMerchantId(mtStore.getMerchantId());
                 mtGoods.setMerchantId(mtStore.getMerchantId());
             }
             }
         }
         }
-        if (mtGoods.getId() == null && (mtGoods.getMerchantId() == null || mtGoods.getMerchantId() < 1)) {
+        if (mtGoods.getMerchantId() == null || mtGoods.getMerchantId() < 1) {
             throw new BusinessCheckException("平台方帐号无法执行该操作,请使用商户帐号操作");
             throw new BusinessCheckException("平台方帐号无法执行该操作,请使用商户帐号操作");
         }
         }
         if (StringUtil.isNotEmpty(reqDto.getIsSingleSpec())) {
         if (StringUtil.isNotEmpty(reqDto.getIsSingleSpec())) {