From cfce6e7dba13e625b8bdf38c9de0e4e6a30ef972 Mon Sep 17 00:00:00 2001 From: ZZ Date: Thu, 30 Sep 2021 11:05:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A2=E5=BC=83=E7=A9=BA=E9=97=B2=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xhpc/pp/controller/ChargingController.java | 6 +++++- .../src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java | 2 +- 2 files changed, 6 insertions(+), 2 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 e7b9d383..21c83f7d 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 @@ -230,12 +230,16 @@ public class ChargingController { return R.fail("端口不在空闲或正常状态,稍后再试"); } if (CacheDataUtils.hori(gunkey)) return R.fail("请检查枪号是否正确,稍后再试"); + String orderkey = "order:".concat(startChargingData.getOrderNo()); +// String oldOrderKey = (String) cacheGun.get("orderkey"); +// if (oldOrderKey!=null && !oldOrderKey.equals(orderkey)) { +// return R.fail("端口正在充电"); +// } //todo delete oldOrderKey val? String skey = gunkey.concat(".seqhex"); String seq = seqHex(skey); byte[] msg = translateStart(startChargingData, seq); handler.sendClientBinary(msg); Integer balance = startChargingData.getBalance(); - String orderkey = "order:".concat(startChargingData.getOrderNo()); Map cacheOrder = REDIS.getCacheMap(orderkey); String pkey = "pile:".concat(pileNo); Map cachePile = REDIS.getCacheMap(pkey); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java index 2f0b8624..a4b81530 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java @@ -99,7 +99,7 @@ public class RealtimeDataLogic implements ServiceLogic { REDIS.setCacheMap(stationTermStatusKey, cacheTerminalStatusMap); Map cacheOrder = REDIS.getCacheMap(orderkey); List realtimeDataList = (List) cacheOrder.get("realtimeDataList"); - if (!orderNo.equals("00000000000000000000000000000000")) { + if (!orderNo.equals("00000000000000000000000000000000") && statusInt != 2) { if (realtimeDataList == null) { realtimeDataList = new ArrayList<>(); }