From 409d9bad6c1b633ea7110536cadd077ea277c621 Mon Sep 17 00:00:00 2001 From: ZZ Date: Thu, 10 Mar 2022 10:32:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=B8=8D=E5=8F=98=E4=BD=86?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=8D=8F=E8=AE=AE=E7=89=88=E6=9C=AC=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/service/impl/XhpcChargeOrderServiceImpl.java | 10 +--------- .../com/xhpc/pp/controller/ChargingController.java | 8 +++----- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java index fd02bf47..e62e7a9a 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java @@ -511,10 +511,6 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar return r; } - //获取桩信息 - Map xhpcChargingPileById = - xhpcChargeOrderMapper.getXhpcChargingPileById(xhpcTerminal.getChargingPileId(),null); - //启动充电 //订单流水号 终端号+年月日时分秒+自增4位 共32位 Date date = Calendar.getInstance().getTime(); @@ -525,11 +521,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar startChargingData.setOrderNo(orderNo); startChargingData.setPileNo(xhpcTerminal.getPileSerialNumber()); startChargingData.setGunId(xhpcTerminal.getSerialNumber().substring(14)); - if (xhpcChargingPileById.get("communicationProtocolVersion") != null && !"".equals(xhpcChargingPileById.get("communicationProtocolVersion").toString())) { - startChargingData.setVersion(xhpcChargingPileById.get("communicationProtocolVersion").toString()); - } else { - startChargingData.setVersion("0A"); - } + startChargingData.setVersion("0A"); //桩、平台(最小的) diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java index 8879f1c5..49e7f87f 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java @@ -302,7 +302,7 @@ public class ChargingController { String gunkey = "gun:".concat(connectorId); String skey = gunkey.concat(".seqhex"); String seq = seqHex(skey); - byte[] msg = translateStop(connectorId, version, seq); + byte[] msg = translateStop(connectorId, seq); if (!handler.isOpen()) { log.error("send message failed. [{}]({}) connection lost", handler.getName(), pileNo); removeHandler(pileNo); @@ -349,13 +349,11 @@ public class ChargingController { return HexUtils.toBytes(msg); } - private byte[] translateStop(String connectorId, String version, String seq) { + private byte[] translateStop(String connectorId, String seq) { byte[] data = new byte[0]; data = ArrayUtils.addAll(data, HexUtils.toBytes("680C".concat(seq).concat("0036"))); - if (default_version.equals(version)) { - data = ArrayUtils.addAll(data, HexUtils.toBytes(connectorId)); - } + data = ArrayUtils.addAll(data, HexUtils.toBytes(connectorId)); String msg = HexUtils.toHex(data); msg = msg.concat(CRCCalculator.calcCrc(msg)); log.debug("stop charging, send msg to terminal ({}) >>>> {}", connectorId, msg);