From ad0f0833ed71aafa21e55a7107e7f9cdb06c54d2 Mon Sep 17 00:00:00 2001 From: ZZ Date: Wed, 17 Nov 2021 09:53:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=93=8D=E5=BA=94=E8=B4=B9?= =?UTF-8?q?=E7=8E=87=E6=A8=A1=E5=9E=8Bid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/xhpc/pp/controller/ChargingController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 b11d239a..4cfbe9b8 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 @@ -90,7 +90,6 @@ 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); @@ -113,11 +112,14 @@ public class ChargingController { r = R.fail(code, responseJson.getString("msg")); } else { r = R.fail(responseJson.getString("msg")); + cachePile.put("rateModelId", stationRateModelId); + REDIS.setCacheMap(pkey, cachePile); } } else { JSONObject json = (JSONObject) JSON.toJSON(startChargingData); String response = HttpUtils.post(fmt(svcSrv).concat("/native/charging/start"), json); r = getRR(response); + r.setData(pileRateModelId); } } return r;