This commit is contained in:
2023-12-01 10:11:19 +08:00
parent eaea5bec19
commit dc8caa7716
3 changed files with 18 additions and 0 deletions

View File

@@ -2,6 +2,8 @@ package com.jsowell.pile.dto;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* 鉴权卡dto * 鉴权卡dto
* *
@@ -27,4 +29,6 @@ public class PileAuthCardDTO {
private String verificationCode; private String verificationCode;
private String merchantId; private String merchantId;
private List<String> merchantIdList;
} }

View File

@@ -10,6 +10,9 @@ import com.jsowell.pile.dto.PileAuthCardDTO;
import com.jsowell.pile.mapper.PileAuthCardMapper; import com.jsowell.pile.mapper.PileAuthCardMapper;
import com.jsowell.pile.service.IMemberBasicInfoService; import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IPileAuthCardService; import com.jsowell.pile.service.IPileAuthCardService;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.LoginUserDetailVO;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.uniapp.AuthCardVO; import com.jsowell.pile.vo.uniapp.AuthCardVO;
import com.jsowell.pile.vo.web.PileAuthCardVO; import com.jsowell.pile.vo.web.PileAuthCardVO;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
@@ -19,6 +22,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.stream.Collectors;
/** /**
* 充电站鉴权卡Service业务层处理 * 充电站鉴权卡Service业务层处理
@@ -79,6 +83,10 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
*/ */
@Override @Override
public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCardDTO dto) { public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCardDTO dto) {
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
List<MerchantInfoVO> merchantInfoVOList = loginUserDetail.getMerchantInfoVOList();
List<String> merchantIdList = merchantInfoVOList.stream().map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
dto.setMerchantIdList(merchantIdList);
return pileAuthCardMapper.getPileAuthCardInfoList(dto); return pileAuthCardMapper.getPileAuthCardInfoList(dto);
} }

View File

@@ -178,6 +178,12 @@
<if test="status != null and status != ''"> and t1.status = #{status}</if> <if test="status != null and status != ''"> and t1.status = #{status}</if>
<if test="phoneNumber != null and phoneNumber != ''"> and t2.mobile_number = #{phoneNumber}</if> <if test="phoneNumber != null and phoneNumber != ''"> and t2.mobile_number = #{phoneNumber}</if>
<if test="memberId != null and memberId != ''"> and t1.member_id = #{memberId}</if> <if test="memberId != null and memberId != ''"> and t1.member_id = #{memberId}</if>
<if test="merchantIdList != null and merchantIdList.size() != 0">
and t1.merchant_id in
<foreach collection="merchantIdList" item="merchantId" open="(" separator="," close=")">
#{merchantId,jdbcType=VARCHAR}
</foreach>
</if>
</select> </select>
<select id="getAuthCardListByMemberId" resultType="com.jsowell.pile.vo.uniapp.AuthCardVO"> <select id="getAuthCardListByMemberId" resultType="com.jsowell.pile.vo.uniapp.AuthCardVO">