update 鉴权卡启动充电

This commit is contained in:
Lemon
2023-03-30 10:54:02 +08:00
parent a161952d7e
commit 04123a80a5
7 changed files with 79 additions and 20 deletions

View File

@@ -278,10 +278,7 @@ public class MemberService {
.build();
checkVerificationCode(registerAndLoginDTO);
// 判断当前鉴权卡是否被绑定过
PileAuthCard authCard = PileAuthCard.builder()
.logicCard(dto.getLogicCard())
.build();
PileAuthCard pileAuthCardInfo = pileAuthCardService.selectPileAuthCardInfo(authCard);
PileAuthCard pileAuthCardInfo = pileAuthCardService.selectCardInfoByLogicCard(dto.getLogicCard());
if (pileAuthCardInfo == null){
// 为空说明没查到此卡信息
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_HAS_NO_INFO);
@@ -294,10 +291,12 @@ public class MemberService {
// 密钥不一致,不能绑定
throw new BusinessException(ReturnCodeEnum.CODE_SECRET_KEY_NOT_SAME);
}
authCard.setMemberId(dto.getMemberId());
authCard.setStatus("1"); // 1-正常使用
authCard.setCreateBy(dto.getMemberId());
authCard.setId(pileAuthCardInfo.getId());
PileAuthCard authCard = PileAuthCard.builder()
.memberId(dto.getMemberId())
.status("1") // 1-正常使用
.createBy(dto.getMemberId())
.id(pileAuthCardInfo.getId())
.build();
return pileAuthCardService.updatePileAuthCard(authCard);
}