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:
@@ -0,0 +1,16 @@
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 鉴权卡查询dto
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/3/24 9:29
|
||||
*/
|
||||
@Data
|
||||
public class PileAuthCardDTO {
|
||||
private String logicCard;
|
||||
|
||||
private String phoneNumber;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.jsowell.pile.service;
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.PileAuthCard;
|
||||
import com.jsowell.pile.dto.PileAuthCardDTO;
|
||||
import com.jsowell.pile.vo.web.PileAuthCardVO;
|
||||
|
||||
/**
|
||||
@@ -51,6 +52,14 @@ public interface IPileAuthCardService {
|
||||
*/
|
||||
public int insertPileAuthCard(PileAuthCard pileAuthCard);
|
||||
|
||||
/**
|
||||
* 新增充电站鉴权卡
|
||||
*
|
||||
* @param dto 充电站鉴权卡
|
||||
* @return 结果
|
||||
*/
|
||||
int insertPileAuthCardForWeb(PileAuthCardDTO dto);
|
||||
|
||||
/**
|
||||
* 修改充电站鉴权卡
|
||||
*
|
||||
|
||||
@@ -2,7 +2,12 @@ package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
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.web.PileAuthCardVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -21,6 +26,9 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
@Autowired
|
||||
private PileAuthCardMapper pileAuthCardMapper;
|
||||
|
||||
@Autowired
|
||||
private IMemberBasicInfoService memberBasicInfoService;
|
||||
|
||||
/**
|
||||
* 查询充电站鉴权卡
|
||||
*
|
||||
@@ -75,6 +83,28 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
return pileAuthCardMapper.insertPileAuthCard(pileAuthCard);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增充电站鉴权卡(后管用)
|
||||
*
|
||||
* @param dto 充电站鉴权卡
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPileAuthCardForWeb(PileAuthCardDTO dto) {
|
||||
// 通过手机号查询memberId
|
||||
MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMobileNumber(dto.getPhoneNumber());
|
||||
if (memberBasicInfo == null) {
|
||||
// 为空则说明未查到该用户的注册信息
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_USER_IS_NOT_REGISTER);
|
||||
}
|
||||
PileAuthCard pileAuthCard = PileAuthCard.builder()
|
||||
.logicCard(dto.getLogicCard())
|
||||
.memberId(memberBasicInfo.getMemberId())
|
||||
.status("1")
|
||||
.build();
|
||||
return pileAuthCardMapper.insertPileAuthCard(pileAuthCard);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充电站鉴权卡
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user