缓存枪状态字段处理逻辑完善

This commit is contained in:
ZZ 2021-08-23 14:27:57 +08:00
parent 692aa17418
commit 0b2de8b5a4

View File

@ -91,10 +91,10 @@ public class ChargingPileServer {
Map<String, Object> 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<String, Object> cacheGun = REDIS.getCacheMap(gunkey);
if (cacheGun != null) {
if (cacheGun != null && !cacheGun.isEmpty()) {
cacheGun.put("status", DISCONNECTED);
REDIS.setCacheMap(gunkey, cacheGun);
}