|
@@ -11,7 +11,9 @@ import com.ruoyi.common.log.annotation.Log;
|
|
import com.ruoyi.common.log.enums.BusinessType;
|
|
import com.ruoyi.common.log.enums.BusinessType;
|
|
import com.sooka.sponest.monitor.remoteapi.service.center.system.RemoteService;
|
|
import com.sooka.sponest.monitor.remoteapi.service.center.system.RemoteService;
|
|
import com.sooka.sponest.monitor.uav.domain.CentermonitorTUav;
|
|
import com.sooka.sponest.monitor.uav.domain.CentermonitorTUav;
|
|
|
|
+import com.sooka.sponest.monitor.uav.domain.dto.CentermonitorTUavDTO;
|
|
import com.sooka.sponest.monitor.uav.service.ICentermonitorTUavService;
|
|
import com.sooka.sponest.monitor.uav.service.ICentermonitorTUavService;
|
|
|
|
+import com.sooka.sponest.monitor.websocket.WebSocketUsers;
|
|
import org.apache.http.HttpEntity;
|
|
import org.apache.http.HttpEntity;
|
|
import org.apache.http.HttpResponse;
|
|
import org.apache.http.HttpResponse;
|
|
import org.apache.http.client.config.RequestConfig;
|
|
import org.apache.http.client.config.RequestConfig;
|
|
@@ -32,9 +34,13 @@ import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.net.ssl.SSLContext;
|
|
import javax.net.ssl.SSLContext;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import javax.websocket.*;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.net.URI;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
+import java.util.concurrent.CountDownLatch;
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 无人机Controller
|
|
* 无人机Controller
|
|
@@ -62,9 +68,11 @@ public class CentermonitorTUavController extends BaseController {
|
|
|
|
|
|
private static final String REQUEST_URL = "https://47.93.50.30/etkqq/login";
|
|
private static final String REQUEST_URL = "https://47.93.50.30/etkqq/login";
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 2.登录鉴权
|
|
|
|
+ */
|
|
@GetMapping("/getToken")
|
|
@GetMapping("/getToken")
|
|
public String getToken() {
|
|
public String getToken() {
|
|
-
|
|
|
|
try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
HttpPost httpPost = new HttpPost(REQUEST_URL);
|
|
HttpPost httpPost = new HttpPost(REQUEST_URL);
|
|
// 使用 JSON 处理库构建请求体
|
|
// 使用 JSON 处理库构建请求体
|
|
@@ -88,11 +96,8 @@ public class CentermonitorTUavController extends BaseController {
|
|
log.error("请求失败,状态码: {}", statusCode);
|
|
log.error("请求失败,状态码: {}", statusCode);
|
|
return "请求失败,状态码: " + statusCode;
|
|
return "请求失败,状态码: " + statusCode;
|
|
}
|
|
}
|
|
- } catch (IOException e) {
|
|
|
|
- log.error("请求发生异常: {}", e.getMessage(), e);
|
|
|
|
- return "请求发生异常: " + e.getMessage();
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- throw new RuntimeException(e);
|
|
|
|
|
|
+ return "请求发生异常: " + e.getMessage();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -115,7 +120,7 @@ public class CentermonitorTUavController extends BaseController {
|
|
if (responseEntity != null) {
|
|
if (responseEntity != null) {
|
|
JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
String returnUrl = requestUrl + "/tower/pub/zgtt?sign=" + json.get("data").toString();
|
|
String returnUrl = requestUrl + "/tower/pub/zgtt?sign=" + json.get("data").toString();
|
|
- return AjaxResult.success("操作成功",returnUrl);
|
|
|
|
|
|
+ return AjaxResult.success("操作成功", returnUrl);
|
|
} else {
|
|
} else {
|
|
log.error("响应实体为空");
|
|
log.error("响应实体为空");
|
|
return AjaxResult.error("响应实体为空");
|
|
return AjaxResult.error("响应实体为空");
|
|
@@ -129,6 +134,683 @@ public class CentermonitorTUavController extends BaseController {
|
|
return AjaxResult.error("请求失败");
|
|
return AjaxResult.error("请求失败");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 无人机组织树
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getCopterTree")
|
|
|
|
+ public AjaxResult getCopterTree() {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ // 使用 HttpGet 进行 GET 请求
|
|
|
|
+ HttpGet httpGet = new HttpGet(requestUrl + "/etkqq/copterMetaData/getCopterTree");
|
|
|
|
+ httpGet.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpGet);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString(), json.get("result"));
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ return AjaxResult.error("请求失败,状态码: " + statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 无人机详细信息
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getCopterBasicData/{copterId}")
|
|
|
|
+ public AjaxResult getCopterBasicData(@PathVariable("copterId") String copterId) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ // 使用 HttpGet 进行 GET 请求
|
|
|
|
+ HttpGet httpGet = new HttpGet(requestUrl + "/etkqq/copterMetaData/getCopterBasicData?copterId=" + copterId);
|
|
|
|
+ httpGet.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpGet);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString(), json.get("result"));
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 机库组织树
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getOrgTree")
|
|
|
|
+ public AjaxResult getOrgTree() {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ // 使用 HttpGet 进行 GET 请求
|
|
|
|
+ HttpGet httpGet = new HttpGet(requestUrl + "/etkqq/security/getOrgTree");
|
|
|
|
+ httpGet.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpGet);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString(), json.get("result"));
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 机库详细信息
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getBoxBasicData/{boxId}")
|
|
|
|
+ public AjaxResult getBoxBasicData(@PathVariable("boxId") String boxId) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ // 使用 HttpGet 进行 GET 请求
|
|
|
|
+ HttpGet httpGet = new HttpGet(requestUrl + "/etkqq/boxMetaData/getBoxBasicData?boxId=" + boxId);
|
|
|
|
+ httpGet.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpGet);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString(), json.get("result"));
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 无人机直播视频
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/openLive")
|
|
|
|
+ public AjaxResult openLive(@RequestBody Map<String, Object> map) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ HttpPost httpPost = new HttpPost(requestUrl + "/etkqq/box/openLive");
|
|
|
|
+ // 使用 JSON 处理库构建请求体
|
|
|
|
+ String requestBody = "{" +
|
|
|
|
+ "\"copterId\": \"" + map.get("copterId") + "\", " +
|
|
|
|
+ "\"boxId\": \"" + map.get("boxId") + "\", " +
|
|
|
|
+ "\"copterSn\": \"" + map.get("copterSn") + "\", " +
|
|
|
|
+ "\"boxSn\": \"" + map.get("boxSn") + "\" ," +
|
|
|
|
+ "\"type\": \"" + map.get("type") + "\"}";
|
|
|
|
+ StringEntity entity = new StringEntity(requestBody, StandardCharsets.UTF_8);
|
|
|
|
+ httpPost.setEntity(entity);
|
|
|
|
+ httpPost.setHeader("Content-Type", "application/json");
|
|
|
|
+ httpPost.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpPost);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString(), json.get("result"));
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ return AjaxResult.error("请求失败,状态码: " + statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 无人机控制指令
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/realControl")
|
|
|
|
+ public AjaxResult realControl(@RequestBody Map<String, Object> map) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ HttpPost httpPost = new HttpPost(requestUrl + "/etkqq/box/realControl");
|
|
|
|
+ // 使用 JSON 处理库构建请求体
|
|
|
|
+ LinkedHashMap<String, Object> point = (LinkedHashMap<String, Object>) map.get("point");
|
|
|
|
+ String requestBody = "{" +
|
|
|
|
+ "\"boxId\": \"" + map.get("boxId") + "\", " +
|
|
|
|
+ "\"copterId\": \"" + map.get("copterId") + "\", " +
|
|
|
|
+ "\"boxSn\": \"" + map.get("boxSn") + "\" ," +
|
|
|
|
+ "\"code\": \"" + map.get("code") + "\", " +
|
|
|
|
+ "\"speed\": \"" + map.get("speed") + "\", " +
|
|
|
|
+ "\"angle\": \"" + map.get("angle") + "\", " +
|
|
|
|
+ "\"mode\": \"" + map.get("mode") + "\", " +
|
|
|
|
+ "\"point\": {" +
|
|
|
|
+ "\"latitude\": \"" + point.get("latitude") + "\", " +
|
|
|
|
+ "\"longitude\": \"" + point.get("longitude") + "\", " +
|
|
|
|
+ "\"altitude\": \"" + point.get("altitude") + "\"" +
|
|
|
|
+ "}" +
|
|
|
|
+ "}";
|
|
|
|
+ StringEntity entity = new StringEntity(requestBody, StandardCharsets.UTF_8);
|
|
|
|
+ httpPost.setEntity(entity);
|
|
|
|
+ httpPost.setHeader("Content-Type", "application/json");
|
|
|
|
+ httpPost.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpPost);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ return AjaxResult.error("请求失败,状态码: " + statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 无人机实时轨迹
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/currentWayline")
|
|
|
|
+ public AjaxResult currentWayline(@RequestBody Map<String, Object> map) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ HttpPost httpPost = new HttpPost(requestUrl + "/etkqq/task/currentWayline");
|
|
|
|
+ // 使用 JSON 处理库构建请求体
|
|
|
|
+ String requestBody = "{\"copterSn\": \"" + map.get("copterSn") + "\"}";
|
|
|
|
+ StringEntity entity = new StringEntity(requestBody, StandardCharsets.UTF_8);
|
|
|
|
+ httpPost.setEntity(entity);
|
|
|
|
+ httpPost.setHeader("Content-Type", "application/json");
|
|
|
|
+ httpPost.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpPost);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString(), json.get("result"));
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ return AjaxResult.error("请求失败,状态码: " + statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 无人机历史轨迹
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/historyWayline")
|
|
|
|
+ public AjaxResult historyWayline(@RequestBody Map<String, Object> map) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ HttpPost httpPost = new HttpPost(requestUrl + "/etkqq/task/historyWayline");
|
|
|
|
+ // 使用 JSON 处理库构建请求体
|
|
|
|
+ String requestBody = "{\"copterSn\": \"" + map.get("copterSn") + "\"}";
|
|
|
|
+ StringEntity entity = new StringEntity(requestBody, StandardCharsets.UTF_8);
|
|
|
|
+ httpPost.setEntity(entity);
|
|
|
|
+ httpPost.setHeader("Content-Type", "application/json");
|
|
|
|
+ httpPost.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpPost);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString(), json.get("result"));
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ return AjaxResult.error("请求失败,状态码: " + statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 喊话器喊话
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/drcSpeakerTtsPlayStart")
|
|
|
|
+ public AjaxResult drcSpeakerTtsPlayStart(@RequestBody Map<String, Object> map) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ HttpPost httpPost = new HttpPost(requestUrl + "/etkqq/box/drcSpeakerTtsPlayStart");
|
|
|
|
+ // 使用 JSON 处理库构建请求体
|
|
|
|
+ String requestBody = "{" +
|
|
|
|
+ "\"boxSn\": \"" + map.get("boxSn") + "\" ," +
|
|
|
|
+ "\"copterSn\": \"" + map.get("copterSn") + "\", " +
|
|
|
|
+ "\"name\": \"" + map.get("name") + "\", " +
|
|
|
|
+ "\"text\": \"" + map.get("text") + "\"}";
|
|
|
|
+ StringEntity entity = new StringEntity(requestBody, StandardCharsets.UTF_8);
|
|
|
|
+ httpPost.setEntity(entity);
|
|
|
|
+ httpPost.setHeader("Content-Type", "application/json");
|
|
|
|
+ httpPost.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpPost);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ return AjaxResult.error("请求失败,状态码: " + statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 开始执行计划
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/startPlan")
|
|
|
|
+ public AjaxResult startPlan(@RequestParam(value = "boxSn") String boxSn, @RequestParam(value = "planId") String planId) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ // 使用 HttpGet 进行 GET 请求
|
|
|
|
+ HttpGet httpGet = new HttpGet(requestUrl + "/etkqq/boxMetaData/getBoxBasicData?boxSn=" + boxSn + "&planId=" + planId);
|
|
|
|
+ httpGet.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpGet);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 快速执飞
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/fastFlying")
|
|
|
|
+ public AjaxResult fastFlying(@RequestBody Map<String, Object> map) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ HttpPost httpPost = new HttpPost(requestUrl + "/etkqq/plan/fastFlying");
|
|
|
|
+ // 使用 JSON 处理库构建请求体
|
|
|
|
+ String requestBody = "{" +
|
|
|
|
+ "\"boxSn\": \"" + map.get("boxSn") + "\" ," +
|
|
|
|
+ "\"boxId\": \"" + map.get("boxId") + "\", " +
|
|
|
|
+ "\"copterId\": \"" + map.get("copterId") + "\", " +
|
|
|
|
+ "\"copterSn\": \"" + map.get("copterSn") + "\", " +
|
|
|
|
+ "\"longitude\": \"" + map.get("longitude") + "\", " +
|
|
|
|
+ "\"latitude\": \"" + map.get("latitude") + "\", " +
|
|
|
|
+ "\"flySpeed\": \"" + map.get("flySpeed") + "\", " +
|
|
|
|
+ "\"boxPosition\": \"" + map.get("boxPosition") + "\", " +
|
|
|
|
+ "\"expand2\": \"" + map.get("expand2") + "\"}";
|
|
|
|
+ StringEntity entity = new StringEntity(requestBody, StandardCharsets.UTF_8);
|
|
|
|
+ httpPost.setEntity(entity);
|
|
|
|
+ httpPost.setHeader("Content-Type", "application/json");
|
|
|
|
+ httpPost.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpPost);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ return AjaxResult.error("请求失败,状态码: " + statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 规划航线
|
|
|
|
+ */
|
|
|
|
+ //todo 待完善 且调用接口返回500 根据增删改查修改返回类型
|
|
|
|
+ @PostMapping("/operationTask")
|
|
|
|
+ public AjaxResult operationTask(@RequestBody CentermonitorTUavDTO dto) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ LinkedHashMap<String, Object> task = new LinkedHashMap<>();
|
|
|
|
+ task.put("taskType", dto.getTaskType());
|
|
|
|
+ task.put("taskName", dto.getTaskName());
|
|
|
|
+ task.put("heightMode", dto.getHeightMode());
|
|
|
|
+ task.put("relativeHeight", dto.getRelativeHeight());
|
|
|
|
+ task.put("globalHeight", dto.getGlobalHeight());
|
|
|
|
+ task.put("returnAltitude", dto.getReturnAltitude());
|
|
|
|
+ task.put("completeAction", dto.getCompleteAction());
|
|
|
|
+ task.put("flySpeed", dto.getFlySpeed());
|
|
|
|
+ task.put("lostSignal", dto.getLostSignal());
|
|
|
|
+ task.put("flyCourse", dto.getFlyCourse());
|
|
|
|
+ task.put("flySeconds", dto.getFlySeconds());
|
|
|
|
+ task.put("waypointNum", dto.getWaypointNum());
|
|
|
|
+ task.put("boxPosition", dto.getBoxPosition());
|
|
|
|
+ task.put("resolution", dto.getResolution());
|
|
|
|
+ task.put("headingOverlap", dto.getHeadingOverlap());
|
|
|
|
+ task.put("sideOverlap", dto.getSideOverlap());
|
|
|
|
+ task.put("heading", dto.getHeading());
|
|
|
|
+ task.put("wayLineYaw", dto.getWayLineYaw());
|
|
|
|
+ task.put("cameraId", dto.getCameraId());
|
|
|
|
+ task.put("wayPointList", dto.getWayPointList());
|
|
|
|
+ task.put("boxId", dto.getBoxId());
|
|
|
|
+ task.put("type", dto.getType());
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ HttpPost httpPost = new HttpPost(requestUrl + "/etkqq/task/operationTask");
|
|
|
|
+ // 使用 JSON 处理库构建请求体
|
|
|
|
+ String requestBody = JSONObject.toJSONString(task);
|
|
|
|
+ StringEntity entity = new StringEntity(requestBody, StandardCharsets.UTF_8);
|
|
|
|
+ httpPost.setEntity(entity);
|
|
|
|
+ httpPost.setHeader("Content-Type", "application/json");
|
|
|
|
+ httpPost.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpPost);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ return AjaxResult.error("请求失败,状态码: " + statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ //todo websocket
|
|
|
|
+ WebSocketUsers.sendMessageToUsersByText(JSON.toJSONString(AjaxResult.success("10002",new ArrayList<>())));
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 规划计划
|
|
|
|
+ */
|
|
|
|
+ //todo 待完善 且调用接口返回500 根据增删改查修改返回类型
|
|
|
|
+ @PostMapping("/operationPlan")
|
|
|
|
+ public AjaxResult operationPlan(@RequestBody Map<String, Object> map) {
|
|
|
|
+ String token = getToken();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(token);
|
|
|
|
+ if (token == null) {
|
|
|
|
+ return AjaxResult.error("获取 token 失败");
|
|
|
|
+ }
|
|
|
|
+ R<String> requestResult = remoteService.uavSignUrl();
|
|
|
|
+ if (requestResult == null || requestResult.getData() == null) {
|
|
|
|
+ log.error("获取的请求 URL 为空");
|
|
|
|
+ return AjaxResult.error("获取的请求 URL 为空");
|
|
|
|
+ }
|
|
|
|
+ String requestUrl = requestResult.getData();
|
|
|
|
+ try (CloseableHttpClient httpClient = createCustomHttpClient()) {
|
|
|
|
+ HttpPost httpPost = new HttpPost(requestUrl + "/etkqq/plan/operationPlan");
|
|
|
|
+ // 使用 JSON 处理库构建请求体
|
|
|
|
+ String requestBody = "{" +
|
|
|
|
+ "\"caption\": \"" + map.get("caption") + "\" ," +
|
|
|
|
+ "\"planType\": \"" + map.get("planType") + "\", " +
|
|
|
|
+ "\"businessType\": \"" + map.get("businessType") + "\", " +
|
|
|
|
+ "\"isAi\": \"" + map.get("isAi") + "\", " +
|
|
|
|
+ "\"aiMode\": \"" + map.get("aiMode") + "\", " +
|
|
|
|
+ "\"isHover\": \"" + map.get("isHover") + "\", " +
|
|
|
|
+ "\"taskId\": \"" + map.get("taskId") + "\", " +
|
|
|
|
+ "\"type\": \"" + map.get("type") + "\", " +
|
|
|
|
+ "\"boxId\": \"" + map.get("boxId") + "\"}";
|
|
|
|
+ StringEntity entity = new StringEntity(requestBody, StandardCharsets.UTF_8);
|
|
|
|
+ httpPost.setEntity(entity);
|
|
|
|
+ httpPost.setHeader("Content-Type", "application/json");
|
|
|
|
+ httpPost.setHeader("Authorization", jsonObject.get("token").toString());
|
|
|
|
+
|
|
|
|
+ // 发送请求
|
|
|
|
+ HttpResponse response = httpClient.execute(httpPost);
|
|
|
|
+ int statusCode = response.getStatusLine().getStatusCode();
|
|
|
|
+ if (statusCode == 200) {
|
|
|
|
+ HttpEntity responseEntity = response.getEntity();
|
|
|
|
+ if (responseEntity != null) {
|
|
|
|
+ JSONObject json = JSON.parseObject(EntityUtils.toString(responseEntity, StandardCharsets.UTF_8));
|
|
|
|
+ return AjaxResult.success(json.get("retMsg").toString());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("请求失败,状态码: {}", statusCode);
|
|
|
|
+ return AjaxResult.error("请求失败,状态码: " + statusCode);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("发生未知异常", e);
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("操作成功,暂无数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 无人机机库实时数据
|
|
|
|
+ */
|
|
|
|
+ //todo 未测试接口连通性
|
|
|
|
+ @GetMapping("/getHangarRealTimeData")
|
|
|
|
+ public String getHangarRealTimeData(@RequestParam(value = "copterSn") String copterSn,@RequestParam(value = "boxSn") String boxSn) {
|
|
|
|
+ final CountDownLatch latch = new CountDownLatch(1);
|
|
|
|
+ final StringBuilder response = new StringBuilder();
|
|
|
|
+ try {
|
|
|
|
+ WebSocketContainer container = ContainerProvider.getWebSocketContainer();
|
|
|
|
+ String uri = "wss://47.93.50.30/etkqq/api/websocket/100";
|
|
|
|
+
|
|
|
|
+ Session session = container.connectToServer(new Endpoint() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onOpen(Session session, EndpointConfig config) {
|
|
|
|
+ String message = String.format("{\"copterSn\": \"%s\", \"boxSn\": \"%s\"}",
|
|
|
|
+ copterSn, boxSn);
|
|
|
|
+ session.addMessageHandler(new MessageHandler.Whole<String>() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onMessage(String msg) {
|
|
|
|
+ response.append(msg);
|
|
|
|
+ latch.countDown();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ session.getAsyncRemote().sendText(message);
|
|
|
|
+ }
|
|
|
|
+ }, ClientEndpointConfig.Builder.create().build(), new URI(uri));
|
|
|
|
+ latch.await(10, TimeUnit.SECONDS);
|
|
|
|
+ session.close();
|
|
|
|
+ return response.toString();
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ return "Error: " + e.getMessage();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 机库日志
|
|
|
|
+ */
|
|
|
|
+ //todo 未测试接口连通性
|
|
|
|
+ @GetMapping("/getHangarLog")
|
|
|
|
+ public String getHangarLog(@RequestParam(value = "copterSn") String copterSn,@RequestParam(value = "boxSn") String boxSn) {
|
|
|
|
+ final CountDownLatch latch = new CountDownLatch(1);
|
|
|
|
+ final StringBuilder response = new StringBuilder();
|
|
|
|
+ try {
|
|
|
|
+ WebSocketContainer container = ContainerProvider.getWebSocketContainer();
|
|
|
|
+ String uri = "wss://47.93.50.30/etkqq/api/websocket/102";
|
|
|
|
+
|
|
|
|
+ Session session = container.connectToServer(new Endpoint() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onOpen(Session session, EndpointConfig config) {
|
|
|
|
+ String message = String.format("{\"copterSn\": \"%s\", \"boxSn\": \"%s\"}",
|
|
|
|
+ copterSn, boxSn);
|
|
|
|
+ session.addMessageHandler(new MessageHandler.Whole<String>() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onMessage(String msg) {
|
|
|
|
+ response.append(msg);
|
|
|
|
+ latch.countDown();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ session.getAsyncRemote().sendText(message);
|
|
|
|
+ }
|
|
|
|
+ }, ClientEndpointConfig.Builder.create().build(), new URI(uri));
|
|
|
|
+ latch.await(10, TimeUnit.SECONDS);
|
|
|
|
+ session.close();
|
|
|
|
+ return response.toString();
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ return "Error: " + e.getMessage();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 工厂方法:创建自定义配置的 HttpClient
|
|
* 工厂方法:创建自定义配置的 HttpClient
|
|
@@ -221,4 +903,13 @@ public class CentermonitorTUavController extends BaseController {
|
|
public AjaxResult selectCentermonitorTUavByDeptId() {
|
|
public AjaxResult selectCentermonitorTUavByDeptId() {
|
|
return AjaxResult.success(centermonitorTUavService.selectCentermonitorTUavByDeptId());
|
|
return AjaxResult.success(centermonitorTUavService.selectCentermonitorTUavByDeptId());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据uavSn获取无人机及所属部门集合
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/selectUavByUavId/{uavSn}")
|
|
|
|
+ public AjaxResult selectUavByUavId(@PathVariable("uavSn") String uavSn) {
|
|
|
|
+ return AjaxResult.success(centermonitorTUavService.selectUavByUavSn(uavSn));
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|