From 274bc2d0f7fe8fe7525196e4d7d6ece1cafe2c6c Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期日, 04 二月 2024 17:32:14 +0800 Subject: [PATCH] 1. 新增静安50分制评估结果转换逻辑; 2. 新增根据坐标圆心和半径查询范围内场景逻辑; --- src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt | 38 ++++++++++++++++++++++---------------- 1 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt index 09bde16..ea2e3be 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt @@ -1,8 +1,9 @@ package cn.flightfeather.supervision.lightshare.service.impl +import cn.flightfeather.supervision.business.location.LocationRoadNearby +import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.domain.ds1.entity.* import cn.flightfeather.supervision.domain.ds1.mapper.* -import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.lightshare.service.* import cn.flightfeather.supervision.lightshare.vo.* import com.github.pagehelper.PageHelper @@ -16,13 +17,14 @@ @Service class ScenseServiceImpl( - val scenseMapper: ScenseMapper, - val sceneConstructionSiteMapper: SceneConstructionSiteMapper, - val sceneDeviceMapper: SceneDeviceMapper, - val sceneMixingPlantMapper: SceneMixingPlantMapper, - val sceneStorageYardMapper: SceneStorageYardMapper, - val sceneWharfMapper: SceneWharfMapper, - val userinfoService: UserinfoService + val scenseMapper: ScenseMapper, + val sceneConstructionSiteMapper: SceneConstructionSiteMapper, + val sceneDeviceMapper: SceneDeviceMapper, + val sceneMixingPlantMapper: SceneMixingPlantMapper, + val sceneStorageYardMapper: SceneStorageYardMapper, + val sceneWharfMapper: SceneWharfMapper, + val userinfoService: UserinfoService, + private val locationRoadNearby: LocationRoadNearby, ) : ScenseService { @Autowired @@ -264,10 +266,10 @@ sceneDetail.scense = scene val mapper = when (scene.typeid.toString()) { - Constant.ScenseType.TYPE1.value -> sceneConstructionSiteMapper - Constant.ScenseType.TYPE2.value -> sceneWharfMapper - Constant.ScenseType.TYPE3.value -> sceneMixingPlantMapper - Constant.ScenseType.TYPE14.value -> sceneStorageYardMapper + Constant.SceneType.TYPE1.value -> sceneConstructionSiteMapper + Constant.SceneType.TYPE2.value -> sceneWharfMapper + Constant.SceneType.TYPE3.value -> sceneMixingPlantMapper + Constant.SceneType.TYPE14.value -> sceneStorageYardMapper else -> null } @@ -304,7 +306,7 @@ var r = 0 var isUpdate = true when (typeId.toString()) { - Constant.ScenseType.TYPE1.value -> { + Constant.SceneType.TYPE1.value -> { val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneConstructionSite::class.java) if (subScene.getsGuid() != null) { val record = sceneConstructionSiteMapper.selectByPrimaryKey(subScene.getsGuid()) @@ -316,7 +318,7 @@ } } } - Constant.ScenseType.TYPE2.value -> { + Constant.SceneType.TYPE2.value -> { val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneWharf::class.java) if (subScene.getsGuid() != null) { val record = sceneWharfMapper.selectByPrimaryKey(subScene.getsGuid()) @@ -328,7 +330,7 @@ } } } - Constant.ScenseType.TYPE3.value -> { + Constant.SceneType.TYPE3.value -> { val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneMixingPlant::class.java) if (subScene.getsGuid() != null) { val record = sceneMixingPlantMapper.selectByPrimaryKey(subScene.getsGuid()) @@ -340,7 +342,7 @@ } } } - Constant.ScenseType.TYPE14.value -> { + Constant.SceneType.TYPE14.value -> { val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneStorageYard::class.java) if (subScene.getsGuid() != null) { val record = sceneStorageYardMapper.selectByPrimaryKey(subScene.getsGuid()) @@ -384,4 +386,8 @@ }) return BaseResponse(true, head = DataHead(p.pageNum, p.pages, p.total), data = list) } + + override fun searchByCoordinate(lng: Double, lat: Double, radius: Double): List<Scense> { + return locationRoadNearby.searchByRadius(Pair(lng, lat), radius) + } } \ No newline at end of file -- Gitblit v1.9.3