| | |
| | | */ |
| | | public synchronized void initRealtimeBasMap() { |
| | | for (int i = 1; i <= 10; i++) {//总共四层楼 |
| | | Object data = redisUtil.get("realtimeBasMap_" + i); |
| | | Object data = redisUtil.get(RedisKeyType.MAP.key + i); |
| | | if (data == null) {//redis地图数据为空,从数据库中获取 |
| | | BasMap basMap = basMapService.selectLatestMap(i); |
| | | if (basMap == null) { |
| | |
| | | } |
| | | |
| | | //将数据库地图数据存入redis |
| | | redisUtil.set("realtimeBasMap_" + i, JSON.toJSONString(basMap)); |
| | | redisUtil.set(RedisKeyType.MAP.key + i, JSON.toJSONString(basMap)); |
| | | } |
| | | } |
| | | } |
| | |
| | | public synchronized void restartTaskFromRedis() { |
| | | HashMap<Object, Object> map = redisUtil.getRedis(); |
| | | for (Object key : map.keySet()) { |
| | | if (key.toString().contains("lift_wrk_no_")) {//提升机任务 |
| | | if (key.toString().contains(RedisKeyType.LIFT.key)) {//提升机任务 |
| | | LiftRedisCommand redisCommand = JSON.parseObject(map.get(key).toString(), LiftRedisCommand.class); |
| | | if (redisCommand == null) { |
| | | continue; |
| | |
| | | liftProtocol.setTaskNo(redisCommand.getWrkNo());//将提升机线程分配任务号 |
| | | liftProtocol.setProtocolStatus(LiftProtocolStatusType.WORKING);//工作状态 |
| | | |
| | | }else if(key.toString().contains("shuttle_wrk_no_")){//四向穿梭车任务 |
| | | }else if(key.toString().contains(RedisKeyType.SHUTTLE.key)){//四向穿梭车任务 |
| | | ShuttleRedisCommand redisCommand = JSON.parseObject(map.get(key).toString(), ShuttleRedisCommand.class); |
| | | if (redisCommand == null) { |
| | | continue; |