From 4a976d3763be8a7bed743faf24abf2718ae18e31 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期三, 15 十月 2025 17:34:14 +0800
Subject: [PATCH] 2025.10.15 1. 走航季度报告相关数据计算逻辑调整

---
 src/main/kotlin/com/flightfeather/uav/common/net/AMapService.kt |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/common/net/AMapService.kt b/src/main/kotlin/com/flightfeather/uav/common/net/AMapService.kt
index 52e1940..0baf2e8 100644
--- a/src/main/kotlin/com/flightfeather/uav/common/net/AMapService.kt
+++ b/src/main/kotlin/com/flightfeather/uav/common/net/AMapService.kt
@@ -88,11 +88,15 @@
     fun reGeo(location:Pair<Double, Double>):AMapAddress {
         val res = httpMethod.get("/v3/geocode/regeo", listOf(
             "key" to KEY,
-            "location" to "${location.first},${location.second}"
+            "location" to "${location.first},${location.second}",
+            "extensions" to "all"
         ))
         val obj = handleRes(res)
         try {
-            val a = obj["regeocode"].asJsonObject["addressComponent"].asJsonObject
+            val regeocode = obj["regeocode"].asJsonObject
+            val a = regeocode["addressComponent"].asJsonObject
+            val roads = regeocode["roads"].asJsonArray
+            val roadinters = regeocode["roadinters"].asJsonArray
             return AMapAddress(
                 a["country"].asString,
                 a["province"].asString,
@@ -105,7 +109,7 @@
                 a["streetNumber"].asJsonObject["street"].asString,
             )
         } catch (e: Exception) {
-            throw BizException("楂樺痉API鍧愭爣杞崲閿欒锛�${e.message}")
+            throw BizException("楂樺痉API鍧愭爣杞崲閿欒锛�${e.message}", e.cause)
         }
     }
 

--
Gitblit v1.9.3