diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/controller/SceneController.java b/cereshop-business/src/main/java/com/shop/cereshop/business/controller/SceneController.java index dd87d15..3ac90b9 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/controller/SceneController.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/controller/SceneController.java @@ -163,8 +163,10 @@ public class SceneController { */ @PostMapping(value = "getMemberLevels") @ApiOperation(value = "查询会员等级数据") - public Result> getMemberLevels() throws CoBusinessException{ - List list=cereShopSceneService.getMemberLevels(); + public Result> getMemberLevels(HttpServletRequest request) throws CoBusinessException{ + //获取当前登录账户 + CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); + List list=cereShopSceneService.getMemberLevels(user.getBusinessId()); return new Result(list); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java index 8a4d12f..c4c8785 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java @@ -35,7 +35,8 @@ public interface CerePlatformMemberLevelDAO extends BaseMapper findOther(@Param("memberLevelId") Long memberLevelId); - int countMemberLevel(@Param("memberLevelName")String memberLevelName, + int countMemberLevel(@Param("businessId")Long businessId, + @Param("memberLevelName")String memberLevelName, @Param("growth")Integer growth, @Param("excludeMemberLevelId")Long excludeMemberLevelId); diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/scene/CereShopSceneDAO.java b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/scene/CereShopSceneDAO.java index 27477eb..172fe31 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/scene/CereShopSceneDAO.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/scene/CereShopSceneDAO.java @@ -40,7 +40,7 @@ public interface CereShopSceneDAO extends BaseMapper { List getAll(SceneGetAllParam param); - List getMemberLevels(); + List getMemberLevels(@Param("businessId") Long businessId); List findAll(); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/CereShopSceneService.java b/cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/CereShopSceneService.java index 4907406..f00fe7a 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/CereShopSceneService.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/CereShopSceneService.java @@ -37,7 +37,7 @@ public interface CereShopSceneService { void updateState(CereShopScene cereShopScene) throws CoBusinessException; - List getMemberLevels() throws CoBusinessException; + List getMemberLevels(Long businessId) throws CoBusinessException; List findAll(); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/impl/CereShopSceneServiceImpl.java b/cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/impl/CereShopSceneServiceImpl.java index ca3862b..576751c 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/impl/CereShopSceneServiceImpl.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/impl/CereShopSceneServiceImpl.java @@ -458,8 +458,8 @@ public class CereShopSceneServiceImpl implements CereShopSceneService { } @Override - public List getMemberLevels() throws CoBusinessException { - return cereShopSceneDAO.getMemberLevels(); + public List getMemberLevels(Long businessId) throws CoBusinessException { + return cereShopSceneDAO.getMemberLevels(businessId); } @Override diff --git a/cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml b/cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml index 3e41094..6046de7 100644 --- a/cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml +++ b/cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml @@ -159,6 +159,10 @@ and member_level_id != #{excludeMemberLevelId} + + and business_id != #{businessId} + + - + SELECT * FROM cere_platform_member_level where business_id=#{businessId}