mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
vin码加日志
This commit is contained in:
@@ -109,6 +109,7 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
||||
length = 17;
|
||||
byte[] vinCodeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||
String vinCode = BytesUtil.ascii2Str(vinCodeByteArr);
|
||||
log.info("桩号:{}申请充电VIN码:{}", pileSn, vinCode);
|
||||
|
||||
/**
|
||||
* 刷卡启动充电
|
||||
@@ -154,32 +155,38 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
||||
log.error("刷卡启动充电鉴权 error", e);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO VIN码启动充电
|
||||
*/
|
||||
if (StringUtils.equals("03", startMode)) {
|
||||
// 通过vin码查询数据库绑定用户信息
|
||||
MemberPlateNumberRelation plateInfo = memberPlateNumberRelationService.getMemberPlateInfoByVinCode(vinCode);
|
||||
if (plateInfo == null) {
|
||||
throw new BusinessException("", "");
|
||||
}
|
||||
if (!StringUtils.equals("1", plateInfo.getVinStatus())) {
|
||||
// 1- 正常使用
|
||||
throw new BusinessException("", "");
|
||||
}
|
||||
// vin码生成订单 vin启动充电
|
||||
GenerateOrderDTO dto = new GenerateOrderDTO();
|
||||
dto.setMemberPlateNumberRelation(plateInfo);
|
||||
dto.setPileSn(pileSn);
|
||||
dto.setConnectorCode(connectorCode);
|
||||
dto.setStartMode(StartModeEnum.VIN_CODE.getValue());
|
||||
Map<String, Object> map = orderBasicInfoService.generateOrderByCard(dto);
|
||||
if (map != null) {
|
||||
transactionCode = (String) map.get("transactionCode");
|
||||
accountBalanceByteArr = YKCUtils.getPriceByte(String.valueOf(map.get("accountBalance")), 2);
|
||||
// 鉴权成功标识 0x00 失败 0x01 成功
|
||||
authenticationFlagByteArr = Constants.oneByteArray;
|
||||
try {
|
||||
/**
|
||||
* TODO VIN码启动充电
|
||||
*/
|
||||
if (StringUtils.equals("03", startMode)) {
|
||||
// 通过vin码查询数据库绑定用户信息
|
||||
MemberPlateNumberRelation plateInfo = memberPlateNumberRelationService.getMemberPlateInfoByVinCode(vinCode);
|
||||
if (plateInfo == null) {
|
||||
throw new BusinessException("", "未查到绑定用户信息");
|
||||
}
|
||||
if (!StringUtils.equals("1", plateInfo.getVinStatus())) {
|
||||
// 1- 正常使用
|
||||
throw new BusinessException("", "状态不正确");
|
||||
}
|
||||
// vin码生成订单 vin启动充电
|
||||
GenerateOrderDTO dto = new GenerateOrderDTO();
|
||||
dto.setMemberPlateNumberRelation(plateInfo);
|
||||
dto.setPileSn(pileSn);
|
||||
dto.setConnectorCode(connectorCode);
|
||||
dto.setStartMode(StartModeEnum.VIN_CODE.getValue());
|
||||
Map<String, Object> map = orderBasicInfoService.generateOrderByCard(dto);
|
||||
if (map != null) {
|
||||
transactionCode = (String) map.get("transactionCode");
|
||||
accountBalanceByteArr = YKCUtils.getPriceByte(String.valueOf(map.get("accountBalance")), 2);
|
||||
// 鉴权成功标识 0x00 失败 0x01 成功
|
||||
authenticationFlagByteArr = Constants.oneByteArray;
|
||||
}
|
||||
}
|
||||
}catch (BusinessException e){
|
||||
log.error("VIN码启动充电鉴权 error:{}, {}", e.getCode(), e.getMessage());
|
||||
}catch (Exception e) {
|
||||
log.error("VIN码启动充电鉴权 error", e);
|
||||
}
|
||||
|
||||
// 应答
|
||||
|
||||
Reference in New Issue
Block a user