Bläddra i källkod

fixed 平台方对商品操作权限的判断

fushengqian 11 månader sedan
förälder
incheckning
a3df72d0a6

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

@@ -127,6 +127,9 @@ public class CateServiceImpl extends ServiceImpl<MtGoodsCateMapper, MtGoodsCate>
                 reqDto.setMerchantId(mtStore.getMerchantId());
             }
         }
+        if (reqDto.getMerchantId() == null || reqDto.getMerchantId() < 1) {
+            throw new BusinessCheckException("平台方帐号无法执行该操作,请使用商户帐号操作");
+        }
         mtCate.setName(reqDto.getName());
         mtCate.setStatus(StatusEnum.ENABLED.getKey());
         mtCate.setLogo(reqDto.getLogo());

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

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