mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
新增 用户解绑鉴权卡接口
This commit is contained in:
@@ -125,4 +125,11 @@ public interface IPileAuthCardService {
|
||||
* @param dto
|
||||
*/
|
||||
int bindAuthCard(PileAuthCardDTO dto);
|
||||
|
||||
/**
|
||||
* 用户解绑鉴权卡 (小程序用)
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int unbindAuthCard(PileAuthCardDTO dto);
|
||||
}
|
||||
|
||||
@@ -246,4 +246,24 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
pileAuthCard.setStatus("1");
|
||||
return updatePileAuthCard(pileAuthCard);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户解绑鉴权卡
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int unbindAuthCard(PileAuthCardDTO dto) {
|
||||
// 根据传过来的卡号查询数据库
|
||||
PileAuthCard pileAuthCard = selectCardInfoByLogicCard(dto.getLogicCard());
|
||||
if (pileAuthCard == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_HAS_NO_INFO);
|
||||
}
|
||||
// 如果memberId对应的上,则进行解绑操作 (将数据库中 del_flag 改为 1)
|
||||
if (!StringUtils.equals(pileAuthCard.getMemberId(), dto.getMemberId())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_BIND_INFO_ERROR);
|
||||
}
|
||||
pileAuthCard.setDelFlag("1");
|
||||
return updatePileAuthCard(pileAuthCard);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user