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); }