mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
新增 绑定鉴权卡需密钥
This commit is contained in:
@@ -45,6 +45,8 @@ public class PileAuthCard {
|
||||
@Excel(name = "卡状态")
|
||||
private String status;
|
||||
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* 所属用户的会员id
|
||||
*/
|
||||
|
||||
@@ -22,6 +22,11 @@ public class BindingCardDTO {
|
||||
*/
|
||||
private String physicsCard;
|
||||
|
||||
/**
|
||||
* 密钥
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* 电话号码
|
||||
*/
|
||||
|
||||
@@ -71,6 +71,13 @@ public interface PileAuthCardMapper {
|
||||
*/
|
||||
public int deletePileAuthCardById(Long id);
|
||||
|
||||
/**
|
||||
* 停用某张卡
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int deactivateCard(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除充电站鉴权卡
|
||||
*
|
||||
|
||||
@@ -88,5 +88,12 @@ public interface IPileAuthCardService {
|
||||
*/
|
||||
public int deletePileAuthCardById(Long id);
|
||||
|
||||
/**
|
||||
* 停用某张卡
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int deactivateCard(Long id);
|
||||
|
||||
int unBindingCard(PileAuthCard pileAuthCard);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
@@ -9,6 +10,7 @@ import com.jsowell.pile.domain.MemberBasicInfo;
|
||||
import com.jsowell.pile.dto.PileAuthCardDTO;
|
||||
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jsowell.pile.mapper.PileAuthCardMapper;
|
||||
@@ -109,10 +111,12 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
}
|
||||
memberBasicInfo.setStatus("1"); // 1-正常使用
|
||||
}
|
||||
String secretKey = RandomStringUtils.randomAlphanumeric(8).toUpperCase(Locale.ROOT); // 生成8位数的字母 + 数字随机数
|
||||
PileAuthCard pileAuthCard = PileAuthCard.builder()
|
||||
.logicCard(dto.getLogicCard())
|
||||
.memberId(memberBasicInfo.getMemberId())
|
||||
.status(memberBasicInfo.getStatus())
|
||||
.secretKey(secretKey)
|
||||
.build();
|
||||
return pileAuthCardMapper.insertPileAuthCard(pileAuthCard);
|
||||
}
|
||||
@@ -167,6 +171,11 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
return pileAuthCardMapper.deletePileAuthCardById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deactivateCard(Long id) {
|
||||
return pileAuthCardMapper.deactivateCard(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int unBindingCard(PileAuthCard pileAuthCard) {
|
||||
return pileAuthCardMapper.unBindingCard(pileAuthCard);
|
||||
|
||||
@@ -20,6 +20,8 @@ public class PileAuthCardVO {
|
||||
|
||||
private String status;
|
||||
|
||||
private String secretKey;
|
||||
|
||||
private String createTime;
|
||||
|
||||
private String memberId;
|
||||
|
||||
Reference in New Issue
Block a user