空闲计数器重置
This commit is contained in:
parent
062e0c769f
commit
df5db7c729
@ -163,10 +163,11 @@ public class RealtimeDataLogic implements ServiceLogic {
|
|||||||
}
|
}
|
||||||
REDIS.setCacheMap(orderkey, cacheOrder);
|
REDIS.setCacheMap(orderkey, cacheOrder);
|
||||||
} else {
|
} else {
|
||||||
|
orderkey = (String) cacheGun.get("orderkey");
|
||||||
|
if (orderkey != null) {
|
||||||
Integer idleCnt = (Integer) cacheGun.get("idleCnt");
|
Integer idleCnt = (Integer) cacheGun.get("idleCnt");
|
||||||
idleCnt = idleCnt == null ? 0 : idleCnt;
|
idleCnt = idleCnt == null ? 0 : idleCnt;
|
||||||
idleCnt++;
|
idleCnt++;
|
||||||
orderkey = (String) cacheGun.get("orderkey");
|
|
||||||
if (idleCnt > 3 && orderkey != null) {
|
if (idleCnt > 3 && orderkey != null) {
|
||||||
Map<String, Object> problematicOrder = REDIS.getCacheMap(orderkey);
|
Map<String, Object> problematicOrder = REDIS.getCacheMap(orderkey);
|
||||||
Object orderData = problematicOrder.get("orderData");
|
Object orderData = problematicOrder.get("orderData");
|
||||||
@ -174,10 +175,12 @@ public class RealtimeDataLogic implements ServiceLogic {
|
|||||||
if (!isInteger(status) && !status.equals("充电中") && orderData == null) {
|
if (!isInteger(status) && !status.equals("充电中") && orderData == null) {
|
||||||
pileOrderService.abnormalOrder(orderNo);
|
pileOrderService.abnormalOrder(orderNo);
|
||||||
cacheGun.put("orderkey", null);
|
cacheGun.put("orderkey", null);
|
||||||
|
idleCnt = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cacheGun.put("idleCnt", idleCnt);
|
cacheGun.put("idleCnt", idleCnt);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
REDIS.setCacheMap(gunkey, cacheGun);
|
REDIS.setCacheMap(gunkey, cacheGun);
|
||||||
return new ServiceResult(false);
|
return new ServiceResult(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user