From 3db92a6fff18c1591b298fa0bf8085dfcbdb6747 Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Sat, 06 Jul 2024 15:08:11 +0800
Subject: [PATCH] 修改智能航线规划,修改南昌机场和西安机场人工接管时图片绑定图斑问题
---
src/main/java/com/dji/sample/patches/utils/TimerUtil.java | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/src/main/java/com/dji/sample/patches/utils/TimerUtil.java b/src/main/java/com/dji/sample/patches/utils/TimerUtil.java
index 9509d05..3217bb0 100644
--- a/src/main/java/com/dji/sample/patches/utils/TimerUtil.java
+++ b/src/main/java/com/dji/sample/patches/utils/TimerUtil.java
@@ -64,8 +64,7 @@
private PatchesConfigPojo patchesConfigPojo;
@Autowired
public IWaylineFileService waylineFileService;
- @Autowired
- private IFileMapper fileMapper;
+
@Autowired
private ITbFJService tbFJService;
@Autowired
@@ -99,7 +98,7 @@
//根据获取的图斑集合获得kmz航线文件
MultipartFile multipartFile = null;
try {
- multipartFile = getFile(waylineName, list);
+ multipartFile = getFile(waylineName, list,28.62452712442823, 115.85666327144976);
} catch (IOException e) {
throw new RuntimeException(e);
}
@@ -115,12 +114,12 @@
String times = convertTimestampToFormattedString(time);
sendPostWithParameters(waylineName, waylineFile.getWaylineId(), times, lists1, listOfLists);
updatePatchesStatu(list);
- time = addOneHourToTimestamp(time, 1, 30);
+ time = addOneHourToTimestamp(time, 1, 0);
}
}
- @Scheduled(cron = "0 0 0 * * ?")
+ @Scheduled(cron = "0 1 0 * * ?")
public void myTask2() {
ExecutorService executor = Executors.newSingleThreadExecutor();
executor.execute(() -> {
@@ -143,9 +142,9 @@
// waylineJobService.publishOneFlightTask(waylineJobDTO.get());
// }
// }
- @Scheduled(cron = "0 0 0 * * ?")
+ @Scheduled(cron = "0 0 1 * * ?")
public void mytask4() throws IOException {
- Long time = getCurrentTimestampPlus8Hours(9);
+ Long time = getCurrentTimestampPlus8Hours(8);
List<List<Long>> listOfLists = new ArrayList<>();
List<Long> sublist = new ArrayList<>();
sublist.add(time); // 添加整数值
@@ -156,10 +155,9 @@
sendPostWithParameters("别墅巡查一段", "a07229af-471a-4058-9da6-5a2b84308b9e", times, lists1, listOfLists);
}
- @Scheduled(cron = "0 0 0 * * ?")
+ @Scheduled(cron = "0 50 0 * * ?")
public void mytask5() throws IOException {
Long time = getCurrentTimestampPlus8Hours(9);
- time = addOneHourToTimestamp(time, 0, 50);
List<List<Long>> listOfLists = new ArrayList<>();
List<Long> sublist = new ArrayList<>();
sublist.add(time); // 添加整数值
@@ -170,10 +168,9 @@
sendPostWithParameters("别墅巡查二段", "561ecb37-d673-40f8-a859-05dbfc7d9976", times, lists1, listOfLists);
}
- @Scheduled(cron = "0 0 0 * * ?")
+ @Scheduled(cron = "0 40 1 * * ?")
public void mytask6() throws IOException {
Long time = getCurrentTimestampPlus8Hours(9);
- time = addOneHourToTimestamp(time, 1, 40);
List<List<Long>> listOfLists = new ArrayList<>();
List<Long> sublist = new ArrayList<>();
sublist.add(time); // 添加整数值
@@ -184,10 +181,9 @@
sendPostWithParameters("九洲巡河一段", "9f471686-a73a-4e90-8f37-92eed8ed5929", times, lists1, listOfLists);
}
- @Scheduled(cron = "0 0 0 * * ?")
+ @Scheduled(cron = "0 40 2 * * ?")
public void mytask7() throws IOException {
Long time = getCurrentTimestampPlus8Hours(9);
- time = addOneHourToTimestamp(time, 2, 50);
List<List<Long>> listOfLists = new ArrayList<>();
List<Long> sublist = new ArrayList<>();
sublist.add(time); // 添加整数值
@@ -241,8 +237,9 @@
* @return
* @throws IOException
*/
- public MultipartFile getFile(String waylineName, List<LotInfo> list) throws IOException {
- List<PointPO> coordinates = GeoToolsUtil.getRoutePointOrder(list, 28.62452712442823, 115.85666327144976);
+ public MultipartFile getFile(String waylineName, List<LotInfo> list,double lat, double lon) throws IOException {
+ //南昌28.62452712442823, 115.85666327144976 瑞金 25.8917266,116.020940643
+ List<PointPO> coordinates = GeoToolsUtil.getRoutePointOrder(list, lat, lon);
XMLTemplateModel xmlModel = XMLTemplateModel.init(coordinates, list);
CreateWaylineFileUtils.createWaylineFile(xmlModel, patchesConfigPojo.getTemplate(), patchesConfigPojo.getTargetTemplate(), patchesConfigPojo.getWaylines(), patchesConfigPojo.getTargetWaylines());
// 压缩文件夹中的内容
--
Gitblit v1.9.3