From 53857f42f777e2b9753b8f00cce1a60ce3dcb8fd Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期三, 15 十月 2025 22:42:29 +0800
Subject: [PATCH] 2025.10.15 修改高德地图地理逆编码结果,让地理位置信息更加详细
---
src/main/kotlin/com/flightfeather/uav/biz/report/MissionRiskArea.kt | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 58 insertions(+), 1 deletions(-)
diff --git a/src/main/kotlin/com/flightfeather/uav/biz/report/MissionRiskArea.kt b/src/main/kotlin/com/flightfeather/uav/biz/report/MissionRiskArea.kt
index 38eef5b..4ac954c 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/report/MissionRiskArea.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/report/MissionRiskArea.kt
@@ -15,6 +15,12 @@
class ClueByArea {
var sceneInfo: SceneInfo? = null
+ // 鎵�灞炶闀�
+ var township:String? = null
+ // 鏍煎紡鍖栧湴鍧�
+ var address: String? = null
+ // 浜ゅ弶璺淇℃伅
+ var roadinter:String? = null
var clueByFactorList: MutableList<ClueByFactor>? = null
}
@@ -23,7 +29,13 @@
var clues: MutableList<PollutedClue>? = null
}
- fun generateClueByRiskArea(keyScenes: List<SceneInfo?>, pollutedClues: List<PollutedClue?>): List<ClueByArea> {
+ /**
+ * 鐢熸垚璧拌埅鍏稿瀷闅愭偅鍖哄煙锛屾牴鎹叧閿満鏅垪琛ㄨ繘琛屽垎缁�
+ * @param keyScenes 鍏抽敭鍦烘櫙鍒楄〃
+ * @param pollutedClues 姹℃煋绾跨储鍒楄〃
+ * @return 鎸夊尯鍩熷拰鍥犲瓙鍒嗙粍鐨勬薄鏌撶嚎绱�
+ */
+ fun generateClueByKeyRiskScene(keyScenes: List<SceneInfo?>, pollutedClues: List<PollutedClue?>): List<ClueByArea> {
val result = mutableListOf<ClueByArea>()
pollutedClues.forEach { pollutedClue ->
@@ -83,4 +95,49 @@
return result
}
+
+ /**
+ * 鐢熸垚璧拌埅鍏稿瀷闅愭偅鍖哄煙锛屾牴鎹薄鏌撶嚎绱㈡函婧愬湴鍧�杩涜鍒嗙粍
+ * @param pollutedClues 姹℃煋绾跨储鍒楄〃
+ * @return 鎸夊尯鍩熷拰鍥犲瓙鍒嗙粍鐨勬薄鏌撶嚎绱�
+ */
+ fun generateClueByRiskArea(pollutedClues: List<PollutedClue?>): List<ClueByArea> {
+ val result = mutableListOf<ClueByArea>()
+
+ pollutedClues.forEach { pollutedClue ->
+ if (pollutedClue == null) return@forEach
+ val dataList = pollutedClue.pollutedData?.dataList ?: emptyList()
+ if (dataList.isEmpty()) return@forEach
+
+ // 鎸夋薄鏌撴函婧愬湴鍧�琛楅晣鍜屽洜瀛愬垎缁勭嚎绱�
+ pollutedClue.pollutedArea?.township?.let { township ->
+ var clueByArea = result.find { it.township == township }
+ if (clueByArea == null) {
+ clueByArea = ClueByArea().apply {
+ this.township = township
+ this.address = pollutedClue.pollutedArea?.address
+ this.roadinter = pollutedClue.pollutedArea?.roadinter
+ this.clueByFactorList = mutableListOf()
+ }
+ result.add(clueByArea)
+ }
+
+ val firstFactorType = pollutedClue.pollutedData?.statisticMap?.keys?.first()
+ val afType = AggregatedFactorType.getAFType(firstFactorType)
+ val factorName = afType?.des ?: firstFactorType?.des
+ var clueByFactor = clueByArea.clueByFactorList?.find { it.factor == factorName }
+ if (clueByFactor == null) {
+ clueByFactor = ClueByFactor().apply {
+ this.factor = factorName
+ this.clues = mutableListOf()
+ }
+ clueByArea.clueByFactorList?.add(clueByFactor)
+ }
+
+ clueByFactor.clues?.add(pollutedClue)
+ }
+ }
+
+ return result
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3