mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-08 20:10:16 +08:00
update
This commit is contained in:
@@ -203,109 +203,8 @@ public class ConfirmStartChargingRequestHandler extends AbstractYkcHandler {
|
|||||||
*/
|
*/
|
||||||
byte[] authenticationFlagByteArr = Constants.zeroByteArray; // 鉴权成功标识
|
byte[] authenticationFlagByteArr = Constants.zeroByteArray; // 鉴权成功标识
|
||||||
byte[] accountBalanceByteArr = Constants.zeroByteArray; // 账户余额
|
byte[] accountBalanceByteArr = Constants.zeroByteArray; // 账户余额
|
||||||
// String transactionCode = resultMap.get("transactionCode");
|
|
||||||
// try {
|
|
||||||
// if (StringUtils.equals("01", startMode)) {
|
|
||||||
// log.info("桩号:{}, 申请充电物理卡号:{}", pileSn, physicsCard);
|
|
||||||
// // 查询卡信息 根据传过来的物理卡号查询数据库中此卡信息
|
|
||||||
// PileAuthCard pileAuthCardInfo = pileAuthCardService.selectCardInfoByLogicCard(physicsCard);
|
|
||||||
// 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);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 判断卡状态
|
|
||||||
// if (!StringUtils.equals(CardStatusEnum.NORMAL.getCode(), pileAuthCardInfo.getStatus())) {
|
|
||||||
// log.info("卡号:{}, 状态:{}, 非正常使用状态", physicsCard, CardStatusEnum.getCardStatus(pileAuthCardInfo.getStatus()));
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 刷卡生成订单 刷卡启动充电
|
|
||||||
// GenerateOrderDTO dto = new GenerateOrderDTO();
|
|
||||||
// dto.setPileAuthCardInfo(pileAuthCardInfo);
|
|
||||||
// dto.setPileSn(pileSn);
|
|
||||||
// dto.setConnectorCode(connectorCode);
|
|
||||||
// dto.setStartMode(StartModeEnum.AUTH_CARD.getValue());
|
|
||||||
// dto.setMemberId(pileAuthCardInfo.getMemberId());
|
|
||||||
// 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;
|
|
||||||
// }else {
|
|
||||||
// throw new BusinessException("", "生成刷卡订单失败");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } catch (BusinessException e){
|
|
||||||
// transactionCode = Constants.ILLEGAL_TRANSACTION_CODE;
|
|
||||||
// accountBalanceByteArr = BytesUtil.checkLengthAndBehindAppendZero(accountBalanceByteArr, 8);
|
|
||||||
// authenticationFlagByteArr = Constants.zeroByteArray;
|
|
||||||
// log.error("刷卡启动充电鉴权 error:{}, {}", e.getCode(), e.getMessage());
|
|
||||||
// } catch (Exception e){
|
|
||||||
// transactionCode = Constants.ILLEGAL_TRANSACTION_CODE;
|
|
||||||
// accountBalanceByteArr = BytesUtil.checkLengthAndBehindAppendZero(accountBalanceByteArr, 8);
|
|
||||||
// authenticationFlagByteArr = Constants.zeroByteArray;
|
|
||||||
// log.error("刷卡启动充电鉴权 error", e);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// try {
|
// 交易流水号
|
||||||
// /**
|
|
||||||
// * VIN码启动充电
|
|
||||||
// */
|
|
||||||
// if (StringUtils.equals("03", startMode)) {
|
|
||||||
// log.info("桩号:{}, 申请充电VIN码:{}, 反转后:{}", pileSn, vinCode, StringUtils.reverse(vinCode));
|
|
||||||
// // 通过vin码查询数据库绑定用户信息
|
|
||||||
// MemberPlateNumberRelation plateInfo = memberPlateNumberRelationService.getMemberPlateInfoByVinCode(vinCode);
|
|
||||||
// if (plateInfo == null) {
|
|
||||||
// // 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;
|
|
||||||
// }
|
|
||||||
// // vin码生成订单 vin启动充电
|
|
||||||
// GenerateOrderDTO dto = new GenerateOrderDTO();
|
|
||||||
// dto.setMemberPlateNumberRelation(plateInfo);
|
|
||||||
// dto.setPileSn(pileSn);
|
|
||||||
// dto.setConnectorCode(connectorCode);
|
|
||||||
// dto.setStartMode(StartModeEnum.VIN_CODE.getValue());
|
|
||||||
// dto.setMemberId(plateInfo.getMemberId());
|
|
||||||
// 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;
|
|
||||||
// }else {
|
|
||||||
// throw new BusinessException("", "生成vin订单失败");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }catch (BusinessException e){
|
|
||||||
// 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:{}, {}", code, message);
|
|
||||||
// }catch (Exception e) {
|
|
||||||
// transactionCode = Constants.ILLEGAL_TRANSACTION_CODE;
|
|
||||||
// accountBalanceByteArr = BytesUtil.checkLengthAndBehindAppendZero(accountBalanceByteArr, 8);
|
|
||||||
// authenticationFlagByteArr = Constants.zeroByteArray;
|
|
||||||
//
|
|
||||||
// log.error("VIN码启动充电鉴权 error", e);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//
|
|
||||||
String transactionCode = resultMap.get("transactionCode");
|
String transactionCode = resultMap.get("transactionCode");
|
||||||
// 如果交易流水号不等于Constants.ILLEGAL_TRANSACTION_CODE, 表示鉴权通过
|
// 如果交易流水号不等于Constants.ILLEGAL_TRANSACTION_CODE, 表示鉴权通过
|
||||||
if (!StringUtils.equals(transactionCode, Constants.ILLEGAL_TRANSACTION_CODE)) {
|
if (!StringUtils.equals(transactionCode, Constants.ILLEGAL_TRANSACTION_CODE)) {
|
||||||
@@ -317,8 +216,6 @@ public class ConfirmStartChargingRequestHandler extends AbstractYkcHandler {
|
|||||||
accountBalanceByteArr = YKCUtils.getPriceByte(String.valueOf(resultMap.get("accountBalance")), 2);
|
accountBalanceByteArr = YKCUtils.getPriceByte(String.valueOf(resultMap.get("accountBalance")), 2);
|
||||||
|
|
||||||
// 应答
|
// 应答
|
||||||
// 交易流水号
|
|
||||||
// String transactionCode = IdUtils.generateTransactionCode(pileSn, connectorCode);
|
|
||||||
byte[] serialNumByteArr = BytesUtil.str2Bcd(transactionCode);
|
byte[] serialNumByteArr = BytesUtil.str2Bcd(transactionCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user