feiyu02
2025-01-23 698f8f0f22af4c66581ce284407e986ca036aec6
1. 网格细分逻辑(编写中)
已修改15个文件
已删除1个文件
已添加2个文件
已重命名3个文件
274 ■■■■ 文件已修改
src/main/kotlin/com/flightfeather/uav/biz/satellite/SatelliteGridManage.kt 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/entity/GridCell.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/entity/GridGroup.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/repository/AirDataRep.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/repository/ElectricRep.kt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/repository/SatelliteGridRep.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/repository/impl/AirDataRepImpl.kt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/repository/impl/ElectricRepImpl.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/eunm/GridType.kt 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/eunm/SatelliteDataType.kt 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/SatelliteDataCalculateService.kt 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImpl.kt 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/repository/ElectricRepository.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/socket/processor/ElectricProcessor.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/GridCellMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/GridGroupMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/com/flightfeather/uav/Test.kt 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImplTest.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/biz/satellite/SatelliteGridManage.kt
@@ -64,12 +64,14 @@
    }
    /**
     * æ‹†åˆ†ç½‘格为细分网格
     * æ‹†åˆ†ç½‘格为细分网格,所有网格应该是相同边长的正方形
     * æ ¹æ®ç›¸ä¼¼çŸ©å½¢çš„原理,可以分别按比例得到每个细分网格的经纬度
     * @param gridCellList åŽŸå§‹ç½‘æ ¼æ•°ç»„
     * @param scale æ‹†åˆ†çš„系数,例如 2,表示将原有网格按边长的 1/2 æ‹†åˆ†æˆ 2 * 2 çš„4个网格
     * @param groupId ç»†åˆ†åŽçš„网格所属的网格组id
     * @return
     */
    fun splitGrid(gridCellList: List<GridCell>, scale: Int): List<GridCell> {
    fun splitGrid(gridCellList: List<GridCell?>, scale: Int, groupId:Int): List<GridCell?> {
        if (scale <= 0) throw IllegalArgumentException("网格拆分的数量不能小于1")
        // æ‹†åˆ†ç³»æ•°ä¸º1,则表示不拆分
        if (scale == 1) return gridCellList
@@ -79,7 +81,7 @@
        // æ ¹æ®å‡½æ•°[calGridVertex]生成的网格4个顶点坐标,以上北下南左西右东方向为标准
        // è®¡ç®—首个网格中心坐标点分别和4个顶点的经纬度差值
        val p = gridCellList[0]
        val p = gridCellList.find { it != null }!!
        // ï¼ˆé€šè¿‡è¿‘似平面坐标系的方式)根据单个原始网格的4个顶点坐标,分别确定以下三组坐标点之间的经纬度单位偏移量
        val p1 = p.point1Lon to p.point1Lat
        val p2 = p.point2Lon to p.point2Lat
@@ -98,17 +100,24 @@
        val dxC = (p.longitude - p1.first) / scale.toBigDecimal()
        val dyC = (p.latitude - p1.second) / scale.toBigDecimal()
        // ç½‘格索引
        var cellIndex = 0
        // å¯¹ç½‘格组内的所有网格进行网格细分
        gridCellList.forEach { g ->
            if (g == null) return@forEach
        // ç½‘格行循环
        for (row in 0 until scale) {
            val newGridCell1 = GridCell()
            // ç¡®å®šæ¯ä¸€è¡Œé¦–个细分网格的中心坐标和4个顶点坐标
            // å·¦ä¸Šè§’顶点根据所在行数在原始网格顶点基础上增加偏移量
            newGridCell1.point1Lon = p1.first + dx1 * row.toBigDecimal()
            newGridCell1.point1Lat = p1.second + dy1 * row.toBigDecimal()
                newGridCell1.point1Lon = g.point1Lon + dx1 * row.toBigDecimal()
                newGridCell1.point1Lat = g.point1Lat + dy1 * row.toBigDecimal()
            // å·¦ä¸‹è§’顶点根据所在行数在原始网格顶点基础上增加偏移量(比左上角顶点多一个偏移)
            newGridCell1.point3Lon = p1.first + dx1 * (row + 1).toBigDecimal()
            newGridCell1.point3Lat = p1.second + dy1 * (row + 1).toBigDecimal()
                newGridCell1.point3Lon = g.point1Lon + dx1 * (row + 1).toBigDecimal()
                newGridCell1.point3Lat = g.point1Lat + dy1 * (row + 1).toBigDecimal()
            // å³ä¸Šè§’顶点在细分网格左上角的基础上增加相应的偏移量
            newGridCell1.point2Lon = newGridCell1.point1Lon + dx2
            newGridCell1.point2Lat = newGridCell1.point1Lat + dy2
@@ -118,6 +127,10 @@
            // ä¸­å¿ƒç‚¹åœ¨ç»†åˆ†ç½‘格左上角的基础上增加固定偏移量
            newGridCell1.longitude = newGridCell1.point1Lon + dxC
            newGridCell1.latitude = newGridCell1.point1Lat + dyC
                newGridCell1.groupId = groupId
                newGridCell1.cellIndex = ++cellIndex
                newGridCell1.fatherCellIndex = g.cellIndex
            // åŠ å…¥ç»“æžœé›†åˆ
            newGridCellList.add(newGridCell1)
@@ -136,10 +149,14 @@
                newGridCell.longitude = newGridCell.point1Lon + dxC
                newGridCell.latitude = newGridCell.point1Lat + dyC
                    newGridCell.groupId = groupId
                    newGridCell.cellIndex = ++cellIndex
                    newGridCell.fatherCellIndex = g.cellIndex
                newGridCellList.add(newGridCell)
            }
        }
        }
        return newGridCellList
    }
src/main/kotlin/com/flightfeather/uav/domain/entity/GridCell.java
@@ -9,10 +9,22 @@
    private Integer id;
    /**
     * ç½‘格索引
     */
    @Column(name = "cell_index")
    private Integer cellIndex;
    /**
     * æ‰€å±žç½‘格分组id
     */
    @Column(name = "group_id")
    private Integer groupId;
    /**
     * æ‰€å±žä¸Šçº§ç½‘格的索引id,如果没有则为null
     */
    @Column(name = "father_cell_index")
    private Integer fatherCellIndex;
    /**
     * ç»åº¦
@@ -87,6 +99,24 @@
    }
    /**
     * èŽ·å–ç½‘æ ¼ç´¢å¼•
     *
     * @return cell_index - ç½‘格索引
     */
    public Integer getCellIndex() {
        return cellIndex;
    }
    /**
     * è®¾ç½®ç½‘格索引
     *
     * @param cellIndex ç½‘格索引
     */
    public void setCellIndex(Integer cellIndex) {
        this.cellIndex = cellIndex;
    }
    /**
     * èŽ·å–æ‰€å±žç½‘æ ¼åˆ†ç»„id
     *
     * @return group_id - æ‰€å±žç½‘格分组id
@@ -105,6 +135,24 @@
    }
    /**
     * èŽ·å–æ‰€å±žä¸Šçº§ç½‘æ ¼çš„ç´¢å¼•id,如果没有则为null
     *
     * @return father_cell_index - æ‰€å±žä¸Šçº§ç½‘格的索引id,如果没有则为null
     */
    public Integer getFatherCellIndex() {
        return fatherCellIndex;
    }
    /**
     * è®¾ç½®æ‰€å±žä¸Šçº§ç½‘格的索引id,如果没有则为null
     *
     * @param fatherCellIndex æ‰€å±žä¸Šçº§ç½‘格的索引id,如果没有则为null
     */
    public void setFatherCellIndex(Integer fatherCellIndex) {
        this.fatherCellIndex = fatherCellIndex;
    }
    /**
     * èŽ·å–ç»åº¦
     *
     * @return longitude - ç»åº¦
src/main/kotlin/com/flightfeather/uav/domain/entity/GridGroup.java
@@ -41,6 +41,16 @@
    private Date createTime;
    /**
     * ç½‘格边长(单位:米)
     */
    private Double length;
    /**
     * ç½‘格类型,origin:原始网格;sub:子网格(细分网格)
     */
    private String type;
    /**
     * @return id
     */
    public Integer getId() {
@@ -171,7 +181,7 @@
    }
    /**
     * @return towm_name
     * @return town_name
     */
    public String getTownName() {
        return townName;
@@ -197,4 +207,40 @@
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    /**
     * èŽ·å–ç½‘æ ¼è¾¹é•¿ï¼ˆå•ä½ï¼šç±³ï¼‰
     *
     * @return length - ç½‘格边长(单位:米)
     */
    public Double getLength() {
        return length;
    }
    /**
     * è®¾ç½®ç½‘格边长(单位:米)
     *
     * @param length ç½‘格边长(单位:米)
     */
    public void setLength(Double length) {
        this.length = length;
    }
    /**
     * èŽ·å–ç½‘æ ¼ç±»åž‹ï¼Œorigin:原始网格;sub:子网格(细分网格)
     *
     * @return type - ç½‘格类型,origin:原始网格;sub:子网格(细分网格)
     */
    public String getType() {
        return type;
    }
    /**
     * è®¾ç½®ç½‘格类型,origin:原始网格;sub:子网格(细分网格)
     *
     * @param type ç½‘格类型,origin:原始网格;sub:子网格(细分网格)
     */
    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }
}
src/main/kotlin/com/flightfeather/uav/domain/repository/AirDataRep.kt
ÎļþÃû´Ó src/main/kotlin/com/flightfeather/uav/repository/AirDataRepository.kt ÐÞ¸Ä
@@ -1,14 +1,15 @@
package com.flightfeather.uav.repository
package com.flightfeather.uav.domain.repository
import com.flightfeather.uav.domain.entity.RealTimeData
import com.flightfeather.uav.lightshare.bean.DataVo
import com.flightfeather.uav.socket.bean.AirDataPackage
/**
 * èµ°èˆªç›‘测数据数据库管理
 * @author riku
 * Date: 2020/6/11
 */
interface AirDataRepository {
interface AirDataRep {
    /**
     * åŽŸå§‹æ•°æ®ä»¥json格式存储
src/main/kotlin/com/flightfeather/uav/domain/repository/ElectricRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
package com.flightfeather.uav.domain.repository
import com.flightfeather.uav.socket.bean.ElectricMessage
/**
 * ç”¨ç”µé‡æ•°æ®åº“相关操作
 */
interface ElectricRep {
    fun saveData(electricMessage: ElectricMessage): Int
}
src/main/kotlin/com/flightfeather/uav/domain/repository/SatelliteGridRep.kt
@@ -38,6 +38,14 @@
        })
    }
    fun fetchGridGroup(id: Int): GridGroup? {
        return gridGroupMapper.selectByPrimaryKey(id)
    }
    fun fetchGridGroup(gridGroup: GridGroup): List<GridGroup?> {
        return gridGroupMapper.select(gridGroup)
    }
    fun fetchGridCell(groupId: Int): List<GridCell?> {
        return gridCellMapper.selectByExample(Example(GridCell::class.java).apply {
            createCriteria().andEqualTo("groupId", groupId)
src/main/kotlin/com/flightfeather/uav/domain/repository/impl/AirDataRepImpl.kt
ÎļþÃû´Ó src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt ÐÞ¸Ä
@@ -1,10 +1,10 @@
package com.flightfeather.uav.repository.impl
package com.flightfeather.uav.domain.repository.impl
import com.flightfeather.uav.common.utils.GsonUtils
import com.flightfeather.uav.domain.entity.*
import com.flightfeather.uav.domain.mapper.*
import com.flightfeather.uav.lightshare.bean.DataVo
import com.flightfeather.uav.repository.AirDataRepository
import com.flightfeather.uav.domain.repository.AirDataRep
import com.flightfeather.uav.socket.bean.AirData
import com.flightfeather.uav.socket.bean.AirDataPackage
import com.flightfeather.uav.socket.eunm.FactorType
@@ -16,23 +16,20 @@
import java.math.BigDecimal
import java.text.SimpleDateFormat
import java.time.LocalDateTime
import java.time.ZoneId
import java.util.*
import kotlin.math.abs
import kotlin.math.sqrt
/**
 * @author riku
 * Date: 2020/6/11
 */
@Repository
class AirDataRepositoryImpl(
class AirDataRepImpl(
    private val realTimeDataMapper: RealTimeDataMapper,
    private val realTimeDataVehicleMapper: RealTimeDataVehicleMapper,
    private val realTimeDataUavMapper: RealTimeDataUavMapper,
    private val realTimeDataGridMapper: RealTimeDataGridMapper,
    private val factorCalibrationMapper: FactorCalibrationMapper
): AirDataRepository {
): AirDataRep {
    // FIXME: 2021/10/25 ä¸´æ—¶è½¦è½½æ•°æ®ï¼Œç”±äºŽæ— äººæœºéƒ¨åˆ†ç›‘测因子数据无效,因此暂时采用车载数据作为填充
    private val tmpVehicleDataList = mutableListOf<BaseRealTimeData>()
src/main/kotlin/com/flightfeather/uav/domain/repository/impl/ElectricRepImpl.kt
ÎļþÃû´Ó src/main/kotlin/com/flightfeather/uav/repository/impl/ElectricDapImpl.kt ÐÞ¸Ä
@@ -1,14 +1,14 @@
package com.flightfeather.uav.repository.impl
package com.flightfeather.uav.domain.repository.impl
import com.flightfeather.uav.domain.entity.ElectricMinuteValue
import com.flightfeather.uav.domain.mapper.ElectricMinuteValueMapper
import com.flightfeather.uav.repository.ElectricRepository
import com.flightfeather.uav.domain.repository.ElectricRep
import com.flightfeather.uav.socket.bean.ElectricMessage
import org.springframework.stereotype.Repository
import java.util.*
@Repository
class ElectricDapImpl(val electricMinuteValueMapper: ElectricMinuteValueMapper) : ElectricRepository {
class ElectricRepImpl(val electricMinuteValueMapper: ElectricMinuteValueMapper) : ElectricRep {
    override fun saveData(electricMessage: ElectricMessage): Int {
        val minuteValue = ElectricMinuteValue().apply {
            mvStatCode = electricMessage.mn
src/main/kotlin/com/flightfeather/uav/lightshare/eunm/GridType.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package com.flightfeather.uav.lightshare.eunm
/**
 * å«æ˜Ÿé¥æµ‹ç½‘格类型
 * @date 2025/1/21
 * @author feiyu02
 */
enum class GridType {
    // åŽŸå§‹ç½‘æ ¼
    Origin(),
    // å­ç½‘格(细分网格)
    Sub()
}
src/main/kotlin/com/flightfeather/uav/lightshare/eunm/SatelliteDataType.kt
@@ -9,5 +9,7 @@
    // åŽŸå§‹æ•°æ®
    Original(0),
    // èžåˆæ•°æ®
    Mix(1)
    Mix(1),
    // ç»†åˆ†ç½‘格数据
    Sub(2),
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/SatelliteDataCalculateService.kt
@@ -15,5 +15,10 @@
     */
    fun calGridVertex(groupId: Int): List<GridCell?>
    fun splitGrid(groupId: Int): List<GridCell?>
    /**
     * å°†ç½‘格组进行细分
     * @param groupId ç½‘格组索引id
     * @param scale æ‹†åˆ†çš„系数,例如 2,表示将原有网格按边长的 1/2 æ‹†åˆ†æˆ 2 * 2 çš„4个网格
     */
    fun splitGrid(groupId: Int, scale: Int): List<GridCell?>
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt
@@ -6,7 +6,6 @@
import com.flightfeather.uav.common.utils.ExcelUtil
import com.flightfeather.uav.common.utils.FileExchange
import com.flightfeather.uav.biz.dataprocess.AverageUtil
import com.flightfeather.uav.common.location.TrackSegment
import com.flightfeather.uav.domain.entity.*
import com.flightfeather.uav.domain.mapper.*
import com.flightfeather.uav.domain.repository.MissionRep
@@ -15,7 +14,7 @@
import com.flightfeather.uav.lightshare.bean.*
import com.flightfeather.uav.lightshare.service.RealTimeDataService
import com.flightfeather.uav.model.epw.EPWDataPrep
import com.flightfeather.uav.repository.AirDataRepository
import com.flightfeather.uav.domain.repository.AirDataRep
import com.flightfeather.uav.socket.eunm.UWDeviceType
import com.github.pagehelper.PageHelper
import org.apache.poi.xssf.streaming.SXSSFWorkbook
@@ -37,7 +36,7 @@
@Service
class RealTimeDataServiceImpl(
    private val realTimeDataMapper: RealTimeDataMapper,
    private val airDataRepository: AirDataRepository,
    private val airDataRep: AirDataRep,
    private val realTimeDataVehicleMapper: RealTimeDataVehicleMapper,
    private val realTimeDataUavMapper: RealTimeDataUavMapper,
    private val realTimeDataGridMapper: RealTimeDataGridMapper,
@@ -396,7 +395,7 @@
            println("当前页数:$page")
            val dataList = res.data ?: emptyList()
            val result = epwDataPrep.mDataPrep2(dataList)
            count += airDataRepository.savePrepData2(result)
            count += airDataRep.savePrepData2(result)
            page++
        }
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImpl.kt
@@ -3,12 +3,13 @@
import com.flightfeather.uav.biz.satellite.SatelliteGridManage
import com.flightfeather.uav.common.exception.BizException
import com.flightfeather.uav.domain.entity.GridCell
import com.flightfeather.uav.domain.entity.GridGroup
import com.flightfeather.uav.domain.repository.SatelliteGridRep
import com.flightfeather.uav.lightshare.service.SatelliteDataCalculateService
import org.springframework.stereotype.Service
/**
 *
 * å«æ˜Ÿç½‘格坐标及监测数据二次计算
 * @date 2025/1/15
 * @author feiyu02
 */
@@ -45,7 +46,14 @@
        return cellList
    }
    override fun splitGrid(groupId: Int): List<GridCell?> {
        TODO("Not yet implemented")
    override fun splitGrid(groupId: Int, scale: Int): List<GridCell?> {
        // æ£€æŸ¥è¯¥ç½‘格下该种类的细分网格是否存在,若不存在,则新建
        satelliteGridRep.fetchGridGroup(groupId)
        // èŽ·å–å…·ä½“ç½‘æ ¼ä¿¡æ¯
        val cellList = satelliteGridRep.fetchGridCell(groupId)
        // æŒ‰ç…§ç»™å®šçš„æ‹†åˆ†ç³»æ•°è¿›è¡Œæ‹†åˆ†
//        val subCellList = SatelliteGridManage.splitGrid(cellList, scale)
        return emptyList()
    }
}
src/main/kotlin/com/flightfeather/uav/repository/ElectricRepository.kt
ÎļþÒÑɾ³ý
src/main/kotlin/com/flightfeather/uav/socket/processor/ElectricProcessor.kt
@@ -1,6 +1,6 @@
package com.flightfeather.uav.socket.processor
import com.flightfeather.uav.repository.ElectricRepository
import com.flightfeather.uav.domain.repository.ElectricRep
import com.flightfeather.uav.socket.bean.BaseMessage
import com.flightfeather.uav.socket.bean.ElectricMessage
import com.flightfeather.uav.socket.decoder.ElectricDataDecoder
@@ -20,7 +20,7 @@
    }
    @Autowired
    lateinit var electricRepository: ElectricRepository
    lateinit var electricRep: ElectricRep
    @Autowired
    lateinit var electricDataDecoder: ElectricDataDecoder
@@ -42,7 +42,7 @@
    private fun saveToDataBase(message: BaseMessage, msg: String) {
        if (message is ElectricMessage && message.mn.isNotBlank()) {
            instance.electricRepository.saveData(message)
            instance.electricRep.saveData(message)
        }
    }
}
src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt
@@ -1,7 +1,7 @@
package com.flightfeather.uav.socket.processor
import com.flightfeather.uav.model.epw.EPWDataPrep
import com.flightfeather.uav.repository.AirDataRepository
import com.flightfeather.uav.domain.repository.AirDataRep
import com.flightfeather.uav.socket.bean.AirDataPackage
import com.flightfeather.uav.socket.decoder.AirDataDecoder
import com.flightfeather.uav.socket.decoder.DataPackageDecoder
@@ -30,7 +30,7 @@
    }
    @Autowired
    lateinit var airDataRepository: AirDataRepository
    lateinit var airDataRep: AirDataRep
    private val airDataDecoder = AirDataDecoder.instance
    private val dataPackageDecoder = DataPackageDecoder()
@@ -66,7 +66,7 @@
        when (dataPackage.commandUnit) {
            AirCommandUnit.AirData.value -> {
                // ä»¥json格式存储原始数据
                instance.airDataRepository.saveAirData(dataPackage)
                instance.airDataRep.saveAirData(dataPackage)
                // è¿›è¡Œé¢„处理后,存储至对应数据表
                if (!dataProcessMap.containsKey(dataPackage.deviceCode)) {
                    // æ¯å°è®¾å¤‡æœ‰å•独的数据预处理对象
@@ -74,7 +74,7 @@
                }
                dataProcessMap[dataPackage.deviceCode]?.run {
                    val list = this.mDataPrep2(dataPackage)// æ•°æ®å¹³æ»‘处理
                    instance.airDataRepository.savePrepData2(list)// æŒ‰ç…§è®¾å¤‡ç±»åž‹å­˜å‚¨è‡³å¯¹åº”数据表
                    instance.airDataRep.savePrepData2(list)// æŒ‰ç…§è®¾å¤‡ç±»åž‹å­˜å‚¨è‡³å¯¹åº”数据表
                }
            }
        }
src/main/resources/generator/generatorConfig.xml
@@ -25,9 +25,14 @@
            <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 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"/>
@@ -61,7 +66,7 @@
<!--        <table tableName="real_time_data_grid_opt" domainObjectName="RealTimeDataGridOpt" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="scene_info" domainObjectName="SceneInfo" 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_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_detail" domainObjectName="GridDataDetail" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
src/main/resources/mapper/GridCellMapper.xml
@@ -6,7 +6,9 @@
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="cell_index" jdbcType="INTEGER" property="cellIndex" />
    <result column="group_id" jdbcType="INTEGER" property="groupId" />
    <result column="father_cell_index" jdbcType="INTEGER" property="fatherCellIndex" />
    <result column="longitude" jdbcType="DECIMAL" property="longitude" />
    <result column="latitude" jdbcType="DECIMAL" property="latitude" />
    <result column="point1_lon" jdbcType="DECIMAL" property="point1Lon" />
@@ -22,7 +24,7 @@
    <!--
      WARNING - @mbg.generated
    -->
    id, group_id, longitude, latitude, point1_lon, point1_lat, point2_lon, point2_lat,
    point3_lon, point3_lat, point4_lon, point4_lat
    id, cell_index, group_id, father_cell_index, longitude, latitude, point1_lon, point1_lat,
    point2_lon, point2_lat, point3_lon, point3_lat, point4_lon, point4_lat
  </sql>
</mapper>
src/main/resources/mapper/GridGroupMapper.xml
@@ -16,12 +16,14 @@
    <result column="town_code" jdbcType="VARCHAR" property="townCode" />
    <result column="town_name" jdbcType="VARCHAR" property="townName" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="length" jdbcType="DOUBLE" property="length" />
    <result column="type" jdbcType="VARCHAR" property="type" />
  </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
    town_code, town_name, create_time, length, type
  </sql>
</mapper>
src/test/kotlin/com/flightfeather/uav/Test.kt
@@ -4,10 +4,12 @@
import com.flightfeather.uav.common.utils.FileExchange
import com.flightfeather.uav.common.utils.FileUtil
import com.flightfeather.uav.domain.entity.Company
import com.flightfeather.uav.lightshare.eunm.SatelliteDataType
import com.flightfeather.uav.socket.bean.DataUnit
import com.flightfeather.uav.socket.decoder.AirDataDecoder
import com.flightfeather.uav.socket.eunm.AirCommandUnit
import com.google.gson.Gson
import org.jetbrains.kotlin.konan.util.visibleName
import org.junit.Test
import java.io.File
import java.io.FileOutputStream
@@ -127,6 +129,11 @@
    @Test
    fun foo17() {
        val a = listOf(1, 2, 3)
        println(SatelliteDataType.Original.name)
        println(SatelliteDataType.Original.value)
        println(SatelliteDataType.Original.ordinal)
        println(SatelliteDataType.Original.toString())
        println(SatelliteDataType.Original.visibleName)
        println(SatelliteDataType.Original)
    }
}
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImplTest.kt
@@ -3,7 +3,7 @@
import com.flightfeather.uav.domain.entity.RealTimeDataVehicle
import com.flightfeather.uav.domain.mapper.RealTimeDataVehicleMapper
import com.flightfeather.uav.lightshare.service.RealTimeDataService
import com.flightfeather.uav.repository.impl.AirDataRepositoryImpl
import com.flightfeather.uav.domain.repository.impl.AirDataRepImpl
import org.junit.Test
import org.junit.runner.RunWith
@@ -24,7 +24,7 @@
    lateinit var realTimeDataVehicleMapper: RealTimeDataVehicleMapper
    @Autowired
    lateinit var airDataRepository: AirDataRepositoryImpl
    lateinit var airDataRepository: AirDataRepImpl
    @Test
    fun outToExcel() {