2025.8.25
1. 添加走航季度报告相关统计功能(待完成)
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.biz.report |
| | | |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | | |
| | | /** |
| | | * @date 2025/8/25 14:18 |
| | | * @author feiyu |
| | | */ |
| | | class MissionClue { |
| | | |
| | | inner class Clue{ |
| | | var factor:FactorType?=null |
| | | var riskRegion:String?=null |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.biz.report |
| | | |
| | | import com.flightfeather.uav.domain.entity.Mission |
| | | import com.flightfeather.uav.domain.entity.SceneInfo |
| | | import com.flightfeather.uav.lightshare.bean.FactorStatistics |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | | |
| | | /** |
| | | * èµ°èªæº¯æºæ¸
å |
| | | * å
嫿¶æ®µå
çèµ°èªä»»å¡æ±æ»æ¸
åä»¥åæ¯æ¬¡èµ°èªçæ°æ®æ±æ»æ¸
å |
| | | * @date 2025/8/25 11:02 |
| | | * @author feiyu |
| | | */ |
| | | class MissionInventory { |
| | | |
| | | // èµ°èªæ¸
åä¿¡æ¯ |
| | | inner class MissionInfo : Mission() { |
| | | // é¦è¦æ±¡æç© |
| | | var mainFactor: String? = null |
| | | |
| | | // çæµå¼å¸¸å å |
| | | var abnormalFactors: List<FactorType>? = null |
| | | |
| | | // 溯æºé®é¢åºæ¯æ° |
| | | var sceneCount: Int = 0 |
| | | } |
| | | |
| | | // èµ°èªè¯¦æ
ä¿¡æ¯ |
| | | inner class MissionDetail : Mission() { |
| | | var keyScene: List<SceneInfo>? = null |
| | | var dataStatistics: List<FactorStatistics>? = null |
| | | |
| | | } |
| | | } |
| | |
| | | package com.flightfeather.uav.biz.report |
| | | |
| | | import org.springframework.stereotype.Component |
| | | |
| | | /** |
| | | * èµ°èªä»»å¡æ±æ» |
| | | * @date 2025/8/22 |
| | | * @author feiyu02 |
| | | */ |
| | | @Component |
| | | class MissionSummary { |
| | | |
| | | inner class Summary( |
| | |
| | | val kilometres: Double, |
| | | // æ¶ååºå |
| | | val regionList: List<String>, |
| | | // åç级空æ°è´¨éèæ¯èµ°èªæ¬¡æ° |
| | | val countByDegree: MutableMap<String, Int>, |
| | | |
| | | // åç级空æ°è´¨éèæ¯èµ°èªæ¬¡æ°,<空æ°è´¨éççº§ï¼æ¬¡æ°ï¼å æ¯> |
| | | val countByDegree: List<Triple<String, Int, Double>>, |
| | | // é®é¢æ»æ° |
| | | val probCount:Int, |
| | | // é«é£é©åºæ¯æ»æ° |
| | | val highRiskSceneCount:Int, |
| | | // é®é¢æçæµå åç±»åå叿
åµ, <å åç±»åï¼æ¬¡æ°ï¼å æ¯> |
| | | val probByFactor:List<Triple<String, Int, Double>> |
| | | ) |
| | | |
| | | fun execute() { |
| | | |
| | | } |
| | | } |
| | |
| | | @Column(name = "end_time") |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * æ°æ®æ¯å¦å·²ç»æåå
¥åº |
| | | */ |
| | | @Column(name = "data_pulled") |
| | | private Boolean dataPulled; |
| | | |
| | |
| | | |
| | | @Column(name = "town_name") |
| | | private String townName; |
| | | |
| | | /** |
| | | * éç¨æ°ï¼å
Ž |
| | | */ |
| | | private Float kilometres; |
| | | |
| | | /** |
| | | * æå±åºå |
| | | */ |
| | | private String region; |
| | | |
| | | /** |
| | | * 空æ°è´¨éç级 |
| | | */ |
| | | @Column(name = "pollution_degree") |
| | | private String pollutionDegree; |
| | | |
| | | /** |
| | | * @return mission_code |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åæ°æ®æ¯å¦å·²ç»æåå
¥åº |
| | | * |
| | | * @return data_pulled - æ°æ®æ¯å¦å·²ç»æåå
¥åº |
| | | * @return data_pulled |
| | | */ |
| | | public Boolean getDataPulled() { |
| | | return dataPulled; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®æ°æ®æ¯å¦å·²ç»æåå
¥åº |
| | | * |
| | | * @param dataPulled æ°æ®æ¯å¦å·²ç»æåå
¥åº |
| | | * @param dataPulled |
| | | */ |
| | | public void setDataPulled(Boolean dataPulled) { |
| | | this.dataPulled = dataPulled; |
| | |
| | | public void setTownName(String townName) { |
| | | this.townName = townName == null ? null : townName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åéç¨æ°ï¼å
Ž |
| | | * |
| | | * @return kilometres - éç¨æ°ï¼å
Ž |
| | | */ |
| | | public Float getKilometres() { |
| | | return kilometres; |
| | | } |
| | | |
| | | /** |
| | | * 设置éç¨æ°ï¼å
Ž |
| | | * |
| | | * @param kilometres éç¨æ°ï¼å
Ž |
| | | */ |
| | | public void setKilometres(Float kilometres) { |
| | | this.kilometres = kilometres; |
| | | } |
| | | |
| | | /** |
| | | * è·åæå±åºå |
| | | * |
| | | * @return region - æå±åºå |
| | | */ |
| | | public String getRegion() { |
| | | return region; |
| | | } |
| | | |
| | | /** |
| | | * 设置æå±åºå |
| | | * |
| | | * @param region æå±åºå |
| | | */ |
| | | public void setRegion(String region) { |
| | | this.region = region == null ? null : region.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·å空æ°è´¨éç级 |
| | | * |
| | | * @return pollution_degree - 空æ°è´¨éç级 |
| | | */ |
| | | public String getPollutionDegree() { |
| | | return pollutionDegree; |
| | | } |
| | | |
| | | /** |
| | | * 设置空æ°è´¨éç级 |
| | | * |
| | | * @param pollutionDegree 空æ°è´¨éç级 |
| | | */ |
| | | public void setPollutionDegree(String pollutionDegree) { |
| | | this.pollutionDegree = pollutionDegree == null ? null : pollutionDegree.trim(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.lightshare.bean |
| | | |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | | |
| | | /** |
| | | * çæµå åæ°æ®ç»è®¡ |
| | | * @date 2025/8/25 11:26 |
| | | * @author feiyu |
| | | */ |
| | | data class FactorStatistics( |
| | | // çæµå åç±»å |
| | | val factor: FactorType, |
| | | // æå°å¼ |
| | | val minValue: Double, |
| | | // æå¤§å¼ |
| | | val maxValue: Double, |
| | | // åå¼ |
| | | val avgValue: Double |
| | | ) |
| | |
| | | |
| | | import com.flightfeather.uav.domain.entity.Mission |
| | | import com.flightfeather.uav.lightshare.bean.BaseResponse |
| | | import com.flightfeather.uav.lightshare.bean.DataHead |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | | interface MissionService { |
| | | |
| | | fun getMission(type: String?, page: Int?, perPage: Int?): BaseResponse<List<Mission>> |
| | | fun getMission(type: String?, page: Int?, perPage: Int?): Pair<DataHead, List<Mission>> |
| | | |
| | | fun createMission(mission: Mission): BaseResponse<Boolean> |
| | | fun createMission(mission: Mission): Boolean |
| | | |
| | | fun updateMission(mission: Mission): BaseResponse<Boolean> |
| | | fun updateMission(mission: Mission): Boolean |
| | | |
| | | fun deleteMission(missionCode: String): BaseResponse<Boolean> |
| | | fun deleteMission(missionCode: String): Boolean |
| | | |
| | | fun deleteMissionAndData(missionCode: String): Boolean |
| | | |
| | | fun getReport(missionCode: String, response: HttpServletResponse) |
| | | |
| | | /** |
| | | * 计ç®ä»»å¡ä¿¡æ¯ï¼å
æ¬æ»éç¨æ°ãæå±åºåã彿¥ç空æ°è´¨éèæ¯ç |
| | | */ |
| | | fun calMissionInfo(missionCode: String): Boolean |
| | | } |
| | |
| | | package com.flightfeather.uav.lightshare.service.impl |
| | | |
| | | import com.flightfeather.uav.biz.FactorFilter |
| | | import com.flightfeather.uav.biz.mission.MissionUtil |
| | | import com.flightfeather.uav.biz.report.MissionReport |
| | | import com.flightfeather.uav.common.exception.BizException |
| | | import com.flightfeather.uav.domain.entity.Mission |
| | | import com.flightfeather.uav.domain.entity.RealTimeDataVehicle |
| | | import com.flightfeather.uav.domain.mapper.MissionMapper |
| | | import com.flightfeather.uav.domain.mapper.RealTimeDataVehicleMapper |
| | | import com.flightfeather.uav.domain.repository.MissionRep |
| | | import com.flightfeather.uav.domain.repository.RealTimeDataRep |
| | | import com.flightfeather.uav.lightshare.bean.BaseResponse |
| | | import com.flightfeather.uav.lightshare.bean.DataHead |
| | | import com.flightfeather.uav.lightshare.service.MissionService |
| | |
| | | private val missionMapper: MissionMapper, |
| | | private val realTimeDataVehicleMapper: RealTimeDataVehicleMapper, |
| | | private val missionReport: MissionReport, |
| | | private val missionRep: MissionRep, |
| | | private val realTimeDataRep: RealTimeDataRep |
| | | ) : MissionService { |
| | | override fun getMission(type: String?, page: Int?, perPage: Int?): BaseResponse<List<Mission>> { |
| | | override fun getMission(type: String?, page: Int?, perPage: Int?): Pair<DataHead, List<Mission>> { |
| | | val _perPage = perPage ?: 60 |
| | | val _page = page ?: 1 |
| | | val pageInfo = PageHelper.startPage<Mission>(_page, _perPage) |
| | |
| | | } |
| | | orderBy("startTime").desc() |
| | | }).forEach { it?.let { result.add(it) } } |
| | | return BaseResponse(true, head = DataHead(pageInfo.pageNum, pageInfo.pages),data = result) |
| | | // return BaseResponse(true, head = DataHead(pageInfo.pageNum, pageInfo.pages),data = result) |
| | | return DataHead(pageInfo.pageNum, pageInfo.pages) to result |
| | | } |
| | | |
| | | @Synchronized |
| | | override fun createMission(mission: Mission): BaseResponse<Boolean> { |
| | | override fun createMission(mission: Mission): Boolean { |
| | | missionMapper.selectByPrimaryKey(mission.missionCode)?.run { |
| | | return BaseResponse(false, "ä»»å¡ç¼å·å·²åå¨") |
| | | // return BaseResponse(false, "ä»»å¡ç¼å·å·²åå¨") |
| | | throw BizException("ä»»å¡ç¼å·å·²åå¨") |
| | | } |
| | | missionMapper.insert(mission).let { |
| | | return BaseResponse(it == 1) |
| | | return it == 1 |
| | | } |
| | | } |
| | | |
| | | override fun updateMission(mission: Mission): BaseResponse<Boolean> { |
| | | override fun updateMission(mission: Mission): Boolean { |
| | | missionMapper.updateByPrimaryKey(mission).let { |
| | | return BaseResponse(it == 1) |
| | | return it == 1 |
| | | } |
| | | } |
| | | |
| | | override fun deleteMission(missionCode: String): BaseResponse<Boolean> { |
| | | override fun deleteMission(missionCode: String): Boolean { |
| | | missionMapper.deleteByPrimaryKey(missionCode).let { |
| | | return BaseResponse(it == 1) |
| | | return it == 1 |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | return |
| | | } |
| | | |
| | | override fun calMissionInfo(missionCode: String): Boolean { |
| | | val mission = missionRep.findOne(missionCode) ?: throw BizException("èµ°èªä»»å¡ä¸åå¨") |
| | | val data = realTimeDataRep.fetchData(mission) |
| | | mission.kilometres = MissionUtil.calKilometres(data).toFloat() |
| | | return updateMission(mission) |
| | | } |
| | | } |
| | |
| | | @RequestParam(value = "type", required = false) type: String?, |
| | | @RequestParam(value = "page", required = false) page: Int?, |
| | | @RequestParam(value = "perPage", required = false) perPage: Int? |
| | | ) = missionService.getMission(type, page, perPage) |
| | | ) = resPack { missionService.getMission(type, page, perPage) } |
| | | |
| | | @PostMapping("/create") |
| | | fun createMission( |
| | | @RequestBody mission: Mission |
| | | ) = missionService.createMission(mission) |
| | | ) = resPack { missionService.createMission(mission) } |
| | | |
| | | @PostMapping("/update") |
| | | fun updateMission( |
| | | @RequestBody mission: Mission |
| | | ) = missionService.updateMission(mission) |
| | | ) = resPack { missionService.updateMission(mission) } |
| | | |
| | | @PostMapping("/delete") |
| | | fun deleteMission( |
| | | @RequestParam("missionCode") missionCode: String |
| | | ) = missionService.deleteMission(missionCode) |
| | | ) = resPack { missionService.deleteMission(missionCode) } |
| | | |
| | | @PostMapping("/delete/data/vehicle") |
| | | fun deleteMissionAndData( |
| | |
| | | "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> |
| | | <generatorConfiguration> |
| | | <!-- æ°æ®åºé©±å¨:éæ©ä½ çæ¬å°ç¡¬çä¸é¢çæ°æ®åºé©±å¨å
--> |
| | | <!-- <classPathEntry location="C:\Users\feiyu\.m2\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar"/>--> |
| | | <classPathEntry location="C:\Users\feiyu02\.m2\repository\mysql\mysql-connector-java\8.0.21\mysql-connector-java-8.0.21.jar"/> |
| | | <classPathEntry location="C:\Users\feiyu\.m2\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar"/> |
| | | <!-- <classPathEntry location="C:\Users\feiyu02\.m2\repository\mysql\mysql-connector-java\8.0.21\mysql-connector-java-8.0.21.jar"/>--> |
| | | <!--defaultModelType{ |
| | | conditional:è¿ä¸ªæ¨¡åä¸hierarchical模åç¸ä¼¼,é¤äºå¦æä¸ä¸ªå®ä½ç±»åªå
å«ä¸ä¸ªå段,åä¸ä¼åç¬çææ¤å®ä½ç±»ãå æ¤,妿ä¸ä¸ªè¡¨ç主é®åªæä¸ä¸ªå段,é£ä¹ä¸ä¼ä¸ºè¯¥å段çæåç¬çå®ä½ç±»,ä¼å°è¯¥å段åå¹¶å°åºæ¬å®ä½ç±»ä¸ã |
| | | flat:该模å为æ¯ä¸å¼ 表åªçæä¸ä¸ªå®ä½ç±»ãè¿ä¸ªå®ä½ç±»å
å«è¡¨ä¸çææå段ã |
| | |
| | | <property name="suppressAllComments" value="true"/> |
| | | </commentGenerator> |
| | | <!--æ°æ®åºé¾æ¥URLï¼ç¨æ·åãå¯ç --> |
| | | <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://47.100.191.150:3306/dronemonitor?serverTimezone=Asia/Shanghai" |
| | | userId="remoteU1" |
| | | password="eSoF8DnzfGTlhAjE"> |
| | | </jdbcConnection> |
| | | <!-- <jdbcConnection driverClass="com.mysql.jdbc.Driver"--> |
| | | <!-- connectionURL="jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai"--> |
| | | <!-- userId="root"--> |
| | | <!-- password="123456">--> |
| | | <!-- <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://47.100.191.150:3306/dronemonitor?serverTimezone=Asia/Shanghai"--> |
| | | <!-- userId="remoteU1"--> |
| | | <!-- password="eSoF8DnzfGTlhAjE">--> |
| | | <!-- </jdbcConnection>--> |
| | | <jdbcConnection driverClass="com.mysql.jdbc.Driver" |
| | | connectionURL="jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai" |
| | | userId="root" |
| | | password="123456"> |
| | | </jdbcConnection> |
| | | <javaTypeResolver> |
| | | <property name="forceBigDecimals" value="false"/> |
| | | </javaTypeResolver> |
| | |
| | | </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="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_detail" domainObjectName="GridDataDetail" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <table tableName="source_trace_msg" domainObjectName="SourceTraceMsg" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/> |
| | | <table tableName="source_trace_msg_blob" domainObjectName="SourceTraceMsgBlob" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/> |
| | | <!-- <table tableName="source_trace_msg" domainObjectName="SourceTraceMsg" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="source_trace_msg_blob" domainObjectName="SourceTraceMsgBlob" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | </context> |
| | | </generatorConfiguration> |
| | |
| | | <result column="district_name" jdbcType="VARCHAR" property="districtName" /> |
| | | <result column="town_code" jdbcType="VARCHAR" property="townCode" /> |
| | | <result column="town_name" jdbcType="VARCHAR" property="townName" /> |
| | | <result column="kilometres" jdbcType="REAL" property="kilometres" /> |
| | | <result column="region" jdbcType="VARCHAR" property="region" /> |
| | | <result column="pollution_degree" jdbcType="VARCHAR" property="pollutionDegree" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | 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 |
| | | province_name, city_code, city_name, district_code, district_name, town_code, town_name, |
| | | kilometres, region, pollution_degree |
| | | </sql> |
| | | </mapper> |