Browse Source

处理平台端、商家端会员权益所属商家过滤

multiwx
dy-hu 7 months ago
parent
commit
0e8616dac3
  1. 2
      cereshop-admin/src/main/resources/mybatis/mapper/member/CerePlatformMembershipDAO.xml
  2. 5
      cereshop-business/src/main/java/com/shop/cereshop/business/controller/MemberShipController.java
  3. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMembershipDAO.java
  4. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/service/member/CerePlatformMembershipService.java
  5. 4
      cereshop-business/src/main/java/com/shop/cereshop/business/service/member/impl/CerePlatformMembershipServiceImpl.java
  6. 4
      cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMembershipDAO.xml

2
cereshop-admin/src/main/resources/mybatis/mapper/member/CerePlatformMembershipDAO.xml

@ -98,6 +98,6 @@
</select>
<select id="getAll" resultType="com.shop.cereshop.commons.domain.member.CerePlatformMembership">
SELECT * FROM cere_platform_membership
SELECT * FROM cere_platform_membership where business_id=0
</select>
</mapper>

5
cereshop-business/src/main/java/com/shop/cereshop/business/controller/MemberShipController.java

@ -112,8 +112,9 @@ public class MemberShipController {
*/
@PostMapping(value = "getAll")
@ApiOperation(value = "会员权益列表查询")
public Result<Page<CerePlatformMembership>> getAll(@RequestBody PageParam param) throws CoBusinessException {
Page page=cerePlatformMembershipService.getAll(param);
public Result<Page<CerePlatformMembership>> getAll(@RequestBody PageParam param, HttpServletRequest request) throws CoBusinessException {
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user");
Page page=cerePlatformMembershipService.getAll(user.getBusinessId(), param);
return new Result(page);
}
}

2
cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMembershipDAO.java

@ -26,5 +26,5 @@ public interface CerePlatformMembershipDAO extends BaseMapper<CerePlatformMember
CerePlatformMembership check(@Param("memberId") Long memberId);
List<CerePlatformMembership> getAll();
List<CerePlatformMembership> getAll(@Param("businessId") Long businessId);
}

2
cereshop-business/src/main/java/com/shop/cereshop/business/service/member/CerePlatformMembershipService.java

@ -23,5 +23,5 @@ public interface CerePlatformMembershipService {
void delete(MembershipGetByIdParam param, CerePlatformBusinessUser user) throws CoBusinessException;
Page getAll(PageParam param) throws CoBusinessException;
Page getAll(Long businessId, PageParam param) throws CoBusinessException;
}

4
cereshop-business/src/main/java/com/shop/cereshop/business/service/member/impl/CerePlatformMembershipServiceImpl.java

@ -87,9 +87,9 @@ public class CerePlatformMembershipServiceImpl implements CerePlatformMembership
}
@Override
public Page getAll(PageParam param) throws CoBusinessException {
public Page getAll(Long businessId, PageParam param) throws CoBusinessException {
PageHelper.startPage(param.getPage(),param.getPageSize());
List<CerePlatformMembership> list=cerePlatformMembershipDAO.getAll();
List<CerePlatformMembership> list=cerePlatformMembershipDAO.getAll(businessId);
PageInfo<CerePlatformMembership> pageInfo=new PageInfo<>(list);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;

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

@ -100,7 +100,7 @@
where b.member_id=#{memberId}
</select>
<select id="getAll" resultType="com.shop.cereshop.commons.domain.member.CerePlatformMembership">
SELECT * FROM cere_platform_membership
<select id="getAll" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.member.CerePlatformMembership">
SELECT * FROM cere_platform_membership where business_id=#{businessId}
</select>
</mapper>
Loading…
Cancel
Save