空闲计数器重置

This commit is contained in:
ZZ 2021-10-21 15:59:33 +08:00
parent 062e0c769f
commit df5db7c729

View File

@ -163,20 +163,23 @@ public class RealtimeDataLogic implements ServiceLogic {
}
REDIS.setCacheMap(orderkey, cacheOrder);
} else {
Integer idleCnt = (Integer) cacheGun.get("idleCnt");
idleCnt = idleCnt == null ? 0 : idleCnt;
idleCnt++;
orderkey = (String) cacheGun.get("orderkey");
if (idleCnt > 3 && orderkey != null) {
Map<String, Object> problematicOrder = REDIS.getCacheMap(orderkey);
Object orderData = problematicOrder.get("orderData");
String status = (String) problematicOrder.get("status");
if (!isInteger(status) && !status.equals("充电中") && orderData == null) {
pileOrderService.abnormalOrder(orderNo);
cacheGun.put("orderkey", null);
if (orderkey != null) {
Integer idleCnt = (Integer) cacheGun.get("idleCnt");
idleCnt = idleCnt == null ? 0 : idleCnt;
idleCnt++;
if (idleCnt > 3 && orderkey != null) {
Map<String, Object> problematicOrder = REDIS.getCacheMap(orderkey);
Object orderData = problematicOrder.get("orderData");
String status = (String) problematicOrder.get("status");
if (!isInteger(status) && !status.equals("充电中") && orderData == null) {
pileOrderService.abnormalOrder(orderNo);
cacheGun.put("orderkey", null);
idleCnt = 0;
}
}
cacheGun.put("idleCnt", idleCnt);
}
cacheGun.put("idleCnt", idleCnt);
}
REDIS.setCacheMap(gunkey, cacheGun);
return new ServiceResult(false);