feiyu02
2025-04-11 635d762aef37b5de6cd2e34f4a076ab56d9a239d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.flightfeather.uav.lightshare.service.impl
 
import com.flightfeather.uav.common.location.LocationRoadNearby
import com.flightfeather.uav.domain.entity.GridCell
import com.flightfeather.uav.domain.entity.SceneInfo
import com.flightfeather.uav.domain.repository.SceneInfoRep
import com.flightfeather.uav.lightshare.bean.AreaVo
import com.flightfeather.uav.lightshare.service.SceneService
import org.springframework.stereotype.Service
 
@Service
class SceneServiceImpl(
    private val locationRoadNearby: LocationRoadNearby,
    private val sceneInfoRep: SceneInfoRep,
) : SceneService {
 
    override fun searchScene(areaVo: AreaVo, page: Int?, perPage: Int?): List<SceneInfo?> {
        // FIXME: 2024/5/13 因为查询结果用于地图点位标记,需要一次性全部展示,因此暂不使用分页
        return sceneInfoRep.findByArea(areaVo)
    }
 
    override fun searchByCoordinate(lng: Double, lat: Double, radius: Double): List<SceneInfo?> {
        return locationRoadNearby.searchByRadius(Pair(lng, lat), radius)
    }
 
    override fun searchByGrid(gridCell: GridCell): List<SceneInfo?> {
        // 首先用网格中心点以及网格对角线的长度求取四至范围,筛选该范围内的场景点位
        // 再通过计算坐标点是否落在多边形内
        TODO()
    }
}