心跳状态转义

This commit is contained in:
ZZ 2021-08-12 15:08:24 +08:00
parent 8a49b1da68
commit 892528576b

View File

@ -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<String, Integer> cacheGun = REDIS.getCacheMap(gunkey);
cacheGun.put("status", gunStatusInt);
Map<String, String> cacheGun = REDIS.getCacheMap(gunkey);
cacheGun.put("status", stable[gunStatusInt]);
REDIS.setCacheMap(gunkey, cacheGun);
String skey = gunkey.concat(".seqhex");
String seq = seqHex(skey);