| | |
| | | * 尝试从redis获取数据 |
| | | */ |
| | | public int[][] getDataFromRedis(Integer mapType, List<int[]> whitePoints, List<int[]> shuttlePoints) { |
| | | String mapData = null; |
| | | String constantMap = DeviceRedisConstant.MAP; |
| | | if(mapType == NavigationMapType.NONE_LOCK.id){ |
| | | List<List<MapNode>> realMap = navigateMapData.getJsonDataFromDict(-1, null, null);//获取完整地图 |
| | | mapData = JSON.toJSONString(realMap); |
| | | }else { |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | Object o = redisUtil.get(DeviceRedisConstant.MAP + lev); |
| | | if (o == null) { |
| | | return null; |
| | | } |
| | | |
| | | BasMapDto basMap = JSON.parseObject(o.toString(), BasMapDto.class); |
| | | mapData = basMap.getData(); |
| | | constantMap = DeviceRedisConstant.BASE_MAP; |
| | | } |
| | | |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | Object o = redisUtil.get(constantMap + lev); |
| | | if (o == null) { |
| | | return null; |
| | | } |
| | | |
| | | BasMapDto basMap = JSON.parseObject(o.toString(), BasMapDto.class); |
| | | String mapData = basMap.getData(); |
| | | return this.getDataFormString(mapData, mapType, whitePoints, shuttlePoints); |
| | | } |
| | | |