From aed297a5fbc8df9dab01b28da21f872ee546b43c Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 13 十月 2025 16:15:11 +0800
Subject: [PATCH] 2025.10.13 1. 统一调整controller层的返回类型,通过添加全局响应增强器GlobalResponseAdvice来管理返回结果; 2. 新增mybatis-generator自定义插件,实现给数据库实体entity自动添加swagger注解@ApiModel和@ApiModelProperty
---
src/main/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearby.kt | 31 +++++++++++++++++++++++--------
1 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearby.kt b/src/main/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearby.kt
index 5719d4e..9b73da9 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearby.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearby.kt
@@ -3,12 +3,14 @@
import cn.flightfeather.supervision.common.utils.ExcelUtil
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper
+import org.springframework.stereotype.Component
import tk.mybatis.mapper.entity.Example
import kotlin.math.PI
/**
* 璺鍛ㄨ竟鏌ヨ
*/
+@Component
class LocationRoadNearby(private val scenseMapper: ScenseMapper) {
private val utilFile = UtilFile()
@@ -51,7 +53,27 @@
}
utilFile.index = 1
}
- utilFile.outPutToFile()
+ utilFile.outPutToFile(distance)
+ }
+
+ /**
+ * 鏍规嵁鍦嗗績鍜屽崐寰勬煡璇㈣寖鍥村唴鐩戞祴鐐癸紙褰撳墠绠�鍖栨搷浣滐紝鏀逛负浠ョ洿寰勪负杈归暱鐨勬鏂瑰舰鑼冨洿锛�
+ * @param center 鍦嗗績
+ * @param radius 鍗婂緞锛堝崟浣嶏細绫筹級
+ * @return 鍦烘櫙鍒楄〃
+ */
+ fun searchByRadius(center: Pair<Double, Double>, radius: Double): List<Scense> {
+ // 姹傜粡搴︾殑鏈�灏忓��
+ val minLng = CoordinateUtil.getPointByLen(center, radius, PI * 1.5).first
+ // 姹傜粡搴︾殑鏈�澶у��
+ val maxLng = CoordinateUtil.getPointByLen(center, radius, PI * 0.5).first
+ // 姹傜含搴︾殑鏈�灏忓��
+ val minLat = CoordinateUtil.getPointByLen(center, radius, PI).second
+ // 姹傜含搴︾殑鏈�澶у��
+ val maxLat = CoordinateUtil.getPointByLen(center, radius, .0).second
+
+ val list = listOf(minLng, maxLng, minLat, maxLat)
+ return getSceneFromDb(list)
}
/**
@@ -88,11 +110,4 @@
.orIsNull("extension1"))
})
}
-
- /**
- * 绮剧‘璁$畻
- */
-// private fun checkDistance(scense: Scense):Boolean {
-//
-// }
}
\ No newline at end of file
--
Gitblit v1.9.3