mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 0x31鉴权失败原因
This commit is contained in:
@@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -123,7 +124,7 @@ public class ConfirmStartChargingRequestHandler extends AbstractYkcHandler {
|
||||
.vinCode(vinCode)
|
||||
.build();
|
||||
|
||||
|
||||
byte[] defeatReasonByteArr = Constants.zeroByteArray;
|
||||
/**
|
||||
* 刷卡启动充电
|
||||
*/
|
||||
@@ -189,7 +190,12 @@ public class ConfirmStartChargingRequestHandler extends AbstractYkcHandler {
|
||||
// 通过vin码查询数据库绑定用户信息
|
||||
MemberPlateNumberRelation plateInfo = memberPlateNumberRelationService.getMemberPlateInfoByVinCode(vinCode);
|
||||
if (plateInfo == null) {
|
||||
throw new BusinessException("", vinCode + "未查到绑定用户信息");
|
||||
// throw new BusinessException("", vinCode + "未查到绑定用户信息");
|
||||
log.error(vinCode + "未查到绑定用户信息");
|
||||
defeatReasonByteArr = new byte[] {0x09}; // 系统中vin 码不存在
|
||||
transactionCode = Constants.ILLEGAL_TRANSACTION_CODE;
|
||||
accountBalanceByteArr = BytesUtil.checkLengthAndBehindAppendZero(accountBalanceByteArr, 8);
|
||||
authenticationFlagByteArr = Constants.zeroByteArray;
|
||||
}
|
||||
// if (!StringUtils.equals("1", plateInfo.getVinStatus())) {
|
||||
// // 1- 正常使用
|
||||
@@ -216,8 +222,13 @@ public class ConfirmStartChargingRequestHandler extends AbstractYkcHandler {
|
||||
transactionCode = Constants.ILLEGAL_TRANSACTION_CODE;
|
||||
accountBalanceByteArr = BytesUtil.checkLengthAndBehindAppendZero(accountBalanceByteArr, 8);
|
||||
authenticationFlagByteArr = Constants.zeroByteArray;
|
||||
String code = e.getCode();
|
||||
String message = e.getMessage();
|
||||
if (StringUtils.length(code) == 2) {
|
||||
defeatReasonByteArr = BytesUtil.str2Bcd(code);
|
||||
}
|
||||
|
||||
log.error("VIN码启动充电鉴权 error:{}, {}", e.getCode(), e.getMessage());
|
||||
log.error("VIN码启动充电鉴权 error:{}, {}", code, message);
|
||||
}catch (Exception e) {
|
||||
transactionCode = Constants.ILLEGAL_TRANSACTION_CODE;
|
||||
accountBalanceByteArr = BytesUtil.checkLengthAndBehindAppendZero(accountBalanceByteArr, 8);
|
||||
@@ -245,7 +256,7 @@ public class ConfirmStartChargingRequestHandler extends AbstractYkcHandler {
|
||||
* 0x0A 该桩存在未结账记录
|
||||
* 0x0B 该桩不支持刷卡
|
||||
*/
|
||||
byte[] defeatReasonByteArr = Constants.zeroByteArray;
|
||||
// byte[] defeatReasonByteArr = Constants.zeroByteArray;
|
||||
|
||||
// 保存报文
|
||||
String jsonMsg = JSON.toJSONString(confirmStartChargingData);
|
||||
@@ -318,4 +329,12 @@ public class ConfirmStartChargingRequestHandler extends AbstractYkcHandler {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String msg = "01";
|
||||
System.out.println(StringUtils.length(msg));
|
||||
byte[] bytes = BytesUtil.str2Bcd(msg);
|
||||
byte[] a = new byte[]{0x01};
|
||||
String s = Arrays.toString(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user