From 892528576bd861c332bd609685fab5ced6afaf16 Mon Sep 17 00:00:00 2001 From: ZZ Date: Thu, 12 Aug 2021 15:08:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=83=E8=B7=B3=E7=8A=B6=E6=80=81=E8=BD=AC?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xhpc/pp/logic/HBLogic.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/HBLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/HBLogic.java index 6749006b..2c883a82 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/HBLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/HBLogic.java @@ -21,6 +21,8 @@ public class HBLogic implements ServiceLogic { private static Logger log = LoggerFactory.getLogger(HBLogic.class); + public static final String[] stable = {"空闲", "故障"}; + @Override public ServiceResult service(ServiceParameter sp) throws Exception { @@ -30,8 +32,8 @@ public class HBLogic implements ServiceLogic { String gunStatus = (String) req.get("gunStatus"); int gunStatusInt = Integer.parseInt(gunStatus); String gunkey = "gun:".concat(pileNo).concat(gunId); - Map cacheGun = REDIS.getCacheMap(gunkey); - cacheGun.put("status", gunStatusInt); + Map cacheGun = REDIS.getCacheMap(gunkey); + cacheGun.put("status", stable[gunStatusInt]); REDIS.setCacheMap(gunkey, cacheGun); String skey = gunkey.concat(".seqhex"); String seq = seqHex(skey);