update 会员区分运营商

This commit is contained in:
Lemon
2023-08-25 13:17:30 +08:00
parent 914380b3ea
commit 454022c553
10 changed files with 622 additions and 471 deletions

View File

@@ -2,6 +2,8 @@ package com.jsowell.pile.dto;
import lombok.Data;
import java.util.List;
/**
* TODO
*
@@ -19,4 +21,8 @@ public class QueryMemberInfoDTO {
private String mobileNumber;
private String memberId;
private String merchantId;
private List<String> merchantDeptIds;
}

View File

@@ -3,6 +3,7 @@ package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.domain.PileBasicInfo;
import com.jsowell.pile.dto.QueryMemberInfoDTO;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.uniapp.MemberVO;
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
import org.apache.ibatis.annotations.Param;
@@ -113,4 +114,9 @@ public interface MemberBasicInfoMapper {
*/
List<MemberVO> selectMemberList(@Param("dto") QueryMemberInfoDTO dto);
/**
* 获取当前会员中的运营商列表(带权限校验)
*/
List<MerchantInfoVO> getMerchantListByAuth(@Param("deptIds") List<String> deptIds);
}

View File

@@ -4,6 +4,7 @@ import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.dto.PlatformTesterDTO;
import com.jsowell.pile.dto.QueryMemberInfoDTO;
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.uniapp.MemberBalanceVO;
import com.jsowell.pile.vo.uniapp.MemberVO;
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
@@ -146,4 +147,10 @@ public interface IMemberBasicInfoService {
* @return
*/
List<MemberBalanceVO> getMemberRefundAmount(List<String> memberIds);
/**
* 获取当前会员中的运营商列表(带权限校验)
*/
List<MerchantInfoVO> getMerchantListByAuth(List<String> deptIds);
}

View File

@@ -3,8 +3,10 @@ package com.jsowell.pile.service.impl;
import com.google.common.collect.Lists;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.domain.MemberPlateNumberRelation;
@@ -19,6 +21,7 @@ import com.jsowell.pile.mapper.MemberWalletInfoMapper;
import com.jsowell.pile.mapper.MemberWalletLogMapper;
import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IPileBasicInfoService;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.uniapp.MemberBalanceVO;
import com.jsowell.pile.vo.uniapp.MemberVO;
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
@@ -31,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -291,6 +295,15 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
*/
@Override
public List<MemberVO> selectMemberList(QueryMemberInfoDTO dto) {
// 获取登录账号信息
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
if (authorizedMap == null) {
return new ArrayList<>();
}
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
dto.setMerchantDeptIds(merchantDeptIds);
}
return memberBasicInfoMapper.selectMemberList(dto);
}
@@ -364,5 +377,13 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
return memberWalletLogMapper.getMemberRefundAmount(memberIds);
}
/**
* 获取当前会员中的运营商列表(带权限校验)
*/
@Override
public List<MerchantInfoVO> getMerchantListByAuth(List<String> deptIds) {
return memberBasicInfoMapper.getMerchantListByAuth(deptIds);
}
}

View File

@@ -24,6 +24,13 @@ public class MemberVO {
*/
private String memberId;
private String merchantId;
/**
* 运营商名称
*/
private String merchantName;
/**
* 状态
*/

View File

@@ -197,6 +197,8 @@
<select id="selectMemberList" resultType="com.jsowell.pile.vo.uniapp.MemberVO">
SELECT
t1.merchant_id as merchantId,
t3.merchant_name as merchantName,
t1.member_id as memberId,
t1.STATUS as status,
t1.nick_name as nickName,
@@ -207,12 +209,35 @@
FROM
member_basic_info t1
JOIN member_wallet_info t2 ON t1.member_id = t2.member_id and t2.del_flag = '0'
JOIN pile_merchant_info t3 ON t1.merchant_id = t3.id and t3.del_flag = '0'
where
t1.del_flag = '0'
<if test="dto.mobileNumber != null and dto.mobileNumber != ''">and t1.mobile_number like '%${dto.mobileNumber}%'</if>
<if test="dto.nickName != null and dto.nickName != ''">and t1.nick_name like '%${dto.nickName}%'</if>
<if test="dto.memberId != null and dto.memberId != ''">and t1.member_id like '%${dto.memberId}%'</if>
<if test="dto.merchantId != null and dto.merchantId != ''">and t1.merchant_id like '%${dto.merchantId}%'</if>
<if test="dto.merchantDeptIds != null and dto.merchantDeptIds.size() != 0">
and t3.dept_id in
<foreach collection="dto.merchantDeptIds" item="deptId" open="(" separator="," close=")">
#{deptId,jdbcType=VARCHAR}
</foreach>
</if>
</select>
<select id="getMerchantListByAuth" resultType="com.jsowell.pile.vo.base.MerchantInfoVO">
SELECT DISTINCT
( t1.merchant_id ) as merchantId,
t2.merchant_name as merchantName
FROM
member_basic_info t1
JOIN pile_merchant_info t2 ON t1.merchant_id = t2.id and t1.del_flag = '0'
<where>
<if test="deptIds != null and deptIds.size() != 0">
t2.dept_id in
<foreach collection="deptIds" item="deptid" open="(" separator="," close=")">
#{deptid,jdbcType=VARCHAR}
</foreach>
</if>
</where>
</select>
</mapper>