From 0b2de8b5a43ccab1f9bfbe6005b3c11fd2f62fc1 Mon Sep 17 00:00:00 2001 From: ZZ Date: Mon, 23 Aug 2021 14:27:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9E=AA=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xhpc/pp/server/ChargingPileServer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileServer.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileServer.java index 2fab2346..e31ea524 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileServer.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileServer.java @@ -91,10 +91,10 @@ public class ChargingPileServer { Map cachePile = REDIS.getCacheMap(pkey); cachePile.put("status", DISCONNECTED); REDIS.setCacheMap(pkey, cachePile); - for (int i = 1; i < 10; i++) { + for (int i = 1; i <= 10; i++) { String gunkey = "gun:".concat(pileNo).concat(String.format("%02d", i)); Map cacheGun = REDIS.getCacheMap(gunkey); - if (cacheGun != null) { + if (cacheGun != null && !cacheGun.isEmpty()) { cacheGun.put("status", DISCONNECTED); REDIS.setCacheMap(gunkey, cacheGun); }