mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
add 小程序查询用户鉴权卡列表接口
This commit is contained in:
@@ -3,7 +3,7 @@ package com.jsowell.pile.dto;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 鉴权卡查询dto
|
||||
* 鉴权卡dto
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/3/24 9:29
|
||||
@@ -21,4 +21,6 @@ public class PileAuthCardDTO {
|
||||
private String memberId;
|
||||
|
||||
private String phoneNumber;
|
||||
|
||||
private String VerificationCode;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.PileAuthCard;
|
||||
import com.jsowell.pile.dto.PileAuthCardDTO;
|
||||
import com.jsowell.pile.vo.uniapp.AuthCardVO;
|
||||
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -96,4 +97,11 @@ public interface PileAuthCardMapper {
|
||||
* @return
|
||||
*/
|
||||
PileAuthCard selectSomeStatusCardInfo(@Param("status") String status, @Param("logicCard") String logicCard);
|
||||
|
||||
/**
|
||||
* 通过memberId查询鉴权卡列表 (小程序用)
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<AuthCardVO> getAuthCardListByMemberId(@Param("memberId") String memberId);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.PileAuthCard;
|
||||
import com.jsowell.pile.dto.PileAuthCardDTO;
|
||||
import com.jsowell.pile.vo.uniapp.AuthCardVO;
|
||||
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
||||
|
||||
/**
|
||||
@@ -60,7 +61,7 @@ public interface IPileAuthCardService {
|
||||
* @param dto 充电站鉴权卡
|
||||
* @return 结果
|
||||
*/
|
||||
int insertPileAuthCardForWeb(PileAuthCardDTO dto);
|
||||
int addAuthCard(PileAuthCardDTO dto);
|
||||
|
||||
/**
|
||||
* 修改充电站鉴权卡
|
||||
@@ -111,4 +112,11 @@ public interface IPileAuthCardService {
|
||||
* @return
|
||||
*/
|
||||
PileAuthCard selectCardInfoByLogicCard(String logicCard);
|
||||
|
||||
/**
|
||||
* 通过memberId查询鉴权卡列表 (小程序用)
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<AuthCardVO> getAuthCardListByMemberId(String memberId);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -9,6 +10,7 @@ import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||
import com.jsowell.pile.dto.PileAuthCardDTO;
|
||||
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||
import com.jsowell.pile.vo.uniapp.AuthCardVO;
|
||||
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -97,7 +99,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPileAuthCardForWeb(PileAuthCardDTO dto) {
|
||||
public int addAuthCard(PileAuthCardDTO dto) {
|
||||
MemberBasicInfo memberBasicInfo = new MemberBasicInfo();
|
||||
if (dto.getPhoneNumber() == null) {
|
||||
memberBasicInfo.setMemberId(null);
|
||||
@@ -201,4 +203,18 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
public PileAuthCard selectCardInfoByLogicCard(String logicCard) {
|
||||
return selectSomeStatusCardInfo(null, logicCard);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过memberId查询鉴权卡列表 (小程序用)
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<AuthCardVO> getAuthCardListByMemberId(String memberId) {
|
||||
List<AuthCardVO> list = pileAuthCardMapper.getAuthCardListByMemberId(memberId);
|
||||
for (AuthCardVO authCardVO : list) {
|
||||
authCardVO.setAccountBalance(authCardVO.getPrincipalBalance().add(authCardVO.getGiftBalance()).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.jsowell.pile.vo.uniapp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 桩鉴权卡VO
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/5/23 9:35
|
||||
*/
|
||||
@Data
|
||||
public class AuthCardVO {
|
||||
/**
|
||||
* 卡号
|
||||
*/
|
||||
private String logicCard;
|
||||
|
||||
/**
|
||||
* 所属用户电话号码
|
||||
*/
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 账户余额
|
||||
*/
|
||||
private BigDecimal accountBalance;
|
||||
|
||||
/**
|
||||
* 本金金额
|
||||
*/
|
||||
private BigDecimal principalBalance;
|
||||
|
||||
/**
|
||||
* 赠送金额
|
||||
*/
|
||||
private BigDecimal giftBalance;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
}
|
||||
Reference in New Issue
Block a user