From fb7f3426ffc84773b18f5407ab62e52e91b7fddc Mon Sep 17 00:00:00 2001 From: ZZ Date: Wed, 8 Sep 2021 17:39:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=B9=E7=8E=87=E6=A8=A1=E5=9E=8B=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=E6=95=B0=E6=8D=AE=E9=95=BF=E5=BA=A6=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=98=AF0x5E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/xhpc/pp/controller/ChargingController.java | 3 ++- .../src/main/java/com/xhpc/pp/controller/PileController.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 1269d75b..0bc9d317 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 @@ -91,6 +91,7 @@ public class ChargingController { @PostMapping("charging/start") public R startCharging(@Validated @RequestBody StartChargingData startChargingData) { + //todo protocol versioning String pileNo = startChargingData.getPileNo(); String pkey = "pile:".concat(pileNo); Map cachePile = REDIS.getCacheMap(pkey); @@ -108,7 +109,7 @@ public class ChargingController { String gunkey = "gun:".concat(pileNo).concat(startChargingData.getGunId()); String skey = gunkey.concat(".seqhex"); String seq = seqHex(skey); - String rateModelMsg = "680E".concat(seq).concat("0058").concat(pileNo) + String rateModelMsg = "685E".concat(seq).concat("0058").concat(pileNo) .concat(String.format("%04X", stationRateModelId)) .concat(rateModel); rateModelMsg = rateModelMsg.concat(CRCCalculator.calcCrc(rateModel)); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java index fa8ddccf..cf25db63 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java @@ -66,9 +66,9 @@ public class PileController { if (handler != null) { try { handler.sendClientBinary(HexUtils.toBytes(msg)); - r = R.ok("费率模型已下发"); + r = R.ok("费率模型已下发,请再次启动充电"); } catch (IOException e) { - r = R.fail("费率模型下发失败:".concat(e.getMessage())); + r = R.fail("费率模型下发失败:".concat(e.getMessage()).concat(".无法启动充电")); } } else { r = R.fail("费率模型下发失败,充电桩离线");