2025.10.15
1. 走航季度报告相关数据计算逻辑调整
| | |
| | | if (highRiskGrid != null) { |
| | | factorValue = highRiskGrid!!.data.getByFactorType(f) |
| | | if (highRiskGrid!!.cell.longitude != null && highRiskGrid!!.cell.latitude != null) { |
| | | Thread.sleep(50) |
| | | Thread.sleep(100) |
| | | val address = AMapService.reGeo(MapUtil.wgs84ToGcj02( |
| | | highRiskGrid!!.cell.longitude.toDouble() |
| | | to highRiskGrid!!.cell.latitude.toDouble() |
| | |
| | | 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, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.lightshare.bean |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat |
| | | import io.swagger.annotations.ApiModel |
| | | import io.swagger.annotations.ApiModelProperty |
| | | import org.springframework.format.annotation.DateTimeFormat |
| | | import java.time.LocalDateTime |
| | | |
| | | /** |
| | | * æ°æ®åææ¥å£æ¥è¯¢é项 |
| | | * @date 2025/10/15 |
| | | * @author feiyu02 |
| | | */ |
| | | @ApiModel(value = "æ°æ®åææ¥å£æ¥è¯¢é项") |
| | | class AnalysisOption { |
| | | |
| | | /** åºå */ |
| | | @ApiModelProperty(value = "åºå") |
| | | var area: AreaVo? = null |
| | | |
| | | /** æ¯å¦ä¸å
å«å
¶ä»åºå¿ */ |
| | | @ApiModelProperty(value = "æ¯å¦ä¸å
å«å
¶ä»åºå¿") |
| | | var removeOtherDistrict: Boolean = false |
| | | |
| | | |
| | | /** æ¯å¦ä¸å
嫿ªæº¯æºå°æ±¡ææºç污æçº¿ç´¢ */ |
| | | @ApiModelProperty(value = "æ¯å¦ä¸å
嫿ªæº¯æºå°æ±¡ææºç污æçº¿ç´¢") |
| | | var removeNoPollutedSource:Boolean = false |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| | | var startTime: LocalDateTime? = null |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "ç»ææ¶é´") |
| | | var endTime: LocalDateTime? = null |
| | | } |
| | |
| | | granularity: String, |
| | | ): List<MissionDetail> |
| | | |
| | | fun generateClueByRiskArea(startTime: Date, endTime: Date, areaVo: AreaVo): List<MissionRiskArea.ClueByArea> |
| | | fun generateClueByRiskArea( |
| | | startTime: Date, |
| | | endTime: Date, |
| | | areaVo: AreaVo, |
| | | removeOtherDistrict: Boolean, |
| | | removeNoPollutedSource: Boolean, |
| | | ): List<MissionRiskArea.ClueByArea> |
| | | |
| | | fun generateClueByRiskArea(missionCode: String): List<MissionRiskArea.ClueByArea> |
| | | |
| | |
| | | private val sourceTraceRep: SourceTraceRep, |
| | | private val sceneInfoRep: SceneInfoRep, |
| | | private val satelliteGridRep: SatelliteGridRep, |
| | | private val satelliteDataCalculateService: SatelliteDataCalculateService |
| | | private val satelliteDataCalculateService: SatelliteDataCalculateService, |
| | | ) : DataAnalysisService { |
| | | |
| | | /** |
| | |
| | | |
| | | override fun generateMissionSummary(missionCode: String): MissionSummary.Summary { |
| | | val mission = missionRep.findOne(missionCode) ?: throw BizException("èµ°èªä»»å¡ä¸åå¨") |
| | | val clues = sourceTraceRep.fetchList(mission.deviceCode, mission.startTime, mission.endTime, MsgType.PolClue) as List<PollutedClue?> |
| | | val clues = sourceTraceRep.fetchList( |
| | | mission.deviceCode, |
| | | mission.startTime, |
| | | mission.endTime, |
| | | MsgType.PolClue |
| | | ) as List<PollutedClue?> |
| | | val summary = MissionSummary().execute(mission.startTime, mission.endTime, listOf(mission), clues) |
| | | return summary |
| | | } |
| | |
| | | |
| | | override fun generateMissionDetail(missionCode: String, granularity: String?): MissionInventory.MissionDetail { |
| | | val mission = missionRep.findOne(missionCode) ?: throw BizException("ä»»å¡ä¸åå¨") |
| | | val missionClues = sourceTraceRep.fetchList(mission.deviceCode, mission.startTime, mission.endTime, MsgType.PolClue) as List<PollutedClue?> |
| | | val missionClues = sourceTraceRep.fetchList( |
| | | mission.deviceCode, |
| | | mission.startTime, |
| | | mission.endTime, |
| | | MsgType.PolClue |
| | | ) as List<PollutedClue?> |
| | | val realTimeData = realTimeDataRep.fetchData(mission) |
| | | val keyScenes = sceneInfoRep.findBySceneTypes( |
| | | listOf( |
| | |
| | | startTime: Date, |
| | | endTime: Date, |
| | | areaVo: AreaVo, |
| | | removeOtherDistrict: Boolean, |
| | | removeNoPollutedSource: Boolean, |
| | | ): List<MissionRiskArea.ClueByArea> { |
| | | val clues = mutableListOf<PollutedClue?>() |
| | | missionRep.findByAreaAndTime(areaVo, startTime, endTime).onEach { |
| | | it ?: return@onEach |
| | | val clue = sourceTraceRep.fetchList(it.deviceCode, it.startTime, it.endTime, MsgType.PolClue) as List<PollutedClue?> |
| | | clues.addAll(clue) |
| | | } |
| | | if (removeOtherDistrict) { |
| | | clues.removeIf { |
| | | !areaVo.districtName.isNullOrBlank() && |
| | | (it?.pollutedArea?.address.isNullOrBlank() |
| | | || !it!!.pollutedArea!!.address!!.contains(areaVo.districtName!!)) |
| | | } |
| | | } |
| | | if (removeNoPollutedSource) { |
| | | clues.removeIf { it?.pollutedSource?.sceneList.isNullOrEmpty() } |
| | | } |
| | | // val keyScenes = sceneInfoRep.findBySceneTypes( |
| | | // listOf( |
| | |
| | | |
| | | override fun generateClueByRiskArea(missionCode: String): List<MissionRiskArea.ClueByArea> { |
| | | val mission = missionRep.findOne(missionCode) ?: throw BizException("ä»»å¡ä¸åå¨") |
| | | val pollutedClues = sourceTraceRep.fetchList(mission.deviceCode, mission.startTime, mission.endTime, MsgType.PolClue) as List<PollutedClue?> |
| | | val pollutedClues = sourceTraceRep.fetchList( |
| | | mission.deviceCode, |
| | | mission.startTime, |
| | | mission.endTime, |
| | | MsgType.PolClue |
| | | ) as List<PollutedClue?> |
| | | val keyScenes = sceneInfoRep.findBySceneTypes( |
| | | listOf( |
| | | SceneType.TYPE19.value, |
| | |
| | | val gridDataDetailList = missionGroups.mapNotNull { (degree, missionList) -> |
| | | // çéåºæç½æ ¼èåæ°æ®çèµ°èªä»»å¡(åæ¶è·å对åºçèåæ°æ®idå表) |
| | | val gridDataIds = mutableListOf<Int>() |
| | | val validMissions = missionList.filter {mission -> |
| | | val gridData = satelliteGridRep.fetchGridData(GridData().apply { missionCode = mission?.missionCode }).firstOrNull() |
| | | val validMissions = missionList.filter { mission -> |
| | | val gridData = |
| | | satelliteGridRep.fetchGridData(GridData().apply { missionCode = mission?.missionCode }).firstOrNull() |
| | | val res = gridData != null |
| | | if (res) gridDataIds.add(gridData?.id ?: 0) |
| | | res |
| | |
| | | package com.flightfeather.uav.lightshare.web |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat |
| | | import com.flightfeather.uav.common.exception.BizException |
| | | import com.flightfeather.uav.lightshare.bean.AnalysisOption |
| | | import com.flightfeather.uav.lightshare.bean.AreaVo |
| | | import com.flightfeather.uav.lightshare.service.DataAnalysisService |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | |
| | | @ApiOperation(value = "èµ°èªå
¸å鿣åºåç»è®¡") |
| | | @PostMapping("/report/clueByRiskArea") |
| | | fun generateClueByRiskArea( |
| | | @ApiParam("å¼å§æ¶é´") @RequestParam |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | startTime: LocalDateTime, |
| | | @ApiParam("ç»ææ¶é´") @RequestParam |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | endTime: LocalDateTime, |
| | | @ApiParam("åºå") @RequestBody areaVo: AreaVo, |
| | | @ApiParam("åºå") @RequestBody analysisOption: AnalysisOption, |
| | | ) = resPack { |
| | | if (analysisOption.startTime == null || analysisOption.endTime == null || analysisOption.area == null) |
| | | throw BizException("åæ°é误, startTime, endTime, areaVoä¸è½ä¸ºç©º") |
| | | val startTime = analysisOption.startTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = analysisOption.endTime!!.atZone(ZoneId.systemDefault()).toInstant() |
| | | val areaVo = analysisOption.area!! |
| | | dataAnalysisService.generateClueByRiskArea( |
| | | Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()), |
| | | areaVo |
| | | areaVo, |
| | | analysisOption.removeOtherDistrict, |
| | | analysisOption.removeNoPollutedSource |
| | | ) |
| | | } |
| | | |
| | |
| | | # password: cn.FLIGHTFEATHER |
| | | |
| | | # è¿ç¨æå¡å¨ |
| | | url: jdbc:mysql://47.100.191.150:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: remoteU1 |
| | | password: eSoF8DnzfGTlhAjE |
| | | |
| | | # url: jdbc:mysql://114.215.109.124:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | # url: jdbc:mysql://47.100.191.150:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | # username: remoteU1 |
| | | # password: feiyu2024 |
| | | # password: eSoF8DnzfGTlhAjE |
| | | |
| | | url: jdbc:mysql://114.215.109.124:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: remoteU1 |
| | | password: feiyu2024 |
| | | |
| | | springfox: |
| | | documentation: |
| | |
| | | package com.flightfeather.uav |
| | | |
| | | import com.flightfeather.uav.common.utils.DateUtil |
| | | import com.flightfeather.uav.common.utils.FileExchange |
| | | import com.flightfeather.uav.common.utils.FileUtil |
| | | import com.flightfeather.uav.common.utils.TimeUtil |
| | | import com.flightfeather.uav.common.net.AMapService |
| | | import com.flightfeather.uav.common.utils.* |
| | | import com.flightfeather.uav.domain.entity.BaseRealTimeData |
| | | import com.flightfeather.uav.domain.entity.Company |
| | | import com.flightfeather.uav.domain.entity.GridDataDetail |
| | |
| | | println(sc.nextLine()) |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | fun reGeo() { |
| | | AMapService.reGeo(MapUtil.wgs84ToGcj02(121.461753 to 31.252426)) |
| | | } |
| | | } |
| | |
| | | //// "SH-CN-20250723(01)" |
| | | // ) |
| | | // val startTime = LocalDateTime.of(2024, 12, 31, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant() |
| | | val startTime = LocalDateTime.of(2024, 12, 4, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = LocalDateTime.of(2025, 4, 11, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant() |
| | | val startTime = LocalDateTime.of(2025, 7, 1, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = LocalDateTime.of(2025, 9, 30, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant() |
| | | val missions = missionMapper.selectByExample(Example(Mission::class.java).apply { |
| | | createCriteria().andBetween("startTime", startTime, endTime) |
| | | }) |
| | |
| | | // "SH-CN-20240723(02)", |
| | | //// "SH-CN-20250723(01)" |
| | | // ) |
| | | val startTime = LocalDateTime.of(2024, 12, 4, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = LocalDateTime.of(2025, 4, 11, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant() |
| | | val startTime = LocalDateTime.of(2025, 7, 1, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant() |
| | | val endTime = LocalDateTime.of(2025, 9, 30, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant() |
| | | val missions = missionMapper.selectByExample(Example(Mission::class.java).apply { |
| | | createCriteria().andBetween("startTime", startTime, endTime) |
| | | }) |
| | |
| | | |
| | | @Test |
| | | fun generateClueByRiskArea() { |
| | | val res = dataAnalysisService.generateClueByRiskArea(startTime, endTime, areaVo) |
| | | val res = dataAnalysisService.generateClueByRiskArea(startTime, endTime, areaVo, false, false) |
| | | println(res) |
| | | } |
| | | } |
| | |
| | | @Test |
| | | fun calMissionInfo() { |
| | | missionMapper.selectByExample(Example(Mission::class.java).apply { |
| | | createCriteria().andGreaterThanOrEqualTo("startTime", "2025-08-08 08:30:00") |
| | | createCriteria().andGreaterThanOrEqualTo("startTime", "2025-07-08 08:30:00") |
| | | }).forEach {mission -> |
| | | mission?.let { missionService.calMissionInfo(it.missionCode) } |
| | | Thread.sleep(1000) |