From 7ed9e64f4b566574d19a6be15660cba9dbe6cabe Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Mon, 31 Jul 2023 09:01:52 +0800
Subject: [PATCH] chore:测试提交
---
screen-api/src/main/resources/mapper/HistorySecondUavMapper.xml | 3 ++-
screen-api/src/main/java/com/moral/api/controller/UAVController.java | 11 ++++-------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/screen-api/src/main/java/com/moral/api/controller/UAVController.java b/screen-api/src/main/java/com/moral/api/controller/UAVController.java
index 5ab31e9..e7ad570 100644
--- a/screen-api/src/main/java/com/moral/api/controller/UAVController.java
+++ b/screen-api/src/main/java/com/moral/api/controller/UAVController.java
@@ -77,7 +77,7 @@
@PostMapping("test")
public ResultMessage test(@RequestBody Map<String, Object> params){
//������������������������
- if (!params.containsKey("mac") || !params.containsKey("batch") || !params.containsKey("height")|| !params.containsKey("uvasize")) {
+ if (!params.containsKey("mac") || !params.containsKey("batch") || !params.containsKey("height1")|| !params.containsKey("uvasize")|| !params.containsKey("height2")) {
return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
}
String uvasize = params.get("uvasize").toString();
@@ -432,7 +432,7 @@
//���������������
public static String getResult(ArrayList<String[]> doubleArrayList){
-// UAVResultDTO uavResultDTO = new UAVResultDTO();
+
int total = doubleArrayList.size();
double X = 0, Y = 0, Z = 0;
for (int i = 0; i < total; i++) {
@@ -453,14 +453,11 @@
double Lon = Math.atan2(Y, X);
double Hyp = Math.sqrt(X * X + Y * Y);
double Lat = Math.atan2(Z, Hyp);
-
+ DecimalFormat decimalFormat = new DecimalFormat("#.00000000");
double rsLon = Lon * 180 / Math.PI;
double rsLat = Lat * 180 / Math.PI;
-// uavResultDTO.setFlyLon(rsLon);
-// uavResultDTO.setFlyLat(rsLat);
- return rsLon+"_"+rsLat;
-// return uavResultDTO;
+ return decimalFormat.format(rsLon)+"_"+decimalFormat.format(rsLat);
}
diff --git a/screen-api/src/main/resources/mapper/HistorySecondUavMapper.xml b/screen-api/src/main/resources/mapper/HistorySecondUavMapper.xml
index cda70d3..ce67a21 100644
--- a/screen-api/src/main/resources/mapper/HistorySecondUavMapper.xml
+++ b/screen-api/src/main/resources/mapper/HistorySecondUavMapper.xml
@@ -15,6 +15,7 @@
SELECT history_second_uav.time,`value`
FROM history_second_uav WHERE mac = #{mac}
AND batch = #{batch}
- HAVING abs(`value`->>'$.flyhig') <![CDATA[>=]]> #{height}
+ HAVING abs(`value`->>'$.flyhig') <![CDATA[>=]]> #{height1}
+ and abs(`value`->>'$.flyhig') <![CDATA[<=]]> #{height2}
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0