mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
充电桩主动申请充电,平台生成订单号回复并启动充电
This commit is contained in:
@@ -299,4 +299,31 @@ public class MemberController extends BaseController {
|
|||||||
logger.info("用户解绑车牌号 result:{}", response);
|
logger.info("用户解绑车牌号 result:{}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户绑定鉴权卡接口
|
||||||
|
* http://localhost:8080/uniapp/member/memberBindingCard
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/memberBindingCard")
|
||||||
|
public RestApiResponse<?> memberBindingCard(HttpServletRequest request, @RequestBody BindingCardDTO dto){
|
||||||
|
logger.info("用户绑定鉴权卡 param:{}", JSONObject.toJSONString(dto));
|
||||||
|
RestApiResponse<?> response = null;
|
||||||
|
try {
|
||||||
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
|
dto.setMemberId(memberId);
|
||||||
|
int i = memberService.memberBindCard(dto);
|
||||||
|
response = new RestApiResponse<>(i);
|
||||||
|
} catch (BusinessException e){
|
||||||
|
logger.error("用户绑定鉴权卡 error", e);
|
||||||
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("用户绑定鉴权卡 error", e);
|
||||||
|
response = new RestApiResponse<>(e);
|
||||||
|
}
|
||||||
|
logger.info("用户绑定鉴权卡 result:{}", response);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ import com.jsowell.common.util.id.IdUtils;
|
|||||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||||
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
||||||
import com.jsowell.pile.domain.MemberWalletInfo;
|
import com.jsowell.pile.domain.MemberWalletInfo;
|
||||||
|
import com.jsowell.pile.domain.PileAuthCard;
|
||||||
import com.jsowell.pile.dto.*;
|
import com.jsowell.pile.dto.*;
|
||||||
import com.jsowell.pile.service.IMemberBasicInfoService;
|
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||||
import com.jsowell.pile.service.IMemberPlateNumberRelationService;
|
import com.jsowell.pile.service.IMemberPlateNumberRelationService;
|
||||||
|
import com.jsowell.pile.service.IPileAuthCardService;
|
||||||
import com.jsowell.pile.service.IPileMerchantInfoService;
|
import com.jsowell.pile.service.IPileMerchantInfoService;
|
||||||
import com.jsowell.pile.transaction.dto.MemberTransactionDTO;
|
import com.jsowell.pile.transaction.dto.MemberTransactionDTO;
|
||||||
import com.jsowell.pile.transaction.service.TransactionService;
|
import com.jsowell.pile.transaction.service.TransactionService;
|
||||||
@@ -55,6 +57,9 @@ public class MemberService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IMemberPlateNumberRelationService memberPlateNumberRelationService;
|
private IMemberPlateNumberRelationService memberPlateNumberRelationService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileAuthCardService pileAuthCardService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验短信验证码
|
* 校验短信验证码
|
||||||
* @param dto
|
* @param dto
|
||||||
@@ -259,4 +264,35 @@ public class MemberService {
|
|||||||
relation.setPhoneNumber(dto.getPhoneNumber());
|
relation.setPhoneNumber(dto.getPhoneNumber());
|
||||||
memberPlateNumberRelationService.insertMemberPlateNumberRelation(relation);
|
memberPlateNumberRelationService.insertMemberPlateNumberRelation(relation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户绑定鉴权卡
|
||||||
|
* @param dto
|
||||||
|
*/
|
||||||
|
public int memberBindCard(BindingCardDTO dto){
|
||||||
|
// 校验短信验证码
|
||||||
|
MemberRegisterAndLoginDTO registerAndLoginDTO = MemberRegisterAndLoginDTO.builder()
|
||||||
|
.mobileNumber(dto.getPhoneNumber())
|
||||||
|
.verificationCode(dto.getVerificationCode())
|
||||||
|
.build();
|
||||||
|
// checkVerificationCode(registerAndLoginDTO);
|
||||||
|
// 判断当前鉴权卡是否被绑定过
|
||||||
|
PileAuthCard authCard = PileAuthCard.builder()
|
||||||
|
.physicsCard(dto.getPhysicsCard())
|
||||||
|
.build();
|
||||||
|
PileAuthCard pileAuthCardInfo = pileAuthCardService.selectPileAuthCardInfo(authCard);
|
||||||
|
if (pileAuthCardInfo == null){
|
||||||
|
// 为空说明没查到此卡信息
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_HAS_NO_INFO);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(pileAuthCardInfo.getMemberId())) {
|
||||||
|
// memberId 不为空,说明此卡已被绑定
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_HAS_BEEN_BINDING);
|
||||||
|
}
|
||||||
|
authCard.setMemberId(dto.getMemberId());
|
||||||
|
authCard.setStatus("1"); // 1-正常使用
|
||||||
|
authCard.setCreateBy(dto.getMemberId());
|
||||||
|
authCard.setId(pileAuthCardInfo.getId());
|
||||||
|
return pileAuthCardService.updatePileAuthCard(authCard);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,6 +123,12 @@ public enum ReturnCodeEnum {
|
|||||||
CODE_SECRET_KEY_ERROR("00400013", "填写的桩密钥有误,请检查!"),
|
CODE_SECRET_KEY_ERROR("00400013", "填写的桩密钥有误,请检查!"),
|
||||||
|
|
||||||
CODE_THIS_PILE_NOT_PERSONAL_PILE("00400014", "此桩不是个人桩!"),
|
CODE_THIS_PILE_NOT_PERSONAL_PILE("00400014", "此桩不是个人桩!"),
|
||||||
|
|
||||||
|
CODE_THIS_CARD_HAS_NO_INFO("00600001", "未查到此卡信息!"),
|
||||||
|
|
||||||
|
CODE_THIS_CARD_NOT_BIND_USER("00600002", "此卡未绑定用户!"),
|
||||||
|
|
||||||
|
CODE_THIS_CARD_HAS_BEEN_BINDING("00600003", "此卡已被绑定!"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private String value;
|
private String value;
|
||||||
|
|||||||
@@ -5,11 +5,19 @@ import com.google.common.primitives.Bytes;
|
|||||||
import com.jsowell.common.constant.Constants;
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
||||||
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||||
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
|
import com.jsowell.common.exception.BusinessException;
|
||||||
import com.jsowell.common.util.BytesUtil;
|
import com.jsowell.common.util.BytesUtil;
|
||||||
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.common.util.YKCUtils;
|
import com.jsowell.common.util.YKCUtils;
|
||||||
import com.jsowell.common.util.id.IdUtils;
|
import com.jsowell.common.util.id.IdUtils;
|
||||||
import com.jsowell.netty.factory.YKCOperateFactory;
|
import com.jsowell.netty.factory.YKCOperateFactory;
|
||||||
|
import com.jsowell.pile.domain.PileAuthCard;
|
||||||
|
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||||
|
import com.jsowell.pile.service.IMemberWalletInfoService;
|
||||||
|
import com.jsowell.pile.service.IPileAuthCardService;
|
||||||
import com.jsowell.pile.service.impl.MemberBasicInfoServiceImpl;
|
import com.jsowell.pile.service.impl.MemberBasicInfoServiceImpl;
|
||||||
|
import com.jsowell.pile.service.impl.PileAuthCardServiceImpl;
|
||||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -33,6 +41,9 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MemberBasicInfoServiceImpl memberBasicInfoService;
|
private MemberBasicInfoServiceImpl memberBasicInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileAuthCardService pileAuthCardService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterPropertiesSet() throws Exception {
|
public void afterPropertiesSet() throws Exception {
|
||||||
YKCOperateFactory.register(type, this);
|
YKCOperateFactory.register(type, this);
|
||||||
@@ -45,13 +56,11 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
|||||||
byte[] msgBody = ykcDataProtocol.getMsgBody();
|
byte[] msgBody = ykcDataProtocol.getMsgBody();
|
||||||
|
|
||||||
int startIndex = 0;
|
int startIndex = 0;
|
||||||
int length = 16;
|
int length = 7;
|
||||||
|
|
||||||
// 桩编码
|
// 桩编码
|
||||||
startIndex += length;
|
|
||||||
length = 7;
|
|
||||||
byte[] pileSnByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] pileSnByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
String pileSn = BytesUtil.bcd2Str(pileSnByteArr);
|
String pileSn = BytesUtil.binary(pileSnByteArr, 16);
|
||||||
|
|
||||||
// 保存时间
|
// 保存时间
|
||||||
saveLastTime(pileSn);
|
saveLastTime(pileSn);
|
||||||
@@ -59,26 +68,28 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
|||||||
// 枪号
|
// 枪号
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
length = 1;
|
length = 1;
|
||||||
byte[] pileConnectorNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] connectorNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
String connectorCode = BytesUtil.bcd2Str(pileConnectorNumByteArr);
|
String connectorCode = BytesUtil.bcd2Str(connectorNumByteArr);
|
||||||
|
|
||||||
// 启动方式
|
// 启动方式
|
||||||
// 0x01 表示通过刷卡启动充电
|
// 0x01 表示通过刷卡启动充电
|
||||||
// 0x02 表求通过帐号启动充电 (暂不支持)
|
// 0x02 表求通过帐号启动充电 (暂不支持)
|
||||||
// 0x03 表示vin码启动充电
|
// 0x03 表示vin码启动充电
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
length = 1;
|
|
||||||
byte[] startModeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] startModeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String startMode = BytesUtil.bcd2Str(startModeByteArr);
|
||||||
|
|
||||||
// 是否需要密码 0x00 不需要 0x01 需要
|
// 是否需要密码 0x00 不需要 0x01 需要
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
byte[] needPasswordFlagByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] needPasswordFlagByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String needPasswordFlag = BytesUtil.bcd2Str(needPasswordFlagByteArr);
|
||||||
|
|
||||||
// 物理卡号 不足 8 位补 0
|
// 物理卡号 不足 8 位补 0
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
length = 8;
|
length = 8;
|
||||||
byte[] cardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] cardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
String physicsCardNum = BytesUtil.bcd2Str(cardNumByteArr);
|
String physicsCard = BytesUtil.binary(cardNumByteArr, 16);
|
||||||
|
log.info("物理卡号:{}", physicsCard);
|
||||||
|
|
||||||
// 输入密码 对用户输入的密码进行16 位MD5 加密,采用小写上传
|
// 输入密码 对用户输入的密码进行16 位MD5 加密,采用小写上传
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
@@ -90,24 +101,59 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
|||||||
length = 17;
|
length = 17;
|
||||||
byte[] vinCodeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] vinCodeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
|
||||||
|
String logicCard = "";
|
||||||
|
byte[] authenticationFlagByteArr = Constants.zeroByteArray;
|
||||||
|
byte[] accountBalanceByteArr = Constants.zeroByteArray;
|
||||||
|
try {
|
||||||
|
if (StringUtils.equals("01", startMode)) {
|
||||||
|
// 刷卡启动充电
|
||||||
|
// 根据传过来的物理卡号查询数据库中此卡信息
|
||||||
|
PileAuthCard pileAuthCard = PileAuthCard.builder()
|
||||||
|
.logicCard(physicsCard)
|
||||||
|
.build();
|
||||||
|
PileAuthCard pileAuthCardInfo = pileAuthCardService.selectPileAuthCardInfo(pileAuthCard);
|
||||||
|
if (pileAuthCardInfo == null) {
|
||||||
|
// 未查到此卡信息
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_HAS_NO_INFO);
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(pileAuthCardInfo.getMemberId())) {
|
||||||
|
// 卡未绑定用户
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_NOT_BIND_USER);
|
||||||
|
}
|
||||||
|
// 卡状态
|
||||||
|
String cardStatus = pileAuthCardInfo.getStatus();
|
||||||
|
// 逻辑卡号
|
||||||
|
logicCard = pileAuthCardInfo.getLogicCard();
|
||||||
|
// 通过memberId获取账户余额
|
||||||
|
MemberVO memberVO = memberBasicInfoService.queryMemberInfoByMemberId(pileAuthCardInfo.getMemberId());
|
||||||
|
BigDecimal principalBalance = memberVO.getPrincipalBalance(); // 本金金额
|
||||||
|
double accountBalance = principalBalance.add(memberVO.getGiftBalance()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||||
|
accountBalanceByteArr = YKCUtils.getPriceByte(String.valueOf(accountBalance), 2);
|
||||||
|
// 鉴权成功标识 0x00 失败 0x01 成功
|
||||||
|
authenticationFlagByteArr = Constants.oneByteArray;
|
||||||
|
}
|
||||||
|
} catch (BusinessException e){
|
||||||
|
log.error("刷卡启动充电鉴权 error:{}, {}", e.getCode(), e.getMessage());
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("刷卡启动充电鉴权 error", e);
|
||||||
|
}
|
||||||
|
|
||||||
// 应答
|
// 应答
|
||||||
// 交易流水号
|
// 交易流水号
|
||||||
String serialNum = IdUtils.generateTransactionCode(pileSn, connectorCode);
|
String transactionCode = IdUtils.generateTransactionCode(pileSn, connectorCode);
|
||||||
byte[] serialNumByteArr = BytesUtil.str2Bcd(serialNum);
|
byte[] serialNumByteArr = BytesUtil.str2Bcd(transactionCode);
|
||||||
|
|
||||||
// 逻辑卡号
|
// 逻辑卡号
|
||||||
String logicCardNum = "00000000";
|
// String logicCardNum = "00000000";
|
||||||
byte[] logicCardNumByteArr = BytesUtil.str2Bcd(logicCardNum); // [0, 0, 0, 0]
|
|
||||||
|
|
||||||
// 账户余额 保留两位小数
|
// 账户余额 保留两位小数
|
||||||
MemberVO memberVO = memberBasicInfoService.selectInfoByPhysicsCard(physicsCardNum);
|
// MemberVO memberVO = memberBasicInfoService.selectInfoByPhysicsCard(physicsCard);
|
||||||
BigDecimal principalBalance = memberVO.getPrincipalBalance(); // 本金金额
|
// BigDecimal principalBalance = memberVO.getPrincipalBalance(); // 本金金额
|
||||||
double accountBalance = principalBalance.add(memberVO.getGiftBalance()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
// double accountBalance = principalBalance.add(memberVO.getGiftBalance()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||||
byte[] accountBalanceByteArr = BytesUtil.str2Bcd(String.valueOf(accountBalance));
|
// byte[] accountBalanceByteArr = BytesUtil.str2Bcd(String.valueOf(accountBalance));
|
||||||
|
|
||||||
// 鉴权成功标识 0x00 失败 0x01 成功
|
// 鉴权成功标识 0x00 失败 0x01 成功
|
||||||
byte[] authenticationFlagByteArr= Constants.oneByteArray;
|
// byte[] authenticationFlagByteArr = Constants.oneByteArray;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 失败原因
|
* 失败原因
|
||||||
@@ -126,7 +172,7 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
|||||||
byte[] defeatReasonByteArr = Constants.zeroByteArray;
|
byte[] defeatReasonByteArr = Constants.zeroByteArray;
|
||||||
|
|
||||||
// 拼装消息体
|
// 拼装消息体
|
||||||
byte[] msgBodyByteArr = Bytes.concat(serialNumByteArr, logicCardNumByteArr, accountBalanceByteArr,
|
byte[] msgBodyByteArr = Bytes.concat(serialNumByteArr, pileSnByteArr, connectorNumByteArr, cardNumByteArr, accountBalanceByteArr,
|
||||||
authenticationFlagByteArr, defeatReasonByteArr);
|
authenticationFlagByteArr, defeatReasonByteArr);
|
||||||
|
|
||||||
return getResult(ykcDataProtocol, msgBodyByteArr);
|
return getResult(ykcDataProtocol, msgBodyByteArr);
|
||||||
|
|||||||
@@ -436,7 +436,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
|||||||
length = 8;
|
length = 8;
|
||||||
byte[] cardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] cardNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
byte[] logicCardNum = BytesUtil.checkLengthAndBehindAppendZero(cardNumByteArr, 16);
|
byte[] logicCardNum = BytesUtil.checkLengthAndBehindAppendZero(cardNumByteArr, 16);
|
||||||
String logicCard = BytesUtil.binary(logicCardNum, 10);
|
String logicCard = BytesUtil.binary(logicCardNum, 16);
|
||||||
|
|
||||||
log.info("[===交易记录===]交易流水号:{}, 桩编号:{}, 枪号:{}, 开始时间:{}, 结束时间:{}, 尖单价:{}, 尖电量:{}, 计损尖电量:{}, 尖金额:{}, " +
|
log.info("[===交易记录===]交易流水号:{}, 桩编号:{}, 枪号:{}, 开始时间:{}, 结束时间:{}, 尖单价:{}, 尖电量:{}, 计损尖电量:{}, 尖金额:{}, " +
|
||||||
"峰单价:{}, 峰电量:{}, 计损峰电量:{}, 峰金额:{}, 平单价:{}, 平电量:{}, 计损平电量:{}, 平金额:{}, " +
|
"峰单价:{}, 峰电量:{}, 计损峰电量:{}, 峰金额:{}, 平单价:{}, 平电量:{}, 计损平电量:{}, 平金额:{}, " +
|
||||||
|
|||||||
@@ -38,6 +38,12 @@ public class PileAuthCard {
|
|||||||
@Excel(name = "物理卡号")
|
@Excel(name = "物理卡号")
|
||||||
private String physicsCard;
|
private String physicsCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡状态
|
||||||
|
*/
|
||||||
|
@Excel(name = "卡状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属用户的会员id
|
* 所属用户的会员id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.jsowell.pile.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户绑定卡DTO
|
||||||
|
*
|
||||||
|
* @author JS-ZZA
|
||||||
|
* @date 2023/3/17 15:16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BindingCardDTO {
|
||||||
|
private String memberId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑卡号
|
||||||
|
*/
|
||||||
|
private String logicCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物理卡号
|
||||||
|
*/
|
||||||
|
private String physicsCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电话号码
|
||||||
|
*/
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证码
|
||||||
|
*/
|
||||||
|
private String verificationCode;
|
||||||
|
}
|
||||||
@@ -21,6 +21,13 @@ public interface PileAuthCardMapper {
|
|||||||
*/
|
*/
|
||||||
public PileAuthCard selectPileAuthCardById(Long id);
|
public PileAuthCard selectPileAuthCardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询充电站鉴权卡信息
|
||||||
|
* @param pileAuthCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PileAuthCard selectPileAuthCardInfo (PileAuthCard pileAuthCard);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询充电站鉴权卡列表
|
* 查询充电站鉴权卡列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -19,6 +19,13 @@ public interface IPileAuthCardService {
|
|||||||
*/
|
*/
|
||||||
public PileAuthCard selectPileAuthCardById(Long id);
|
public PileAuthCard selectPileAuthCardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询充电站鉴权卡信息
|
||||||
|
* @param pileAuthCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PileAuthCard selectPileAuthCardInfo(PileAuthCard pileAuthCard);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询充电站鉴权卡列表
|
* 查询充电站鉴权卡列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -31,6 +31,16 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
|||||||
return pileAuthCardMapper.selectPileAuthCardById(id);
|
return pileAuthCardMapper.selectPileAuthCardById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询充电站鉴权卡信息
|
||||||
|
* @param pileAuthCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PileAuthCard selectPileAuthCardInfo(PileAuthCard pileAuthCard) {
|
||||||
|
return pileAuthCardMapper.selectPileAuthCardInfo(pileAuthCard);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询充电站鉴权卡列表
|
* 查询充电站鉴权卡列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="logicCard" column="logic_card" />
|
<result property="logicCard" column="logic_card" />
|
||||||
<result property="physicsCard" column="physics_card" />
|
<result property="physicsCard" column="physics_card" />
|
||||||
|
<result property="status" column="status" />
|
||||||
<result property="memberId" column="member_id" />
|
<result property="memberId" column="member_id" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
@@ -17,7 +18,11 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectPileAuthCardVo">
|
<sql id="selectPileAuthCardVo">
|
||||||
select id, logic_card, physics_card, member_id, create_time, create_by, update_time, update_by, del_flag from pile_auth_card
|
select id, logic_card, physics_card, status, member_id, create_time, create_by, update_time, update_by, del_flag from pile_auth_card
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List" >
|
||||||
|
id, logic_card, physics_card, status, member_id, create_time, create_by, update_time, update_by, del_flag
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectPileAuthCardList" parameterType="com.jsowell.pile.domain.PileAuthCard" resultMap="PileAuthCardResult">
|
<select id="selectPileAuthCardList" parameterType="com.jsowell.pile.domain.PileAuthCard" resultMap="PileAuthCardResult">
|
||||||
@@ -25,6 +30,7 @@
|
|||||||
<where>
|
<where>
|
||||||
<if test="logicCard != null and logicCard != ''"> and logic_card = #{logicCard}</if>
|
<if test="logicCard != null and logicCard != ''"> and logic_card = #{logicCard}</if>
|
||||||
<if test="physicsCard != null and physicsCard != ''"> and physics_card = #{physicsCard}</if>
|
<if test="physicsCard != null and physicsCard != ''"> and physics_card = #{physicsCard}</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
|
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
@@ -39,6 +45,7 @@
|
|||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="logicCard != null">logic_card,</if>
|
<if test="logicCard != null">logic_card,</if>
|
||||||
<if test="physicsCard != null">physics_card,</if>
|
<if test="physicsCard != null">physics_card,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
<if test="memberId != null">member_id,</if>
|
<if test="memberId != null">member_id,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
@@ -49,6 +56,7 @@
|
|||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="logicCard != null">#{logicCard},</if>
|
<if test="logicCard != null">#{logicCard},</if>
|
||||||
<if test="physicsCard != null">#{physicsCard},</if>
|
<if test="physicsCard != null">#{physicsCard},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
<if test="memberId != null">#{memberId},</if>
|
<if test="memberId != null">#{memberId},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
@@ -63,6 +71,7 @@
|
|||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="logicCard != null">logic_card = #{logicCard},</if>
|
<if test="logicCard != null">logic_card = #{logicCard},</if>
|
||||||
<if test="physicsCard != null">physics_card = #{physicsCard},</if>
|
<if test="physicsCard != null">physics_card = #{physicsCard},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
<if test="memberId != null">member_id = #{memberId},</if>
|
<if test="memberId != null">member_id = #{memberId},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
@@ -83,4 +92,21 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectPileAuthCardInfo" resultMap="PileAuthCardResult">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from pile_auth_card
|
||||||
|
where status = '1'
|
||||||
|
<if test="memberId != null and memberId != ''">
|
||||||
|
and member_id = #{memberId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="physicsCard != null and physicsCard != ''">
|
||||||
|
and physics_card = #{physicsCard,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="logicCard != null and logicCard != ''">
|
||||||
|
and logic_card = #{logicCard,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -32,16 +32,16 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">-->
|
||||||
<el-button
|
<!-- <el-button-->
|
||||||
type="primary"
|
<!-- type="primary"-->
|
||||||
plain
|
<!-- plain-->
|
||||||
icon="el-icon-plus"
|
<!-- icon="el-icon-plus"-->
|
||||||
size="mini"
|
<!-- size="mini"-->
|
||||||
@click="handleAdd"
|
<!-- @click="handleAdd"-->
|
||||||
v-hasPermi="['pile:card:add']"
|
<!-- v-hasPermi="['pile:card:add']"-->
|
||||||
>新增</el-button>
|
<!-- >新增</el-button>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
@@ -64,25 +64,25 @@
|
|||||||
v-hasPermi="['pile:card:remove']"
|
v-hasPermi="['pile:card:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">-->
|
||||||
<el-button
|
<!-- <el-button-->
|
||||||
type="warning"
|
<!-- type="warning"-->
|
||||||
plain
|
<!-- plain-->
|
||||||
icon="el-icon-download"
|
<!-- icon="el-icon-download"-->
|
||||||
size="mini"
|
<!-- size="mini"-->
|
||||||
@click="handleExport"
|
<!-- @click="handleExport"-->
|
||||||
v-hasPermi="['pile:card:export']"
|
<!-- v-hasPermi="['pile:card:export']"-->
|
||||||
>导出</el-button>
|
<!-- >导出</el-button>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="cardList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="cardList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="主键" align="center" prop="id" />
|
<!-- <el-table-column label="主键" align="center" prop="id" />-->
|
||||||
<el-table-column label="逻辑卡号" align="center" prop="logicCard" />
|
<el-table-column label="逻辑卡号" align="center" prop="logicCard" />
|
||||||
<el-table-column label="物理卡号" align="center" prop="physicsCard" />
|
<el-table-column label="物理卡号" align="center" prop="physicsCard" />
|
||||||
<el-table-column label="所属用户的会员id" align="center" prop="memberId" />
|
<el-table-column label="所属用户" align="center" prop="memberId" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -120,8 +120,8 @@
|
|||||||
<el-form-item label="物理卡号" prop="physicsCard">
|
<el-form-item label="物理卡号" prop="physicsCard">
|
||||||
<el-input v-model="form.physicsCard" placeholder="请输入物理卡号" />
|
<el-input v-model="form.physicsCard" placeholder="请输入物理卡号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属用户的会员id" prop="memberId">
|
<el-form-item label="会员id" prop="memberId">
|
||||||
<el-input v-model="form.memberId" placeholder="请输入所属用户的会员id" />
|
<el-input v-model="form.memberId" placeholder="请输入所属用户" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="删除标识" prop="delFlag">
|
<el-form-item label="删除标识" prop="delFlag">
|
||||||
<el-input v-model="form.delFlag" placeholder="请输入删除标识" />
|
<el-input v-model="form.delFlag" placeholder="请输入删除标识" />
|
||||||
|
|||||||
Reference in New Issue
Block a user