修正停机位-登机桥关系只会缓存一个的问题。
This commit is contained in:
+9
-8
@@ -44,19 +44,20 @@ public class OrmsStandAirbridgeManager {
|
|||||||
RedisService redisService = (RedisService) SpringUtil
|
RedisService redisService = (RedisService) SpringUtil
|
||||||
.getBean("redisService");
|
.getBean("redisService");
|
||||||
Boolean keyExists = redisService.hasKey(KEY_ORMSSTANDAIRBRIDGE);
|
Boolean keyExists = redisService.hasKey(KEY_ORMSSTANDAIRBRIDGE);
|
||||||
|
|
||||||
|
|
||||||
if(!keyExists)
|
if(!keyExists)
|
||||||
{
|
{
|
||||||
//远程获取
|
redisService.hmset(KEY_ORMSSTANDAIRBRIDGE, new HashMap<String,Object>(), 3600L);
|
||||||
|
}
|
||||||
|
|
||||||
|
Boolean filedExists = redisService.hHasKey(KEY_ORMSSTANDAIRBRIDGE, standCode);
|
||||||
|
if(!filedExists)
|
||||||
|
{
|
||||||
|
//远程获取
|
||||||
IOrmsStandService ormsStandService = (IOrmsStandService) SpringUtil
|
IOrmsStandService ormsStandService = (IOrmsStandService) SpringUtil
|
||||||
.getBean("ormsStandService");
|
.getBean("ormsStandService");
|
||||||
List<String> lsAirbridgeCodes = ormsStandService.getAirbridgeCodeByStandCode(standCode);
|
List<String> lsAirbridgeCodes = ormsStandService.getAirbridgeCodeByStandCode(standCode);
|
||||||
Map<String,Object> map = new HashMap<>();
|
redisService.hset(KEY_ORMSSTANDAIRBRIDGE, standCode, JsonUtil.getString(lsAirbridgeCodes));
|
||||||
map.put(standCode, JsonUtil.getString(lsAirbridgeCodes));
|
}
|
||||||
|
|
||||||
redisService.hmset(KEY_ORMSSTANDAIRBRIDGE, map, 3600L);
|
|
||||||
}
|
|
||||||
|
|
||||||
//本地获取
|
//本地获取
|
||||||
String jsonListStr = (String) redisService.hget(KEY_ORMSSTANDAIRBRIDGE, standCode);
|
String jsonListStr = (String) redisService.hget(KEY_ORMSSTANDAIRBRIDGE, standCode);
|
||||||
|
|||||||
Reference in New Issue
Block a user