Browse Source

场景营销获取会员等级处理所属商家过滤

multiwx
dy-hu 6 months ago
parent
commit
4c0eaeb6d7
  1. 6
      cereshop-business/src/main/java/com/shop/cereshop/business/controller/SceneController.java
  2. 3
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java
  3. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/scene/CereShopSceneDAO.java
  4. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/CereShopSceneService.java
  5. 4
      cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/impl/CereShopSceneServiceImpl.java
  6. 4
      cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml
  7. 4
      cereshop-business/src/main/resources/mybatis/mapper/scene/CereShopSceneDAO.xml

6
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<List<CerePlatformMemberLevel>> getMemberLevels() throws CoBusinessException{
List<CerePlatformMemberLevel> list=cereShopSceneService.getMemberLevels();
public Result<List<CerePlatformMemberLevel>> getMemberLevels(HttpServletRequest request) throws CoBusinessException{
//获取当前登录账户
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user");
List<CerePlatformMemberLevel> list=cereShopSceneService.getMemberLevels(user.getBusinessId());
return new Result(list);
}

3
cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java

@ -35,7 +35,8 @@ public interface CerePlatformMemberLevelDAO extends BaseMapper<CerePlatformMembe
List<Long> 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);

2
cereshop-business/src/main/java/com/shop/cereshop/business/dao/scene/CereShopSceneDAO.java

@ -40,7 +40,7 @@ public interface CereShopSceneDAO extends BaseMapper<CereShopScene> {
List<ShopScene> getAll(SceneGetAllParam param);
List<CerePlatformMemberLevel> getMemberLevels();
List<CerePlatformMemberLevel> getMemberLevels(@Param("businessId") Long businessId);
List<CereShopScene> findAll();
}

2
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<CerePlatformMemberLevel> getMemberLevels() throws CoBusinessException;
List<CerePlatformMemberLevel> getMemberLevels(Long businessId) throws CoBusinessException;
List<CereShopScene> findAll();
}

4
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<CerePlatformMemberLevel> getMemberLevels() throws CoBusinessException {
return cereShopSceneDAO.getMemberLevels();
public List<CerePlatformMemberLevel> getMemberLevels(Long businessId) throws CoBusinessException {
return cereShopSceneDAO.getMemberLevels(businessId);
}
@Override

4
cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml

@ -159,6 +159,10 @@
<if test="excludeMemberLevelId != null">
and member_level_id != #{excludeMemberLevelId}
</if>
<if test="businessId != null">
and business_id != #{businessId}
</if>
</select>
<select id="countByGrowth" resultType="int">

4
cereshop-business/src/main/resources/mybatis/mapper/scene/CereShopSceneDAO.xml

@ -192,8 +192,8 @@
ORDER BY update_time DESC,create_time DESC
</select>
<select id="getMemberLevels" resultType="com.shop.cereshop.commons.domain.member.CerePlatformMemberLevel">
SELECT * FROM cere_platform_member_level
<select id="getMemberLevels" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.member.CerePlatformMemberLevel">
SELECT * FROM cere_platform_member_level where business_id=#{businessId}
</select>
<select id="findAll" resultType="com.shop.cereshop.commons.domain.scene.CereShopScene">

Loading…
Cancel
Save