From 9e062ae15051bb5af82aa9cbcd478ead2fb94813 Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期五, 08 三月 2024 19:38:12 +0800
Subject: [PATCH] 无人机航线代码修改提交
---
ard-work/src/main/java/com/ruoyi/device/uav/controller/ArdUavController.java | 7 +++++++
ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/device/uav/controller/ArdUavController.java b/ard-work/src/main/java/com/ruoyi/device/uav/controller/ArdUavController.java
index 37f0703..4d5be0a 100644
--- a/ard-work/src/main/java/com/ruoyi/device/uav/controller/ArdUavController.java
+++ b/ard-work/src/main/java/com/ruoyi/device/uav/controller/ArdUavController.java
@@ -131,4 +131,11 @@
String url = "manage/api/v1/alarms/add";
return this.uavService.addAlarm(url, param);
}
+
+ @PostMapping("/saveCurrentGroup")
+ @ApiOperation("鍚屾")
+ public Object saveCurrentGroup(@RequestBody Map<String,Object> param) {
+ String url = "wayline/api/v1/waylines/planning/save_current_group";
+ return this.uavService.saveCurrentGroup(url, param);
+ }
}
diff --git a/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java b/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java
index 2acbd58..8720596 100644
--- a/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java
+++ b/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java
@@ -781,4 +781,40 @@
return new HashMap();
}
}
+
+ public Object saveCurrentGroup(String url, Map<String,Object> data) {
+ String token = this.getToken();
+ url = this.host + url;
+ Map<String,Object> resultMap = addWaylinesPlanning(url,token, data);
+ return resultMap;
+ }
+
+ public Map<String,Object> saveCurrentGroup(String url,String access_token,Map<String,Object> map){
+ MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
+ OkHttpClient okHttpClient = new OkHttpClient();
+
+ RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(map));
+
+ Request request = new Request.Builder().url(url).post(body).addHeader("x-auth-token",access_token).build();
+
+ Response response = null;
+ try {
+ response = okHttpClient.newCall(request).execute();
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ ResponseBody responseBody = response.body();
+
+ try {
+ String message = responseBody.string();// 鍝嶅簲浣�
+ Map<String,Object> map0 = (Map<String, Object>) JSON.parse(message);
+ return map0;
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return new HashMap();
+ }
+ }
}
--
Gitblit v1.9.3