| | |
| | | */ |
| | | fun dataFusion( |
| | | realTimeDataList: List<BaseRealTimeData>, |
| | | gridData: GridData, |
| | | gridData: GridData?, |
| | | gridCellList: List<GridCell?>, |
| | | ): List<GridDataDetail> { |
| | | // éåèµ°èªçæµæ°æ®ï¼è®¡ç®æ¯ä¸ªç¹æå¨ç½æ ¼ |
| | |
| | | dataMap.forEach { (k, v) -> |
| | | val avgData = v.avg() |
| | | val dataDetail = GridDataDetail().apply { |
| | | dataId = gridData.id |
| | | dataId = gridData?.id |
| | | groupId = k.groupId |
| | | cellId = k.cellIndex |
| | | pm25 = avgData.pm25 |
| | |
| | | gridDataDetailList.add(dataDetail) |
| | | } |
| | | |
| | | gridDataDetailList.sortBy { it.pm25 } |
| | | gridDataDetailList.forEachIndexed { index, d -> |
| | | d.rank = index + 1 |
| | | } |
| | | gridDataDetailList.sortBy { it.cellId } |
| | | |
| | | return gridDataDetailList |
| | | } |
| | | |
| | |
| | | private val gridAodDetailMapper: GridAodDetailMapper, |
| | | ) { |
| | | |
| | | fun fetchGridGroup(areaVo: AreaVo): List<GridGroup?> { |
| | | fun fetchGridGroup(areaVo: AreaVo, type: String?): List<GridGroup?> { |
| | | return gridGroupMapper.selectByExample(Example(GridGroup::class.java).apply { |
| | | createCriteria() |
| | | .andEqualTo("provinceCode", areaVo.provinceCode).andEqualTo("provinceName", areaVo.provinceName) |
| | | .andEqualTo("cityCode", areaVo.cityCode).andEqualTo("cityName", areaVo.cityName) |
| | | .andEqualTo("districtCode", areaVo.districtCode).andEqualTo("districtName", areaVo.districtName) |
| | | .andEqualTo("townCode", areaVo.townCode).andEqualTo("townName", areaVo.townName) |
| | | .andEqualTo("type", type) |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /*****************************************************************/ |
| | | |
| | | fun fetchGridCell(groupId: Int): List<GridCell?> { |
| | | return gridCellMapper.selectByExample(Example(GridCell::class.java).apply { |
| | | createCriteria().andEqualTo("groupId", groupId) |
| | |
| | | fun insertGridCell(gridCellList: List<GridCell?>): Int { |
| | | return gridCellMapper.insertList(gridCellList) |
| | | } |
| | | |
| | | /*****************************************************************/ |
| | | |
| | | fun fetchGridData(groupId: Int, dataTime: LocalDateTime?, type: Int?): List<GridData?> { |
| | | return gridDataMapper.selectByExample(Example(GridData::class.java).apply { |
| | |
| | | return gridDataDetailMapper.insertList(gridDataDetails) |
| | | } |
| | | |
| | | fun fetchGridDataDetail(dataId: Int, groupId: Int?, cellId: Int?): List<GridDataDetail?> { |
| | | fun updateGridDataDetail(gridDataDetails: List<GridDataDetail?>): Int { |
| | | var res = 0 |
| | | gridDataDetails.forEach { |
| | | res += gridDataDetailMapper.updateByPrimaryKey(it) |
| | | } |
| | | return res |
| | | } |
| | | |
| | | fun fetchGridDataDetail(dataId: Int?, groupId: Int?, cellId: Int?): List<GridDataDetail?> { |
| | | return gridDataDetailMapper.selectByExample(Example(GridDataDetail::class.java).apply { |
| | | createCriteria().andEqualTo("dataId", dataId) |
| | | .andEqualTo("groupId", groupId) |
| | |
| | | gridDataDetailMapper.updatePM25Batch(gridDataDetails) |
| | | } |
| | | |
| | | /*****************************************************************/ |
| | | |
| | | // aod ç¸å
³æä½ |
| | | fun fetchGridAod(groupId: Int, dataTime: LocalDateTime?): List<GridAod?> { |
| | |
| | | |
| | | import com.flightfeather.uav.common.exception.BizException |
| | | import com.flightfeather.uav.domain.entity.GridAod |
| | | import com.flightfeather.uav.domain.entity.GridAodDetail |
| | | import com.flightfeather.uav.domain.entity.GridCell |
| | | import com.flightfeather.uav.domain.entity.GridData |
| | | import com.flightfeather.uav.domain.entity.GridDataDetail |
| | |
| | | */ |
| | | interface SatelliteTelemetryService { |
| | | |
| | | fun fetchGridGroup(areaVo: AreaVo, page: Int?, perPage: Int?): Pair<DataHead, List<GridGroup?>> |
| | | fun fetchGridGroup(areaVo: AreaVo, type: String?, page: Int?, perPage: Int?): Pair<DataHead, List<GridGroup?>> |
| | | |
| | | fun deleteGridGroup(groupId: Int) |
| | | |
| | |
| | | fun fetchGridData(groupId: Int, dataTime: LocalDateTime?, type: Int?): List<GridData?> |
| | | |
| | | fun fetchGridDataDetail(dataId: Int, groupId: Int?, cellId: Int?): List<GridDataDetail?> |
| | | |
| | | fun createGridDataAndDataDetail( |
| | | groupId: Int, |
| | | dataTime: LocalDateTime?, |
| | | gridDataDetail: List<GridDataDetail>, |
| | | ): Boolean |
| | | |
| | | /** |
| | | * æ°æ®èå |
| | |
| | | |
| | | fun downloadTemplate(response: HttpServletResponse): Boolean |
| | | |
| | | fun fetchGridAod(groupId: Int, dataTime: LocalDateTime?): List<GridAod?> |
| | | |
| | | @Throws(BizException::class) |
| | | fun importGridAOD(groupId: Int, dataTime: LocalDateTime?, update: Boolean, file: MultipartFile): GridDataImportResult? |
| | | |
| | |
| | | * @param groupId ç½æ ¼ç»ç´¢å¼id |
| | | */ |
| | | fun calGridVertex(groupId: Int): List<GridCell?> |
| | | |
| | | |
| | | /**AODæ°æ®ç¸å
³**************************************************************/ |
| | | fun fetchGridAod(groupId: Int, dataTime: LocalDateTime?): List<GridAod?> |
| | | |
| | | fun fetchGridAODDetail(aodId: Int, groupId: Int?, cellId: Int?): List<GridAodDetail?> |
| | | } |
| | |
| | | package com.flightfeather.uav.lightshare.service |
| | | |
| | | import com.flightfeather.uav.domain.entity.GridCell |
| | | import com.flightfeather.uav.domain.entity.SceneInfo |
| | | import com.flightfeather.uav.lightshare.bean.AreaVo |
| | | |
| | |
| | | fun searchScene(areaVo: AreaVo, page: Int?, perPage: Int?): List<SceneInfo?> |
| | | |
| | | fun searchByCoordinate(lng: Double, lat: Double, radius: Double): List<SceneInfo?> |
| | | |
| | | fun searchByGrid(gridCell: GridCell): List<SceneInfo?> |
| | | } |
| | |
| | | val mission = missionRep.findOne(missionCode) ?: throw BizException("ä»»å¡ä¸åå¨") |
| | | val data = realTimeDataRep.fetchData(mission) |
| | | |
| | | // å建èåæ°æ®ç´¢å¼å¯¹è±¡ |
| | | val newGridData = GridData().apply { |
| | | val oldGridDataList = satelliteGridRep.fetchGridData(GridData().apply { |
| | | this.groupId = groupId |
| | | dataTime = mission.startTime |
| | | type = SatelliteDataType.Monitor.value.toByte() |
| | | mixDataId = missionCode |
| | | }) |
| | | |
| | | if (oldGridDataList.isEmpty()) { |
| | | // å建èåæ°æ®ç´¢å¼å¯¹è±¡ |
| | | val newGridData = GridData().apply { |
| | | this.groupId = groupId |
| | | dataTime = mission.startTime |
| | | type = SatelliteDataType.Monitor.value.toByte() |
| | | mixDataId = mission.missionCode |
| | | } |
| | | satelliteGridRep.insertGridData(newGridData) |
| | | |
| | | // æ¥è¯¢ç½æ ¼åå
æ ¼ä¿¡æ¯ |
| | | val gridCellList = satelliteGridRep.fetchGridCell(groupId) |
| | | |
| | | // å°èµ°èªæ°æ®åå«æç½æ ¼è¿è¡èåè®¡ç® |
| | | val gridDataDetailList = SatelliteGridManage.dataFusion(data, newGridData, gridCellList) |
| | | satelliteGridRep.insertGridDataDetail(gridDataDetailList) |
| | | |
| | | return gridDataDetailList |
| | | } else { |
| | | val oldGridData = oldGridDataList.first() |
| | | val oldGridDataDetailList = satelliteGridRep.fetchGridDataDetail(oldGridData?.id, oldGridData?.groupId, |
| | | null) |
| | | // æ¥è¯¢ç½æ ¼åå
æ ¼ä¿¡æ¯ |
| | | val gridCellList = satelliteGridRep.fetchGridCell(groupId) |
| | | // å°èµ°èªæ°æ®åå«æç½æ ¼è¿è¡èåè®¡ç® |
| | | val gridDataDetailList = SatelliteGridManage.dataFusion(data, oldGridData, gridCellList) |
| | | |
| | | // å°å·²æçæ°æ®idèµå¼ç»æ°çèåç»æï¼ä¸¤ç»ç»æåä»¥æ ¹æ®cellIdé¡ºåºæåï¼æä»¥ç´æ¥å¾ªç¯èµå¼ |
| | | gridDataDetailList.forEachIndexed { index, gridDataDetail -> |
| | | gridDataDetail.id = oldGridDataDetailList[index]?.id |
| | | } |
| | | |
| | | satelliteGridRep.updateGridDataDetail(gridDataDetailList) |
| | | |
| | | return gridDataDetailList |
| | | } |
| | | satelliteGridRep.insertGridData(newGridData) |
| | | |
| | | // æ¥è¯¢ç½æ ¼åå
æ ¼ä¿¡æ¯ |
| | | val gridCellList = satelliteGridRep.fetchGridCell(groupId) |
| | | |
| | | // å°èµ°èªæ°æ®åå«æç½æ ¼è¿è¡èåè®¡ç® |
| | | val gridDataDetailList = SatelliteGridManage.dataFusion(data, newGridData, gridCellList) |
| | | satelliteGridRep.insertGridDataDetail(gridDataDetailList) |
| | | |
| | | return gridDataDetailList |
| | | } |
| | | } |
| | |
| | | import com.flightfeather.uav.biz.satellite.SatelliteGridManage |
| | | import com.flightfeather.uav.common.exception.BizException |
| | | import com.flightfeather.uav.common.utils.FileExchange |
| | | import com.flightfeather.uav.domain.entity.GridAod |
| | | import com.flightfeather.uav.domain.entity.GridCell |
| | | import com.flightfeather.uav.domain.entity.GridData |
| | | import com.flightfeather.uav.domain.entity.GridDataDetail |
| | | import com.flightfeather.uav.domain.entity.GridGroup |
| | | import com.flightfeather.uav.domain.entity.* |
| | | import com.flightfeather.uav.domain.repository.SatelliteGridRep |
| | | import com.flightfeather.uav.lightshare.bean.AreaVo |
| | | import com.flightfeather.uav.lightshare.bean.DataHead |
| | | import com.flightfeather.uav.lightshare.bean.GridDataImportResult |
| | | import com.flightfeather.uav.lightshare.eunm.SatelliteDataType |
| | | import com.flightfeather.uav.lightshare.service.SatelliteTelemetryService |
| | | import com.github.pagehelper.PageHelper |
| | | import org.springframework.stereotype.Service |
| | |
| | | ) : SatelliteTelemetryService { |
| | | |
| | | private val fileExchange = FileExchange() |
| | | override fun fetchGridGroup(areaVo: AreaVo, page: Int?, perPage: Int?): Pair<DataHead, List<GridGroup?>> { |
| | | override fun fetchGridGroup(areaVo: AreaVo, type: String?, page: Int?, perPage: Int?): Pair<DataHead, |
| | | List<GridGroup?>> { |
| | | val pageInfo = PageHelper.startPage<GridGroup>(page ?: 1, perPage ?: 100) |
| | | val res = satelliteGridRep.fetchGridGroup(areaVo) |
| | | val res = satelliteGridRep.fetchGridGroup(areaVo, type) |
| | | return DataHead(pageInfo.pageNum, pageInfo.pages) to res |
| | | } |
| | | |
| | |
| | | return satelliteGridRep.fetchGridData(groupId, dataTime, type) |
| | | } |
| | | |
| | | override fun fetchGridAod(groupId: Int, dataTime: LocalDateTime?): List<GridAod?> { |
| | | return satelliteGridRep.fetchGridAod(groupId, dataTime) |
| | | } |
| | | |
| | | override fun fetchGridDataDetail(dataId: Int, groupId: Int?, cellId: Int?): List<GridDataDetail?> { |
| | | val res = satelliteGridRep.fetchGridDataDetail(dataId, groupId, cellId) |
| | | res.forEach { |
| | |
| | | } |
| | | } |
| | | return res |
| | | } |
| | | |
| | | @Transactional |
| | | override fun createGridDataAndDataDetail( |
| | | groupId: Int, |
| | | dataTime: LocalDateTime?, |
| | | gridDataDetail: List<GridDataDetail>, |
| | | ): Boolean { |
| | | // ä¿åæåç嫿饿µæ°æ® typeå§ç»ä¸º0 |
| | | val type = SatelliteDataType.Original.value |
| | | |
| | | // æ¥æ¾æ¯å¦æåå²è®°å½ |
| | | val gridData = satelliteGridRep.fetchGridData(groupId, dataTime, type) |
| | | // æ åå²è®°å½ååå»ºæ°æ®ç´¢å¼GridDataï¼ä¹åååå
¥æåçæ°æ® |
| | | if (gridData.isEmpty()) { |
| | | val gridDataEntity = GridData() |
| | | gridDataEntity.groupId = groupId |
| | | gridDataEntity.dataTime = dataTime?.atZone(ZoneId.systemDefault())?.toInstant()?.toEpochMilli() |
| | | ?.let { Date(it) } |
| | | gridDataEntity.type = type.toByte() |
| | | satelliteGridRep.insertGridDataAndDetail(gridDataEntity, gridDataDetail) |
| | | } |
| | | // æ´æ°å岿°æ® |
| | | else { |
| | | gridDataDetail.forEach { |
| | | it.dataId = gridData[0]?.id |
| | | it.groupId = gridData[0]?.groupId |
| | | } |
| | | satelliteGridRep.updatePM25Batch(gridDataDetail) |
| | | } |
| | | |
| | | return true |
| | | } |
| | | |
| | | @Transactional |
| | |
| | | |
| | | return cellList |
| | | } |
| | | |
| | | override fun fetchGridAod(groupId: Int, dataTime: LocalDateTime?): List<GridAod?> { |
| | | return satelliteGridRep.fetchGridAod(groupId, dataTime) |
| | | } |
| | | |
| | | override fun fetchGridAODDetail(aodId: Int, groupId: Int?, cellId: Int?): List<GridAodDetail?> { |
| | | return satelliteGridRep.fetchGridAodDetail(aodId, groupId, cellId) |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | 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() |
| | | } |
| | | } |
| | |
| | | package com.flightfeather.uav.lightshare.web |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat |
| | | import com.flightfeather.uav.domain.entity.GridDataDetail |
| | | import com.flightfeather.uav.lightshare.bean.AreaVo |
| | | import com.flightfeather.uav.lightshare.service.SatelliteDataCalculateService |
| | | import com.flightfeather.uav.lightshare.service.SatelliteTelemetryService |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | |
| | | @Api(tags = ["嫿饿µAPIæ¥å£"]) |
| | | @RestController |
| | | @RequestMapping("air/satellite") |
| | | class SatelliteTelemetryController(private val satelliteTelemetryService: SatelliteTelemetryService) { |
| | | class SatelliteTelemetryController( |
| | | private val satelliteTelemetryService: SatelliteTelemetryService, |
| | | private val satelliteDataCalculateService: SatelliteDataCalculateService |
| | | ) { |
| | | |
| | | @ApiOperation(value = "è·åç½æ ¼ç»ä¿¡æ¯") |
| | | @PostMapping("/grid/group") |
| | | fun fetchGridGroup( |
| | | @RequestBody areaVo: AreaVo, |
| | | @RequestParam(required = false) type: String?, |
| | | @RequestParam("page", required = false) page: Int?, |
| | | @RequestParam("per_page", required = false) perPage: Int? |
| | | ) = resPack { satelliteTelemetryService.fetchGridGroup(areaVo, page, perPage) } |
| | | ) = resPack { satelliteTelemetryService.fetchGridGroup(areaVo, type, page, perPage) } |
| | | |
| | | @ApiOperation(value = "è·åç½æ ¼ç»å
å
·ä½ç½æ ¼ä¿¡æ¯") |
| | | @GetMapping("/grid/cell") |
| | |
| | | @ApiParam("ç½æ ¼åå
æ ¼id") @RequestParam(required = false) cellId: Int?, |
| | | ) = resPack { satelliteTelemetryService.fetchGridDataDetail(dataId, groupId, cellId) } |
| | | |
| | | @ApiOperation(value = "ä¿åæåçæç嫿饿µPM2.5ç»ææ°æ®") |
| | | @PostMapping("/grid/data/create") |
| | | fun createGridDataAndDataDetail( |
| | | @ApiParam("ç½æ ¼ç»id") @RequestParam groupId: Int, |
| | | @ApiParam("饿µæ°æ®æ¶é´") |
| | | @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dateTime: LocalDateTime, |
| | | @RequestBody gridDataDetail: List<GridDataDetail> |
| | | ) = resPack { |
| | | satelliteTelemetryService.createGridDataAndDataDetail(groupId, dateTime, gridDataDetail) |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "夿¬¡èµ°èªæ°æ®è¿è¡èå计ç®") |
| | | @PostMapping("/grid/data/mix") |
| | | fun mixGridData( |
| | | @ApiParam("åå§æ°æ®idæ°ç»") @RequestBody dataIdList: List<Int> |
| | | ) = resPack { satelliteTelemetryService.mixGridData(dataIdList) } |
| | | |
| | | |
| | | @ApiOperation(value = "导å
¥å«æé¥æµPM2.5ç»ææ°æ®") |
| | | @PostMapping("/import/grid/data") |
| | |
| | | @GetMapping("/import/grid/data/download/template") |
| | | fun downloadTemplate(@ApiIgnore response: HttpServletResponse) = satelliteTelemetryService.downloadTemplate(response) |
| | | |
| | | @ApiOperation(value = "è·åç½æ ¼ç»ä¸ç嫿饿µaodæ°æ®") |
| | | @GetMapping("/grid/aod") |
| | | fun fetchGridAod( |
| | | @ApiParam("ç½æ ¼ç»id") @RequestParam groupId: Int, |
| | | @ApiParam("饿µæ°æ®æ¶é´") |
| | | @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?, |
| | | ) = resPack { satelliteTelemetryService.fetchGridAod(groupId, dataTime) } |
| | | |
| | | @ApiOperation(value = "导å
¥å«æé¥æµAodç»ææ°æ®") |
| | | @PostMapping("/import/grid/aod") |
| | | fun importGridAOD( |
| | |
| | | @ApiOperation(value = "ä¸è½½å«æé¥æµAodç»ææ°æ®å¯¼å
¥æ¨¡æ¿") |
| | | @GetMapping("/import/grid/aod/download/template") |
| | | fun downloadAODTemplate(@ApiIgnore response: HttpServletResponse) = satelliteTelemetryService.downloadAODTemplate(response) |
| | | |
| | | |
| | | /**AODæ°æ®ç¸å
³**************************************************************/ |
| | | @ApiOperation(value = "è·åç½æ ¼ç»ä¸ç嫿饿µaodæ°æ®") |
| | | @GetMapping("/grid/aod") |
| | | fun fetchGridAod( |
| | | @ApiParam("ç½æ ¼ç»id") @RequestParam groupId: Int, |
| | | @ApiParam("饿µæ°æ®æ¶é´") |
| | | @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?, |
| | | ) = resPack { satelliteTelemetryService.fetchGridAod(groupId, dataTime) } |
| | | |
| | | // @ApiOperation(value = "è·åç½æ ¼ç»ä¸ç嫿饿µAODæ°æ®") |
| | | // @GetMapping("/aod/data") |
| | | // fun fetchGridAOD( |
| | | // @ApiParam("ç½æ ¼ç»id") @RequestParam groupId: Int, |
| | | // @ApiParam("AODæ°æ®æ¶é´") |
| | | // @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?, |
| | | // ) = resPack { satelliteTelemetryService.fetchGridAOD(groupId, dataTime) } |
| | | |
| | | @ApiOperation(value = "è·åç½æ ¼ç»ä¸ç嫿饿µAODå
·ä½æ°æ®") |
| | | @GetMapping("/aod/data/detail") |
| | | fun fetchGridAODDetail( |
| | | @ApiParam("AODæ°æ®id") @RequestParam aodId: Int, |
| | | @ApiParam("ç½æ ¼ç»id") @RequestParam(required = false) groupId: Int?, |
| | | @ApiParam("ç½æ ¼åå
æ ¼id") @RequestParam(required = false) cellId: Int?, |
| | | ) = resPack { satelliteTelemetryService.fetchGridAODDetail(aodId, groupId, cellId) } |
| | | |
| | | |
| | | /**饿µäº§åå¶ä½ç¸å
³**************************************************************/ |
| | | @ApiOperation(value = "çæèµ°èªèå产å") |
| | | @GetMapping("/product/underway/build") |
| | | fun buildUnderwayProduct( |
| | | @ApiParam("èµ°èªä»»å¡ç¼å·") @RequestParam missionCode: String, |
| | | @ApiParam("ç½æ ¼ç»id") @RequestParam groupId: Int, |
| | | ) = resPack { satelliteDataCalculateService.dataFusion(missionCode, groupId) } |
| | | |
| | | |
| | | } |
| | |
| | | package com.flightfeather.uav.lightshare.web |
| | | |
| | | import com.flightfeather.uav.domain.entity.GridCell |
| | | import com.flightfeather.uav.lightshare.bean.AreaVo |
| | | import com.flightfeather.uav.lightshare.service.SceneService |
| | | import io.swagger.annotations.Api |
| | |
| | | @RequestParam("lat") lat: Double, |
| | | @RequestParam("radius") radius: Double, |
| | | ) = resPack { sceneService.searchByCoordinate(lng, lat, radius) } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®å«æç½æ ¼æ¾å°èå´å
çåºæ¯") |
| | | @PostMapping("/find/grid") |
| | | fun searchByGrid( |
| | | @RequestBody gridCell: GridCell, |
| | | ) = resPack { sceneService.searchByGrid(gridCell) } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav |
| | | |
| | | import com.flightfeather.uav.domain.entity.GridAod |
| | | import com.flightfeather.uav.domain.entity.GridAodDetail |
| | | import com.flightfeather.uav.domain.entity.GridData |
| | | import com.flightfeather.uav.domain.entity.GridDataDetail |
| | | import com.flightfeather.uav.domain.mapper.GridAodDetailMapper |
| | | import com.flightfeather.uav.domain.mapper.GridAodMapper |
| | | import com.flightfeather.uav.domain.mapper.GridDataDetailMapper |
| | | import com.flightfeather.uav.domain.mapper.GridDataMapper |
| | | import com.flightfeather.uav.lightshare.eunm.GridType |
| | | import com.flightfeather.uav.lightshare.eunm.SatelliteDataType |
| | | import org.junit.Test |
| | | import org.junit.runner.RunWith |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.boot.test.context.SpringBootTest |
| | | import org.springframework.test.context.junit4.SpringRunner |
| | | import org.springframework.transaction.annotation.Transactional |
| | | |
| | | /** |
| | | * 嫿饿µæµè¯æ°æ®ç®¡ç |
| | | * @date 2025/3/2 |
| | | * @author feiyu02 |
| | | */ |
| | | @RunWith(SpringRunner::class) |
| | | @SpringBootTest |
| | | class SatelliteDebugData { |
| | | |
| | | |
| | | @Autowired |
| | | lateinit var gridDataMapper: GridDataMapper |
| | | |
| | | @Autowired |
| | | lateinit var gridDataDetailMapper: GridDataDetailMapper |
| | | |
| | | @Autowired |
| | | lateinit var gridAodMapper: GridAodMapper |
| | | |
| | | @Autowired |
| | | lateinit var gridAodDetailMapper: GridAodDetailMapper |
| | | |
| | | /** |
| | | * ååçæAODæ°æ® |
| | | */ |
| | | @Test |
| | | fun createAODData() { |
| | | gridDataMapper.select(GridData().apply { type = SatelliteDataType.Original.value.toByte() }).forEach {gridData -> |
| | | val gridAod = GridAod().apply { |
| | | groupId = gridData?.groupId |
| | | dataTime = gridData?.dataTime |
| | | } |
| | | gridAodMapper.insert(gridAod) |
| | | |
| | | gridDataDetailMapper.select(GridDataDetail().apply { |
| | | dataId = gridData?.id |
| | | }).forEach { gridDataDetail-> |
| | | val girdAodDetail = GridAodDetail().apply { |
| | | aodId = gridAod.id |
| | | groupId = gridAod.groupId |
| | | cellId = gridDataDetail?.cellId |
| | | aod = gridDataDetail?.pm25?.div(2) |
| | | } |
| | | gridAodDetailMapper.insert(girdAodDetail) |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Test |
| | | fun refreshDataRank() { |
| | | for (i in 51..51) { |
| | | for (i in 64..69) { |
| | | val dataDetailList = gridDataDetailMapper.selectByExample(Example(GridDataDetail::class.java).apply { |
| | | createCriteria().andEqualTo("dataId", i) |
| | | orderBy("pm25").desc() |
| | |
| | | |
| | | @Test |
| | | fun splitData() { |
| | | val res = satelliteDataCalculateService.splitData(4, 25) |
| | | // println(res) |
| | | val groupIdList = listOf(2, 4) |
| | | val dataId = listOf(34, 29, 25, 18, 8) |
| | | |
| | | groupIdList.forEach {g -> |
| | | dataId.forEach { d -> |
| | | satelliteDataCalculateService.splitData(g, d) |
| | | } |
| | | } |
| | | // val res = satelliteDataCalculateService.splitData(2, 25) |
| | | } |
| | | |
| | | @Test |
| | | fun dataFusion() { |
| | | val res = satelliteDataCalculateService.dataFusion("SH-CN-20241216", 3) |
| | | // println(res) |
| | | val missionList = |
| | | listOf("SH-CN-20241202", "SH-CN-20241127", "SH-CN-20241126-1", "SH-CN-20241126-2", "SH-CN-20241108", "SH-CN-20240823") |
| | | missionList.forEach { m -> |
| | | satelliteDataCalculateService.dataFusion(m, 3) |
| | | } |
| | | // val res = satelliteDataCalculateService.dataFusion("SH-CN-20241216", 3) |
| | | } |
| | | |
| | | @Test |
| | | fun splitDataAndDataFusion() { |
| | | |
| | | } |
| | | } |