| | |
| | | } |
| | | } |
| | | } |
| | | // repeat(config.factorCount) { i -> |
| | | // eIndex[i]++ |
| | | // // èµ·å§æ°æ® |
| | | // if (lastData == null) { |
| | | // refreshAfterCheckResult(i, data) |
| | | // } |
| | | // // 夿ç¸é»æ°æ®æ¯å¦è¿ç»å¹¶ä¸æ¯å¦æ»¡è¶³å¼å¸¸å¤æ |
| | | // if (!isContinue) { |
| | | // checkResult() |
| | | // // æ°æ®ä¸è¿ç»æ¶ï¼è®°å½å¼å¸¸æ
åµ |
| | | // if (eIndex[i] - sIndex[i] >= durationCount) { |
| | | // refreshAfterCheckResult(i, data) |
| | | // } |
| | | // } else { |
| | | // if (hasException[i]) { |
| | | // existException[i] = true |
| | | // exceptionData[i].add(data) |
| | | // } else { |
| | | // // å¼å¸¸ä¸åéå¤åºç°æ¶ï¼è®°å½å¼å¸¸æ
åµ |
| | | // checkResult() |
| | | // if (eIndex[i] - sIndex[i] >= durationCount) { |
| | | // refreshAfterCheckResult(i, data) |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | lastData = data |
| | | } |
| | | |
| | |
| | | package com.flightfeather.uav.biz.dataanalysis |
| | | |
| | | import com.flightfeather.uav.biz.FactorFilter |
| | | import com.flightfeather.uav.biz.dataanalysis.exceptiontype.ExceptionDataExceed |
| | | import com.flightfeather.uav.biz.dataanalysis.exceptiontype.ExceptionSlideAverage |
| | | import com.flightfeather.uav.biz.dataanalysis.exceptiontype.ExceptionValueMutation |
| | | import com.flightfeather.uav.biz.dataanalysis.model.DataAnalysisConfig |
| | |
| | | import com.flightfeather.uav.domain.repository.RealTimeDataRep |
| | | import com.flightfeather.uav.domain.repository.SegmentInfoRep |
| | | import com.flightfeather.uav.socket.eunm.UWDeviceType |
| | | import org.springframework.stereotype.Component |
| | | import java.time.LocalDateTime |
| | | import java.time.ZoneId |
| | | import java.time.format.DateTimeFormatter |
| | | |
| | | /** |
| | | * æ°æ®å¼å¸¸åææ§å¶å¨ |
| | | */ |
| | | @Component |
| | | class ExceptionAnalysisController( |
| | | private val realTimeDataRep: RealTimeDataRep, |
| | | private val locationRoadNearby: LocationRoadNearby, |
| | |
| | | private fun initTask(config: DataAnalysisConfig) { |
| | | taskList.clear() |
| | | taskList.apply { |
| | | add(ExceptionDataExceed(config)) |
| | | // add(ExceptionDataExceed(config)) |
| | | add(ExceptionValueMutation(config)) |
| | | add(ExceptionSlideAverage(config)) |
| | | } |
| | | } |
| | | |
| | | fun run(mission: Mission, factorFilter: FactorFilter): List<ExceptionResult> { |
| | | fun execute(mission: Mission, factorFilter: FactorFilter): List<ExceptionResult> { |
| | | running = true |
| | | val config = DataAnalysisConfig(mission, ExceptionSetting(), factorFilter) |
| | | initTask(config) |
| | |
| | | // æ¥è¯¢å¼å¸¸å¨è¾¹å¯è½æ±¡ææº |
| | | nearBy(r, config) |
| | | // æ¥è¯¢æ¶æ®µæå¨è·¯æ®µ |
| | | road(r) |
| | | // road(r) |
| | | // å°æ°æ®è½¬æ¢ä¸ºéç¨æ ¼å¼ |
| | | r.dataVoList = r.dataList.map { e-> e.toDataVo() } |
| | | } |
| | | // åå¨åæç»æ |
| | | result.addAll(it.resultList) |
| | |
| | | running = false |
| | | return result |
| | | } |
| | | |
| | | // private fun |
| | | |
| | | private fun nearBy(r: ExceptionResult, config: DataAnalysisConfig) { |
| | | if (r.longitude != null && r.latitude != null) { |
| | |
| | | } |
| | | r.relatedSceneId = idList |
| | | r.relatedSceneName = nameList |
| | | r.relatedSceneList = sceneList |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.biz.dataanalysis |
| | | |
| | | import com.flightfeather.uav.biz.dataanalysis.exceptiontype.ExceptionSlideAverage |
| | | import com.flightfeather.uav.biz.dataanalysis.exceptiontype.ExceptionValueMutation |
| | | import com.flightfeather.uav.biz.dataanalysis.model.DataAnalysisConfig |
| | | import com.flightfeather.uav.common.location.LocationRoadNearby |
| | | import com.flightfeather.uav.domain.repository.RealTimeDataRep |
| | | import com.flightfeather.uav.domain.repository.SegmentInfoRep |
| | | |
| | | /** |
| | | * |
| | | * @date 2025/5/8 |
| | | * @author feiyu02 |
| | | */ |
| | | class RealTimeExceptionAnalysisController ( |
| | | private val realTimeDataRep: RealTimeDataRep, |
| | | private val locationRoadNearby: LocationRoadNearby, |
| | | private val segmentInfoRep: SegmentInfoRep, |
| | | ){ |
| | | |
| | | private val taskList = mutableListOf<BaseExceptionAnalysis>() |
| | | |
| | | private fun initTask(config: DataAnalysisConfig) { |
| | | taskList.clear() |
| | | taskList.apply { |
| | | add(ExceptionValueMutation(config)) |
| | | add(ExceptionSlideAverage(config)) |
| | | } |
| | | } |
| | | |
| | | // 计ç®åå²ä»»å¡ |
| | | } |
| | |
| | | /** |
| | | * æ°æ®è¶
æ å¼å¸¸åæ |
| | | */ |
| | | @Deprecated("åè¶
æ å¤å®é»è¾è®¾å®çè¶
æ å¼ææ¼æ´ï¼") |
| | | class ExceptionDataExceed(config: DataAnalysisConfig) : BaseExceptionContinuousSingle(config) { |
| | | |
| | | override fun getExceptionType(): ExceptionType = ExceptionType.TYPE2 |
| | |
| | | } |
| | | res[f] = bool |
| | | } |
| | | // repeat(config.factorCount) { i -> |
| | | // val data = n.getByFactorIndex(i) |
| | | // val limit = config.exceptionSetting.getByFactorIndex(i) |
| | | // val bool = if (data != null && limit != null) { |
| | | // data >= limit |
| | | // } else { |
| | | // false |
| | | // } |
| | | // res.add(bool) |
| | | // } |
| | | return res |
| | | } |
| | | |
| | |
| | | val b2 = r >= config.mutationRate |
| | | if (b1) special = true |
| | | res[f] = (b1 || b2) |
| | | if (res[f] == true) println("p: $pValue --- n: $nValue --- r: $r") |
| | | // if (res[f] == true) println("p: $pValue --- n: $nValue --- r: $r") |
| | | } |
| | | // repeat(config.factorCount) { i-> |
| | | // if (p?.getByFactorIndex(i) == null || n.getByFactorIndex(i) == null) { |
| | | // res.add(false) |
| | | // return@repeat |
| | | // } |
| | | // val pValue = p.getByFactorIndex(i)!! |
| | | // val nValue = n.getByFactorIndex(i)!! |
| | | // val r = abs((pValue - nValue) / pValue) |
| | | // val b1 = r >= (2 * config.mutationRate) |
| | | // val b2 = r >= config.mutationRate |
| | | // if (b1) special = true |
| | | // res.add(b1 || b2) |
| | | // } |
| | | |
| | | return res |
| | | } |
| | |
| | | val b1 = special && (eIndex - sIndex) >= (config.mutationNum / 2) |
| | | val b2 = (eIndex - sIndex) >= config.mutationNum |
| | | special = false |
| | | println("sIndex: $sIndex --- eIndex: $eIndex --- special: $special") |
| | | // println("sIndex: $sIndex --- eIndex: $eIndex --- special: $special") |
| | | return b1 || b2 |
| | | } |
| | | } |
| | |
| | | val factorFilter: FactorFilter, |
| | | ){ |
| | | // è¿ç»çªåæ°æ®ä¸ªæ° |
| | | var mutationNum = 6 |
| | | var mutationNum = 2 |
| | | // çªåç |
| | | var mutationRate = .5 |
| | | |
| | |
| | | var changeTrendGroup = 12 |
| | | // æ»å¨å¹³åå¼è¿ç» |
| | | var changeTrendInterval = 12 |
| | | var changeTrendRate = 1 |
| | | var changeTrendRate = .5 |
| | | // æ»å¨å¹³åå¼ååçå¼å¸¸è¿ç»æ¬¡æ° |
| | | var changeTrendTimes = 3 |
| | | |
| | |
| | | |
| | | import com.flightfeather.uav.biz.FactorFilter |
| | | import com.flightfeather.uav.domain.entity.BaseRealTimeData |
| | | import com.flightfeather.uav.domain.entity.SceneInfo |
| | | import com.flightfeather.uav.lightshare.bean.DataVo |
| | | import java.math.BigDecimal |
| | | import java.util.* |
| | | |
| | |
| | | var relatedSceneId: List<String>? = null |
| | | // ç¸å
³ä¼ä¸åç§°ï¼åç§°ä¹é´;åéï¼ |
| | | var relatedSceneName: List<String>? = null |
| | | var relatedSceneList: List<SceneInfo?>? = null |
| | | // å¼å¸¸æ°æ®ï¼å¤´å°¾å¯è½å
å«ä¸å®éçåç§» |
| | | var dataList: MutableList<BaseRealTimeData> = mutableListOf() |
| | | var dataVoList: List<DataVo>? = null |
| | | } |
| | |
| | | private fun saveResult(segmentInfoList:List<SegmentInfo>) { |
| | | val res = mutableListOf<SegmentInfo>() |
| | | segmentInfoList.forEach { s -> |
| | | // 夿å½åè®°å½åä¸ä¸ªè®°å½æ¯å¦æ°æ®å䏿¡éè·¯ |
| | | // 夿å½åè®°å½åä¸ä¸ªè®°å½æ¯å¦å±äºå䏿¡éè·¯ |
| | | if (res.isNotEmpty()) { |
| | | val lastOne = res.last() |
| | | // è¥å±äºåä¸éè·¯ï¼åå¹¶ |
| | |
| | | import com.flightfeather.uav.biz.dataprocess.PreData |
| | | import com.flightfeather.uav.common.chart.DataToChartUtil |
| | | import com.flightfeather.uav.common.exception.BizException |
| | | import com.flightfeather.uav.common.location.LocationRoadNearby |
| | | import com.flightfeather.uav.common.pdf.GeneratePdfUtil |
| | | import com.flightfeather.uav.common.utils.DateUtil |
| | | import com.flightfeather.uav.common.utils.ImageUtil |
| | | import com.flightfeather.uav.domain.entity.Mission |
| | | import com.flightfeather.uav.domain.repository.MissionRep |
| | | import com.flightfeather.uav.domain.repository.RealTimeDataRep |
| | | import com.flightfeather.uav.domain.repository.SegmentInfoRep |
| | | import org.springframework.beans.BeanUtils |
| | | import org.springframework.beans.factory.annotation.Value |
| | | import org.springframework.stereotype.Component |
| | |
| | | */ |
| | | @Component |
| | | class MissionReport( |
| | | private val exceptionAnalysisController: ExceptionAnalysisController, |
| | | private val missionRep: MissionRep, |
| | | private val realTimeDataRep: RealTimeDataRep, |
| | | private val locationRoadNearby: LocationRoadNearby, |
| | | private val segmentInfoRep: SegmentInfoRep, |
| | | @Value("\${filePath}") |
| | | private val filePath: String, |
| | | ) { |
| | | |
| | | private val exceptionAnalysisController = |
| | | ExceptionAnalysisController(realTimeDataRep, locationRoadNearby, segmentInfoRep) |
| | | |
| | | data class Param( |
| | | val district: String, |
| | | val town: String, |
| | |
| | | |
| | | // è·åå¼å¸¸åæç»æ |
| | | fun exceptionAnalysis(mission: Mission, factorFilter: FactorFilter): List<ExceptionResult> { |
| | | return exceptionAnalysisController.run(mission, factorFilter) |
| | | return exceptionAnalysisController.execute(mission, factorFilter) |
| | | } |
| | | |
| | | // 计ç®åå¼åæ°æ®èå´ |
| | |
| | | val closeList = mutableListOf<BaseRealTimeData>() |
| | | records.add(mutableListOf()) |
| | | data.forEachIndexed { i, d -> |
| | | // if (records.size == 23) { |
| | | // println(records.size) |
| | | // } |
| | | var isSame = false |
| | | if (i > 0) { |
| | | // åä¸ä¸ªææçæµç¹ |
| | |
| | | } |
| | | |
| | | if (distance >= MIN_DISTANCE) { |
| | | // 两ç¹è·ç¦»è¾å¤§æ¶ï¼è®¡ç®å¤¹è§ |
| | | val deg = CoordinateUtil.getAngle( |
| | | lastData.longitude!!.toDouble(), lastData.latitude!!.toDouble(), |
| | | d.longitude!!.toDouble(), d.latitude!!.toDouble(), |
| | | ) |
| | | // è®¡ç® |
| | | isSame = if (lastDegList.isNotEmpty()) { |
| | | var bool = true |
| | | |
| | | |
| | | // // åºç°è§åº¦æ¥è¿åç´ç¶æçæ¬¡æ° |
| | | // var unSameCount = 0 |
| | | // // æ¯è¾å½åæ¹ä½è§åä¸ä¸ç»æ¯ä¸ªæ¹ä½è§ç差弿¯å¦é½å¤äºèå´å
|
| | | // for (lastDeg in lastDegList) { |
| | | // val diffDeg = abs(deg - lastDeg) |
| | | // if (diffDeg in (90.0 - VERTICAL_OFFSET_DEG)..(90.0 + VERTICAL_OFFSET_DEG) |
| | | // || diffDeg in (270.0 - VERTICAL_OFFSET_DEG)..(270.0 + VERTICAL_OFFSET_DEG) |
| | | // ) { |
| | | // unSameCount++ |
| | | // } |
| | | // } |
| | | // // 彿¥è¿åç´çè§åº¦è¶
è¿ä¸ä¸ç»å¹³è¡è§åº¦çä¸åæ¶ï¼è®¤ä¸ºä»è¯¥ç¹è½¨è¿¹è½¬å¼¯ï¼æ¶é¤ä¸ªå«åæ ç¹ç±äºå®ä½è¯¯å·®å¯¼è´çé误影åï¼ |
| | | // bool = unSameCount < (lastDegList.size / 3 + 1) |
| | | |
| | | // å°å½ååæ ç¹çè§åº¦åä¹åææå±äºåä¸éè·¯çåæ ç¹çè§åº¦çåå¼åæ¯è¾ï¼ |
| | | // è§£å³å½è½¦è¾è¡é©¶è½¨è¿¹ä¸ºå¼§çº¿æ¶ï¼ä¾å¦ç«äº¤æ¡¥ç弧线转弯çï¼ï¼ä¸ç´è¢«å¤å®ä¸ºè½¬åå¹
度ä¸å¤§å±äºåä¸è·¯æ®µçé®é¢ |
| | | val avgDeg = avgDegree(lastDegList) |
| | | val diffDeg = abs(deg - avgDeg) |
| | | if (diffDeg in (90.0 - VERTICAL_OFFSET_DEG)..(90.0 + VERTICAL_OFFSET_DEG) |
| | |
| | | } |
| | | bool |
| | | } else { |
| | | // å½åæ ç¹å½¢æææè·¯å¾æ¶ï¼è®°å½ä¸ºä¸ä¸ä¸ªåæ ç¹ |
| | | // 彿²¡æåå²è§åº¦æ¶ï¼ç´æ¥ä¿åï¼å¹¶è®¤ä¸ºæ¯åä¸è·¯æ®µ |
| | | lastDegList.add(deg) |
| | | true |
| | | } |
| | | // æ¸
空ä¸ä¸ç»è·ç¦»æ¥è¿çåæ ç¹ |
| | | closeList.clear() |
| | | } else { |
| | | // 两ç¹è·ç¦»æ¥è¿æ¶ï¼æ·»å è®°å½ |
| | | closeList.add(d) |
| | | isSame = true |
| | | } |
| | | } |
| | | // å¦å认为åä¸è·¯æ®µ |
| | | // 两ç¹åæ ä¸åæ³ï¼å认为åä¸è·¯æ®µ |
| | | else { |
| | | isSame = true |
| | | } |
| | |
| | | private Integer fatherGroupId; |
| | | |
| | | /** |
| | | * æå¤§æ¨ªåæ |
| | | */ |
| | | @Column(name = "max_xaxis") |
| | | private Integer maxXaxis; |
| | | |
| | | /** |
| | | * æå¤§çºµåæ |
| | | */ |
| | | @Column(name = "max_yaxis") |
| | | private Integer maxYaxis; |
| | | |
| | | /** |
| | | * @return id |
| | | */ |
| | | public Integer getId() { |
| | |
| | | public void setFatherGroupId(Integer fatherGroupId) { |
| | | this.fatherGroupId = fatherGroupId; |
| | | } |
| | | |
| | | /** |
| | | * è·åæå¤§æ¨ªåæ |
| | | * |
| | | * @return max_xaxis - æå¤§æ¨ªåæ |
| | | */ |
| | | public Integer getMaxXaxis() { |
| | | return maxXaxis; |
| | | } |
| | | |
| | | /** |
| | | * 设置æå¤§æ¨ªåæ |
| | | * |
| | | * @param maxXaxis æå¤§æ¨ªåæ |
| | | */ |
| | | public void setMaxXaxis(Integer maxXaxis) { |
| | | this.maxXaxis = maxXaxis; |
| | | } |
| | | |
| | | /** |
| | | * è·åæå¤§çºµåæ |
| | | * |
| | | * @return max_yaxis - æå¤§çºµåæ |
| | | */ |
| | | public Integer getMaxYaxis() { |
| | | return maxYaxis; |
| | | } |
| | | |
| | | /** |
| | | * 设置æå¤§çºµåæ |
| | | * |
| | | * @param maxYaxis æå¤§çºµåæ |
| | | */ |
| | | public void setMaxYaxis(Integer maxYaxis) { |
| | | this.maxYaxis = maxYaxis; |
| | | } |
| | | } |
| | |
| | | @Column(name = "end_time") |
| | | private Date endTime; |
| | | |
| | | @Column(name = "district_name") |
| | | private String districtName; |
| | | |
| | | /** |
| | | * æ°æ®æ¯å¦å·²ç»æåå
¥åº |
| | | */ |
| | | @Column(name = "data_pulled") |
| | | private Boolean dataPulled; |
| | | |
| | | @Column(name = "province_code") |
| | | private String provinceCode; |
| | | |
| | | @Column(name = "province_name") |
| | | private String provinceName; |
| | | |
| | | @Column(name = "city_code") |
| | | private String cityCode; |
| | | |
| | | @Column(name = "city_name") |
| | | private String cityName; |
| | | |
| | | @Column(name = "district_code") |
| | | private String districtCode; |
| | | |
| | | @Column(name = "district_name") |
| | | private String districtName; |
| | | |
| | | @Column(name = "town_code") |
| | | private String townCode; |
| | | |
| | | @Column(name = "town_name") |
| | | private String townName; |
| | | |
| | | /** |
| | | * @return mission_code |
| | |
| | | } |
| | | |
| | | /** |
| | | * @return district_name |
| | | */ |
| | | public String getDistrictName() { |
| | | return districtName; |
| | | } |
| | | |
| | | /** |
| | | * @param districtName |
| | | */ |
| | | public void setDistrictName(String districtName) { |
| | | this.districtName = districtName == null ? null : districtName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ°æ®æ¯å¦å·²ç»æåå
¥åº |
| | | * |
| | | * @return data_pulled - æ°æ®æ¯å¦å·²ç»æåå
¥åº |
| | |
| | | public void setDataPulled(Boolean dataPulled) { |
| | | this.dataPulled = dataPulled; |
| | | } |
| | | |
| | | /** |
| | | * @return province_code |
| | | */ |
| | | public String getProvinceCode() { |
| | | return provinceCode; |
| | | } |
| | | |
| | | /** |
| | | * @param provinceCode |
| | | */ |
| | | public void setProvinceCode(String provinceCode) { |
| | | this.provinceCode = provinceCode == null ? null : provinceCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return province_name |
| | | */ |
| | | public String getProvinceName() { |
| | | return provinceName; |
| | | } |
| | | |
| | | /** |
| | | * @param provinceName |
| | | */ |
| | | public void setProvinceName(String provinceName) { |
| | | this.provinceName = provinceName == null ? null : provinceName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return city_code |
| | | */ |
| | | public String getCityCode() { |
| | | return cityCode; |
| | | } |
| | | |
| | | /** |
| | | * @param cityCode |
| | | */ |
| | | public void setCityCode(String cityCode) { |
| | | this.cityCode = cityCode == null ? null : cityCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return city_name |
| | | */ |
| | | public String getCityName() { |
| | | return cityName; |
| | | } |
| | | |
| | | /** |
| | | * @param cityName |
| | | */ |
| | | public void setCityName(String cityName) { |
| | | this.cityName = cityName == null ? null : cityName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return district_code |
| | | */ |
| | | public String getDistrictCode() { |
| | | return districtCode; |
| | | } |
| | | |
| | | /** |
| | | * @param districtCode |
| | | */ |
| | | public void setDistrictCode(String districtCode) { |
| | | this.districtCode = districtCode == null ? null : districtCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return district_name |
| | | */ |
| | | public String getDistrictName() { |
| | | return districtName; |
| | | } |
| | | |
| | | /** |
| | | * @param districtName |
| | | */ |
| | | public void setDistrictName(String districtName) { |
| | | this.districtName = districtName == null ? null : districtName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return town_code |
| | | */ |
| | | public String getTownCode() { |
| | | return townCode; |
| | | } |
| | | |
| | | /** |
| | | * @param townCode |
| | | */ |
| | | public void setTownCode(String townCode) { |
| | | this.townCode = townCode == null ? null : townCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return town_name |
| | | */ |
| | | public String getTownName() { |
| | | return townName; |
| | | } |
| | | |
| | | /** |
| | | * @param townName |
| | | */ |
| | | public void setTownName(String townName) { |
| | | this.townName = townName == null ? null : townName.trim(); |
| | | } |
| | | } |
| | |
| | | import com.flightfeather.uav.domain.MyMapper |
| | | import com.flightfeather.uav.domain.entity.GridDataDetail |
| | | import org.apache.ibatis.annotations.Mapper |
| | | import org.apache.ibatis.annotations.Select |
| | | |
| | | @Mapper |
| | | interface GridDataDetailMapper : MyMapper<GridDataDetail?> { |
| | | |
| | | fun updatePM25Batch(gridDataDetails: List<GridDataDetail>) |
| | | |
| | | /** |
| | | * éç½®èªå¢id |
| | | */ |
| | | @Select("alter table grid_data_detail auto_increment = #{param1}") |
| | | fun resetAutoIncrement(id: Int) |
| | | } |
| | |
| | | import com.flightfeather.uav.domain.MyMapper |
| | | import com.flightfeather.uav.domain.entity.GridData |
| | | import org.apache.ibatis.annotations.Mapper |
| | | import org.apache.ibatis.annotations.Select |
| | | |
| | | @Mapper |
| | | interface GridDataMapper : MyMapper<GridData?> |
| | | interface GridDataMapper : MyMapper<GridData?> { |
| | | |
| | | /** |
| | | * éç½®èªå¢id |
| | | */ |
| | | @Select("alter table grid_data auto_increment = #{param1}") |
| | | fun resetAutoIncrement(id: Int) |
| | | } |
| | |
| | | import com.flightfeather.uav.domain.mapper.GridDataMapper |
| | | import com.flightfeather.uav.domain.mapper.GridGroupMapper |
| | | import com.flightfeather.uav.lightshare.bean.AreaVo |
| | | import com.github.pagehelper.PageHelper |
| | | import org.springframework.stereotype.Repository |
| | | import org.springframework.transaction.annotation.Transactional |
| | | import tk.mybatis.mapper.entity.Example |
| | |
| | | @Transactional |
| | | fun deleteGridGroup(groupId: Int) { |
| | | gridCellMapper.delete(GridCell().apply { this.groupId = groupId }) |
| | | PageHelper.startPage<GridCell>(1, 1) |
| | | gridCellMapper.selectByExample( |
| | | Example(GridCell::class.java).apply { orderBy("id").desc() } |
| | | ).takeIf { it.isNotEmpty() }?.get(0)?.id?.let { id -> |
| | | gridCellMapper.resetAutoIncrement(id + 1) |
| | | } |
| | | gridGroupMapper.deleteByPrimaryKey(groupId) |
| | | PageHelper.startPage<GridGroup>(1, 1) |
| | | gridGroupMapper.selectByExample( |
| | | Example(GridGroup::class.java).apply { orderBy("id").desc() } |
| | | ).takeIf { it.isNotEmpty() }?.get(0)?.id?.let { id -> |
| | |
| | | gridDataDetailMapper.updatePM25Batch(gridDataDetails) |
| | | } |
| | | |
| | | @Transactional |
| | | @Throws |
| | | fun deleteGridData(dataId: Int?) { |
| | | gridDataDetailMapper.delete(GridDataDetail().apply { this.dataId = dataId }) |
| | | // Fixme 2025.4.16 æ¤å¤çéç½®èªå¢idåªå¨å é¤ææ°æ°æ®çæ
åµä¸ææï¼åç»èèä¸éç¨èªå¢ä¸»é®ï¼æ¹ä¸ºæ°ç主é®çææ¹å¼ |
| | | // PageHelper.startPage<GridDataDetail>(1, 1) |
| | | // gridDataDetailMapper.selectByExample(Example(GridDataDetail::class.java).apply { orderBy("id").desc() }) |
| | | // .takeIf { it.isNotEmpty() }?.get(0)?.id?.let { id -> |
| | | // gridDataDetailMapper.resetAutoIncrement(id + 1) |
| | | // } |
| | | gridDataMapper.deleteByPrimaryKey(dataId) |
| | | // PageHelper.startPage<GridData>(1, 1) |
| | | // gridDataMapper.selectByExample( |
| | | // Example(GridData::class.java).apply { orderBy("id").desc() } |
| | | // ).takeIf { it.isNotEmpty() }?.get(0)?.id?.let { id -> |
| | | // gridDataMapper.resetAutoIncrement(id + 1) |
| | | // } |
| | | } |
| | | |
| | | /*****************************************************************/ |
| | | |
| | | // aod ç¸å
³æä½ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.lightshare.service |
| | | |
| | | import com.flightfeather.uav.biz.dataanalysis.model.ExceptionResult |
| | | |
| | | /** |
| | | * |
| | | * @date 2025/5/8 |
| | | * @author feiyu02 |
| | | */ |
| | | interface DataAnalysisService { |
| | | |
| | | /** |
| | | * æ±¡ææº¯æºåæ |
| | | * @param missionCode èµ°èªä»»å¡ç¼å· |
| | | */ |
| | | fun pollutionTrace(missionCode: String): List<ExceptionResult> |
| | | } |
| | |
| | | package com.flightfeather.uav.lightshare.service |
| | | |
| | | 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.lightshare.bean.GridDataDetailMixVo |
| | | |
| | |
| | | |
| | | /** |
| | | * å°èµ°èªçæµæ°æ®åå«æç½æ ¼è¿è¡èåè®¡ç® |
| | | * @param missionCode |
| | | * @param groupId |
| | | * @param gridData |
| | | */ |
| | | fun dataFusion(missionCode: String, groupId: Int): List<GridDataDetail?> |
| | | fun dataFusion(gridData: GridData): List<GridDataDetail?> |
| | | |
| | | /** |
| | | * èµ°èªæ°æ®èå |
| | |
| | | * @param dataIdList èåçæ°æ®idç´¢å¼æ°ç» |
| | | */ |
| | | // Fixme 2025.3.28: éè¦å[SatelliteTelemetryService.mixGridData]彿°åå¹¶ |
| | | fun mixGridData(groupId: Int, dataIdList: List<Int>): List<GridDataDetailMixVo> |
| | | fun mixUnderwayGridData(groupId: Int, dataIdList: List<Int>): List<GridDataDetailMixVo> |
| | | |
| | | /** |
| | | * å°èµ°èªç½æ ¼æ°æ®çæå¯¹åºççåç½æ ¼å¾ |
| | |
| | | |
| | | fun fetchGridData(groupId: Int, dataTime: LocalDateTime?, type: Int?): List<GridData?> |
| | | |
| | | fun fetchGridData(gridData: GridData): List<GridData?> |
| | | |
| | | fun deleteGridData(dataId: Int): Boolean |
| | | |
| | | fun fetchGridDataDetail(dataId: Int, groupId: Int?, cellId: Int?): List<GridDataDetail?> |
| | | |
| | | fun createGridDataAndDataDetail( |
| | | groupId: Int, |
| | | dataTime: LocalDateTime?, |
| | | gridDataDetail: List<GridDataDetail>, |
| | | ): Boolean |
| | | groupId: Int, dataTime: LocalDateTime?, gridDataDetail: List<GridDataDetail>): Boolean |
| | | |
| | | /** |
| | | * æ°æ®èå |
| | | */ |
| | | // Fixme 2025.3.28: éè¦å[SatelliteDataCalculateService.mixGridData]彿°åå¹¶ |
| | | // Fixme 2025.3.28: éè¦å[SatelliteDataCalculateService.mixUnderwayGridData]彿°åå¹¶ |
| | | fun mixGridData(dataIdList: List<Int>): List<GridData?> |
| | | |
| | | @Throws(BizException::class) |
| | |
| | | fun importGridAOD(groupId: Int, dataTime: LocalDateTime?, update: Boolean, file: MultipartFile): GridDataImportResult? |
| | | |
| | | fun downloadAODTemplate(response: HttpServletResponse): Boolean |
| | | |
| | | /** |
| | | * æ ¹æ®å«æé¥æµç½æ ¼çä¸å¿åæ ç¹ï¼è®¡ç®ç½æ ¼4个顶ç¹åæ |
| | | * @param groupId ç½æ ¼ç»ç´¢å¼id |
| | | */ |
| | | fun calGridVertex(groupId: Int): List<GridCell?> |
| | | |
| | | |
| | | /**AODæ°æ®ç¸å
³**************************************************************/ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.lightshare.service.impl |
| | | |
| | | import com.flightfeather.uav.biz.FactorFilter |
| | | import com.flightfeather.uav.biz.dataanalysis.ExceptionAnalysisController |
| | | import com.flightfeather.uav.biz.dataanalysis.model.ExceptionResult |
| | | import com.flightfeather.uav.common.exception.BizException |
| | | import com.flightfeather.uav.common.location.LocationRoadNearby |
| | | import com.flightfeather.uav.domain.repository.MissionRep |
| | | import com.flightfeather.uav.domain.repository.RealTimeDataRep |
| | | import com.flightfeather.uav.domain.repository.SegmentInfoRep |
| | | import com.flightfeather.uav.lightshare.service.DataAnalysisService |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | | import org.springframework.stereotype.Service |
| | | |
| | | /** |
| | | * |
| | | * @date 2025/5/8 |
| | | * @author feiyu02 |
| | | */ |
| | | @Service |
| | | class DataAnalysisServiceImpl( |
| | | private val missionRep: MissionRep, |
| | | private val realTimeDataRep: RealTimeDataRep, |
| | | private val locationRoadNearby: LocationRoadNearby, |
| | | private val segmentInfoRep: SegmentInfoRep, |
| | | ) : DataAnalysisService { |
| | | |
| | | override fun pollutionTrace(missionCode: String): List<ExceptionResult> { |
| | | val mission = missionRep.findOne(missionCode) ?: throw BizException("èµ°èªä»»å¡ä¸åå¨") |
| | | |
| | | val exceptionAnalysisController = |
| | | ExceptionAnalysisController(realTimeDataRep, locationRoadNearby, segmentInfoRep) |
| | | |
| | | return exceptionAnalysisController.execute( |
| | | mission, FactorFilter.builder() |
| | | // .withMain(FactorType.NO2) |
| | | .withMain(FactorType.CO) |
| | | // .withMain(FactorType.H2S) |
| | | // .withMain(FactorType.SO2) |
| | | // .withMain(FactorType.O3) |
| | | .withMain(FactorType.PM25) |
| | | .withMain(FactorType.PM10) |
| | | .withMain(FactorType.VOC) |
| | | .create() |
| | | ) |
| | | } |
| | | } |
| | |
| | | return cellList |
| | | } |
| | | |
| | | @Transactional |
| | | override fun splitGrid(groupId: Int, scale: Int): List<GridCell?> { |
| | | // æ£æ¥è¯¥ç½æ ¼å±æ§æ¯å¦åè§ |
| | | val gridGroup = |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | override fun dataFusion(missionCode: String, groupId: Int): List<GridDataDetail?> { |
| | | override fun dataFusion(gridData: GridData): List<GridDataDetail?> { |
| | | val missionCode = gridData.missionCode ?: throw BizException("缺å°ä»»å¡ç¼å·") |
| | | val groupId = gridData.groupId ?: throw BizException("缺å°ç½æ ¼ç»id") |
| | | |
| | | // æ¥è¯¢èµ°èªä»»å¡å对åºèµ°èªçæµæ°æ® |
| | | val mission = missionRep.findOne(missionCode) ?: throw BizException("ä»»å¡ä¸åå¨") |
| | | val data = realTimeDataRep.fetchData(mission) |
| | |
| | | // æ¥æ¾æ¯å¦å·²æèµ°èªèåè®°å½ |
| | | val oldGridDataList = satelliteGridRep.fetchGridData(GridData().apply { |
| | | this.groupId = groupId |
| | | mixDataId = missionCode |
| | | this.missionCode = missionCode |
| | | this.type = SatelliteDataType.Monitor.value.toByte() |
| | | }) |
| | | |
| | | if (oldGridDataList.isEmpty()) { |
| | | // å建èåæ°æ®ç´¢å¼å¯¹è±¡ |
| | | val newGridData = GridData().apply { |
| | | val newGridData = gridData.apply { |
| | | this.groupId = groupId |
| | | dataTime = mission.startTime |
| | | type = SatelliteDataType.Monitor.value.toByte() |
| | | this.missionCode = mission.missionCode |
| | | // Fixme 2025.3.27: è¡æ¿åºåå¨èµ°èªä»»å¡æ·»å 对åºå段åè¿è¡èµå¼ |
| | | provinceCode |
| | | provinceName |
| | | cityCode |
| | | cityName |
| | | districtCode |
| | | provinceCode = mission.provinceCode |
| | | provinceName = mission.provinceName |
| | | cityCode = mission.cityCode |
| | | cityName = mission.cityName |
| | | districtCode = mission.districtCode |
| | | districtName = mission.districtName |
| | | // Fixme 2025.3.27: æå±çæµç¹åºåç®åéè¦éè¿ç¨æ·éæ©ç¡®å® |
| | | // 2025.3.27: æå±çæµç¹åºåéè¦éè¿ç¨æ·éæ©ç¡®å® |
| | | zone |
| | | pollutionDegreeIndex |
| | | pollutionDegree |
| | |
| | | } |
| | | } |
| | | |
| | | override fun mixGridData(groupId: Int, dataIdList: List<Int>): List<GridDataDetailMixVo> { |
| | | override fun mixUnderwayGridData(groupId: Int, dataIdList: List<Int>): List<GridDataDetailMixVo> { |
| | | // è·åæä½¿ç¨çç½æ ¼ç»ç½æ ¼ä¿¡æ¯ |
| | | val gridCellList = satelliteGridRep.fetchGridCell(groupId) |
| | | |
| | |
| | | gridDataDetailList: List<GridDataDetail>, |
| | | searchLength: Int, |
| | | ): List<GridDataDetail> { |
| | | val gridGroup =satelliteGridRep.fetchGridGroup(groupId) |
| | | val gridCellList = satelliteGridRep.fetchGridCell(groupId) |
| | | val originCellIdList = gridDataDetailList.map { it.cellId } |
| | | // Fixme 2025.3.24: æ¤å¤æ ¹æ®ç°æçç½æ ¼ä¿¡æ¯è®¾è®¡æ¹å¼ï¼ä½¿ç¨ä¸´æ¶çåæ°ï¼åç»å°ç½æ ¼éè¿äºç»´åæ å½¢å¼è¡¨ç¤ºï¼æ¤å¤åæ°å»é¤ |
| | | val option = GridGroupOption(120, 90, 10, 10) |
| | | val option = GridGroupOption(gridGroup?.maxXaxis ?: 120, gridGroup?.maxYaxis ?: 90, 10, 10) |
| | | |
| | | val resMap = mutableMapOf<Int, MutableList<GridDataDetail>>() |
| | | |
| | |
| | | return satelliteGridRep.fetchGridData(groupId, dataTime, type) |
| | | } |
| | | |
| | | override fun fetchGridData(gridData: GridData): List<GridData?> { |
| | | return satelliteGridRep.fetchGridData(gridData) |
| | | } |
| | | |
| | | override fun deleteGridData(dataId: Int): Boolean { |
| | | try { |
| | | satelliteGridRep.deleteGridData(dataId) |
| | | } catch (e: Exception) { |
| | | // todo: å å
¥æ¥å¿åå¨é»è¾ |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | |
| | | override fun fetchGridDataDetail(dataId: Int, groupId: Int?, cellId: Int?): List<GridDataDetail?> { |
| | | val res = satelliteGridRep.fetchGridDataDetail(dataId, groupId, cellId) |
| | | res.forEach { |
| | |
| | | response.outputStream.write(file.readBytes()) |
| | | } |
| | | return true |
| | | } |
| | | |
| | | override fun calGridVertex(groupId: Int): List<GridCell?> { |
| | | val cellList = satelliteGridRep.fetchGridCell(groupId) |
| | | val vertexList = SatelliteGridManage.calGridVertex(cellList.map { |
| | | if (it?.longitude == null || it.latitude == null) { |
| | | throw BizException("嫿饿µç½æ ¼è®¡ç®é¡¶ç¹åæ ç¹å¤±è´¥ï¼åå¨ä¸å¿ç¹åæ 为空çæ
åµ") |
| | | } |
| | | it.longitude?.toDouble()!! to it.latitude?.toDouble()!! |
| | | }) |
| | | |
| | | cellList.forEachIndexed { i, c -> |
| | | val v = vertexList[i] |
| | | c?.point1Lon = v.point1Lon.toBigDecimal() |
| | | c?.point1Lat = v.point1Lat.toBigDecimal() |
| | | |
| | | c?.point2Lon = v.point2Lon.toBigDecimal() |
| | | c?.point2Lat = v.point2Lat.toBigDecimal() |
| | | |
| | | c?.point3Lon = v.point3Lon.toBigDecimal() |
| | | c?.point3Lat = v.point3Lat.toBigDecimal() |
| | | |
| | | c?.point4Lon = v.point4Lon.toBigDecimal() |
| | | c?.point4Lat = v.point4Lat.toBigDecimal() |
| | | } |
| | | |
| | | satelliteGridRep.updateGridCellBatch(cellList) |
| | | |
| | | return cellList |
| | | } |
| | | |
| | | override fun fetchGridAod(groupId: Int, dataTime: LocalDateTime?): List<GridAod?> { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.lightshare.web |
| | | |
| | | import com.flightfeather.uav.lightshare.bean.AreaVo |
| | | import com.flightfeather.uav.lightshare.service.DataAnalysisService |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import io.swagger.annotations.ApiParam |
| | | import org.springframework.web.bind.annotation.* |
| | | |
| | | /** |
| | | * èµ°èªæ°æ®åæ |
| | | * @date 2025/5/8 |
| | | * @author feiyu02 |
| | | */ |
| | | @Api(tags = ["èµ°èªæ°æ®åæAPIæ¥å£"]) |
| | | @RestController |
| | | @RequestMapping("air/analysis") |
| | | class DataAnalysisController(private val dataAnalysisService: DataAnalysisService) { |
| | | |
| | | @ApiOperation(value = "æ±¡ææº¯æºåæ") |
| | | @GetMapping("/pollution/trace") |
| | | fun pollutionTrace( |
| | | @ApiParam("èµ°èªä»»å¡ç¼å·") @RequestParam missionCode: String, |
| | | // @RequestParam("page", required = false) page: Int?, |
| | | // @RequestParam("per_page", required = false) perPage: Int?, |
| | | ) = resPack { dataAnalysisService.pollutionTrace(missionCode) } |
| | | |
| | | } |
| | |
| | | package com.flightfeather.uav.lightshare.web |
| | | |
| | | import com.flightfeather.uav.domain.entity.GridData |
| | | import com.flightfeather.uav.domain.entity.GridDataDetail |
| | | import com.flightfeather.uav.lightshare.bean.AreaVo |
| | | import com.flightfeather.uav.lightshare.service.SatelliteDataCalculateService |
| | |
| | | @ApiParam("ç½æ ¼ç»id") @RequestParam groupId: Int, |
| | | @ApiParam("饿µæ°æ®æ¶é´") |
| | | @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?, |
| | | @ApiParam( |
| | | "饿µæ°æ®ç±»å", |
| | | allowableValues = "0ï¼åå§å«æé¥æµæ°æ®ï¼1ï¼èåæ°æ®" |
| | | ) @RequestParam(required = false) type: Int?, |
| | | @ApiParam("饿µæ°æ®ç±»å", allowableValues = "0ï¼åå§å«æé¥æµæ°æ®ï¼1ï¼èåæ°æ®") |
| | | @RequestParam(required = false) type: Int?, |
| | | ) = resPack { satelliteTelemetryService.fetchGridData(groupId, dataTime, type) } |
| | | |
| | | @ApiOperation(value = "è·åç½æ ¼ç»ä¸ç嫿饿µæ°æ®") |
| | | @PostMapping("/grid/data2") |
| | | fun fetchGridData2( |
| | | @ApiParam("ç½æ ¼æ°æ®") @RequestBody gridData: GridData, |
| | | ) = resPack { satelliteTelemetryService.fetchGridData(gridData) } |
| | | |
| | | @ApiOperation(value = "å é¤ç½æ ¼æ°æ®") |
| | | @DeleteMapping("/grid/data/delete") |
| | | fun deleteGridData( |
| | | @ApiParam("æ°æ®id") @RequestParam dataId: Int, |
| | | ) = resPack { satelliteTelemetryService.deleteGridData(dataId) } |
| | | |
| | | @ApiOperation(value = "è·åç½æ ¼ç»ä¸ç嫿饿µå
·ä½æ°æ®") |
| | | @GetMapping("/grid/data/detail") |
| | |
| | | |
| | | /**饿µäº§åå¶ä½ç¸å
³**************************************************************/ |
| | | @ApiOperation(value = "çæèµ°èªèå产å") |
| | | @GetMapping("/product/underway/build") |
| | | @PostMapping("/product/underway/build") |
| | | fun buildUnderwayProduct( |
| | | @ApiParam("èµ°èªä»»å¡ç¼å·") @RequestParam missionCode: String, |
| | | @ApiParam("ç½æ ¼ç»id") @RequestParam groupId: Int, |
| | | ) = resPack { satelliteDataCalculateService.dataFusion(missionCode, groupId) } |
| | | // @ApiParam("èµ°èªä»»å¡ç¼å·") @RequestParam missionCode: String, |
| | | // @ApiParam("ç½æ ¼ç»id") @RequestParam groupId: Int, |
| | | @ApiParam("ç½æ ¼æ°æ®") @RequestBody gridData: GridData, |
| | | ) = resPack { satelliteDataCalculateService.dataFusion(gridData) } |
| | | |
| | | @ApiOperation(value = "è¿è¡èµ°èªèå产åçèååæ") |
| | | @PostMapping("/product/underway/mix") |
| | | fun mixGridData( |
| | | @ApiParam("ç½æ ¼ç»id") @RequestParam groupId: Int, |
| | | @ApiParam("éè¦èåçæ°æ®id") @RequestBody dataIdList: List<Int>, |
| | | ) = resPack { satelliteDataCalculateService.mixGridData(groupId, dataIdList) } |
| | | ) = resPack { satelliteDataCalculateService.mixUnderwayGridData(groupId, dataIdList) } |
| | | |
| | | @ApiOperation(value = "çæèµ°èªçåå¾") |
| | | @PostMapping("/product/underway/heatmap/build") |
| | |
| | | # 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: |
| | |
| | | </javaClientGenerator> |
| | | <!-- è¦çæç表 tableNameæ¯æ°æ®åºä¸ç表åæè§å¾å domainObjectNameæ¯å®ä½ç±»å--> |
| | | <!-- <table tableName="air_real_time_data" domainObjectName="RealTimeData" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="mission" domainObjectName="Mission" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <table tableName="mission" domainObjectName="Mission" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/> |
| | | <!-- <table tableName="el_minutevalue" domainObjectName="ElectricMinuteValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="el_company_device" domainObjectName="CompanyDevice" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="co_complaint" domainObjectName="Complaint" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | |
| | | <!-- <table tableName="segment_info" domainObjectName="SegmentInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="grid_group" domainObjectName="GridGroup" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="grid_cell" domainObjectName="GridCell" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <table tableName="grid_data" domainObjectName="GridData" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/> |
| | | <!-- <table tableName="grid_data" domainObjectName="GridData" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="grid_data_detail" domainObjectName="GridDataDetail" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | </context> |
| | | </generatorConfiguration> |
| | |
| | | <result column="length" jdbcType="DOUBLE" property="length" /> |
| | | <result column="type" jdbcType="VARCHAR" property="type" /> |
| | | <result column="father_group_id" jdbcType="INTEGER" property="fatherGroupId" /> |
| | | <result column="max_xaxis" jdbcType="INTEGER" property="maxXaxis" /> |
| | | <result column="max_yaxis" jdbcType="INTEGER" property="maxYaxis" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | id, name, province_code, province_name, city_code, city_name, district_code, district_name, |
| | | town_code, town_name, create_time, length, type, father_group_id |
| | | town_code, town_name, create_time, length, type, father_group_id, max_xaxis, max_yaxis |
| | | </sql> |
| | | </mapper> |
| | |
| | | <result column="device_code" jdbcType="VARCHAR" property="deviceCode" /> |
| | | <result column="start_time" jdbcType="TIMESTAMP" property="startTime" /> |
| | | <result column="end_time" jdbcType="TIMESTAMP" property="endTime" /> |
| | | <result column="district_name" jdbcType="VARCHAR" property="districtName" /> |
| | | <result column="data_pulled" jdbcType="BIT" property="dataPulled" /> |
| | | <result column="province_code" jdbcType="VARCHAR" property="provinceCode" /> |
| | | <result column="province_name" jdbcType="VARCHAR" property="provinceName" /> |
| | | <result column="city_code" jdbcType="VARCHAR" property="cityCode" /> |
| | | <result column="city_name" jdbcType="VARCHAR" property="cityName" /> |
| | | <result column="district_code" jdbcType="VARCHAR" property="districtCode" /> |
| | | <result column="district_name" jdbcType="VARCHAR" property="districtName" /> |
| | | <result column="town_code" jdbcType="VARCHAR" property="townCode" /> |
| | | <result column="town_name" jdbcType="VARCHAR" property="townName" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | mission_code, device_type, device_code, start_time, end_time, district_name, data_pulled |
| | | mission_code, device_type, device_code, start_time, end_time, data_pulled, province_code, |
| | | province_name, city_code, city_name, district_code, district_name, town_code, town_name |
| | | </sql> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.lightshare.service.impl |
| | | |
| | | import com.flightfeather.uav.lightshare.service.DataAnalysisService |
| | | import junit.framework.TestCase |
| | | 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 |
| | | |
| | | @RunWith(SpringRunner::class) |
| | | @SpringBootTest |
| | | class DataAnalysisServiceImplTest{ |
| | | |
| | | @Autowired |
| | | lateinit var dataAnalysisService: DataAnalysisService |
| | | |
| | | @Test |
| | | fun testPollutionTrace() { |
| | | dataAnalysisService.pollutionTrace("SH-CN-20250116") |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Test |
| | | fun calGridVertex() { |
| | | satelliteDataCalculateService.calGridVertex(5) |
| | | } |
| | | |
| | | @Test |
| | | fun splitGrid() { |
| | | val res = satelliteDataCalculateService.splitGrid(1, 4) |
| | | val res = satelliteDataCalculateService.splitGrid(1, 10) |
| | | // println(res) |
| | | } |
| | | |
| | |
| | | "SH-CN-20250120" |
| | | ) |
| | | missionList.forEach { m -> |
| | | satelliteDataCalculateService.dataFusion(m, 3) |
| | | satelliteDataCalculateService.dataFusion(GridData().apply { |
| | | missionCode = m |
| | | type = 3 |
| | | }) |
| | | } |
| | | // val res = satelliteDataCalculateService.dataFusion("SH-CN-20241216", 3) |
| | | } |
| | |
| | | } |
| | | |
| | | @Test |
| | | fun calGridVertex() { |
| | | satelliteTelemetryService.calGridVertex(1) |
| | | } |
| | | |
| | | @Test |
| | | fun deleteGridGroup() { |
| | | satelliteTelemetryService.deleteGridGroup(2) |
| | | satelliteTelemetryService.deleteGridGroup(6) |
| | | } |
| | | } |