From df5db7c72901f153d16b3ae5b532dadcd509c232 Mon Sep 17 00:00:00 2001 From: ZZ Date: Thu, 21 Oct 2021 15:59:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E9=97=B2=E8=AE=A1=E6=95=B0=E5=99=A8?= =?UTF-8?q?=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xhpc/pp/logic/RealtimeDataLogic.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java index 7bcb1eab..ae6573a4 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java @@ -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 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 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);