From 177cd8636632b9c6e4c8e7cb85afc14c7982b704 Mon Sep 17 00:00:00 2001 From: lifenlong Date: Mon, 5 Jul 2021 11:14:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=B7=BB=E5=8A=A0=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=90=8D=E7=A7=B0=E7=9A=84=E5=95=86=E5=93=81=E5=88=86?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/common/enums/ResultCode.java | 1 + .../member/serviceimpl/MemberServiceImpl.java | 2 +- .../goods/CategoryManagerController.java | 18 +----------------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/framework/src/main/java/cn/lili/common/enums/ResultCode.java b/framework/src/main/java/cn/lili/common/enums/ResultCode.java index bd499283..0cab3e56 100644 --- a/framework/src/main/java/cn/lili/common/enums/ResultCode.java +++ b/framework/src/main/java/cn/lili/common/enums/ResultCode.java @@ -330,6 +330,7 @@ public enum ResultCode { STORE_APPLY_DOUBLE_ERROR(50003, "已有店铺,无需重复申请!"), STORE_NOT_OPEN(50004, "该会员未开通店铺"), STORE_NOT_LOGIN_ERROR(50005, "未登录店铺"), + STORE_CLOSE_ERROR(50006, "店铺关闭,请联系管理员"), /** * 结算单 diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java index 0f88afc6..273549ec 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java @@ -145,7 +145,7 @@ public class MemberServiceImpl extends ServiceImpl impleme if (member.getHaveStore()) { Store store = storeService.getById(member.getStoreId()); if (!store.getStoreDisable().equals(StoreStatusEnum.OPEN.name())) { - throw new ServiceException(ResultCode.USER_NOT_EXIST); + throw new ServiceException(ResultCode.STORE_CLOSE_ERROR); } } else { throw new ServiceException(ResultCode.USER_NOT_EXIST); diff --git a/manager-api/src/main/java/cn/lili/controller/goods/CategoryManagerController.java b/manager-api/src/main/java/cn/lili/controller/goods/CategoryManagerController.java index cd88b664..f88fea98 100644 --- a/manager-api/src/main/java/cn/lili/controller/goods/CategoryManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/goods/CategoryManagerController.java @@ -61,14 +61,6 @@ public class CategoryManagerController { @PostMapping @ApiOperation(value = "添加商品分类") public ResultMessage saveCategory(@Valid Category category) { - - //不能添加重复的分类名称 - Category category1 = new Category(); - category1.setName(category.getName()); - List list = categoryService.findByAllBySortOrder(category1); - if (StringUtils.isNotEmpty(list)) { - throw new ServiceException(ResultCode.CATEGORY_NOT_EXIST); - } //非顶级分类 if (category.getParentId() != null && !category.getParentId().equals("0")) { Category parent = categoryService.getById(category.getParentId()); @@ -90,15 +82,7 @@ public class CategoryManagerController { public ResultMessage updateCategory(@Valid CategoryVO category) { Category catTemp = categoryService.getById(category.getId()); if (catTemp == null) { - throw new ServiceException(ResultCode.CATEGORY_PARENT_NOT_EXIST); - } - //不能添加重复的分类名称 - Category category1 = new Category(); - category1.setName(category.getName()); - category1.setId(category.getId()); - List list = categoryService.findByAllBySortOrder(category1); - if (StringUtils.isNotEmpty(list)) { - throw new ServiceException(ResultCode.CATEGORY_NAME_IS_EXIST); + throw new ServiceException(ResultCode.CATEGORY_NOT_EXIST); } categoryService.updateCategory(category);