| | |
| | | */ |
| | | public void sendControlRequest(Long controllerId, String boxSn, String type, Long requesterId) { |
| | | |
| | | SysUser requester = redisCache.getCacheObject(CacheConstants.SYS_USER_KEY + requesterId); |
| | | SysUser requester = redisCache.getCacheMapValue(CacheConstants.SYS_USER, requesterId.toString()); |
| | | |
| | | UavControlMessage msg = new UavControlMessage(); |
| | | msg.setBoxSn(boxSn); |
| | |
| | | */ |
| | | public void sendControlApproval(Long requesterId, String boxSn, String type, Long controllerId) { |
| | | |
| | | SysUser controller = redisCache.getCacheObject(CacheConstants.SYS_USER_KEY + controllerId); |
| | | SysUser controller = redisCache.getCacheMapValue(CacheConstants.SYS_USER, controllerId.toString()); |
| | | |
| | | UavControlMessage msg = new UavControlMessage(); |
| | | msg.setBoxSn(boxSn); |
| | |
| | | */ |
| | | public void sendControlRejection(Long requesterId, String boxSn, String type, Long controllerId) { |
| | | |
| | | SysUser controller = redisCache.getCacheObject(CacheConstants.SYS_USER_KEY + controllerId); |
| | | SysUser controller = redisCache.getCacheMapValue(CacheConstants.SYS_USER, controllerId.toString()); |
| | | |
| | | UavControlMessage msg = new UavControlMessage(); |
| | | msg.setBoxSn(boxSn); |
| | |
| | | */ |
| | | public void sendControlTakeover(Long oldControllerId, Long newControllerId, String boxSn, String type) { |
| | | |
| | | SysUser newController = redisCache.getCacheObject(CacheConstants.SYS_USER_KEY + newControllerId); |
| | | SysUser oldController = redisCache.getCacheObject(CacheConstants.SYS_USER_KEY + oldControllerId); |
| | | SysUser newController = redisCache.getCacheMapValue(CacheConstants.SYS_USER, newControllerId.toString()); |
| | | SysUser oldController = redisCache.getCacheMapValue(CacheConstants.SYS_USER, oldControllerId.toString()); |
| | | |
| | | // 1️⃣ 通知原控制者:你被抢占了 |
| | | UavControlMessage msgOld = new UavControlMessage(); |
| | |
| | | * 控制权释放 |
| | | */ |
| | | public void sendControlRelease(String boxSn, String type, Long operatorId) { |
| | | SysUser operator = redisCache.getCacheObject(CacheConstants.SYS_USER_KEY + operatorId); |
| | | SysUser operator = redisCache.getCacheMapValue(CacheConstants.SYS_USER, operatorId.toString()); |
| | | |
| | | UavControlMessage message = new UavControlMessage(); |
| | | message.setBoxSn(boxSn); |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("boxSn", boxSn); |
| | | // 将飞行当前控制者用户ID添加到映射中 |
| | | SysUser flyUser = redisCache.getCacheObject(CacheConstants.SYS_USER_KEY + flyUserId); |
| | | SysUser flyUser = redisCache.getCacheMapValue(CacheConstants.SYS_USER, flyUserId.toString()); |
| | | map.put("flyController", flyUser); |
| | | // 将载荷当前控制者用户ID添加到映射中 |
| | | SysUser payloadUser = redisCache.getCacheObject(CacheConstants.SYS_USER_KEY + payloadUserId); |
| | | SysUser payloadUser = redisCache.getCacheMapValue(CacheConstants.SYS_USER, payloadUserId.toString()); |
| | | map.put("payloadController", payloadUser); |
| | | // 返回包含当前控制者信息的映射 |
| | | return map; |