feiyu02
2025-02-07 e133600480d5f688a8375db7708fe531b4726f4a
1. 新增卫星网格拆分、遥测数据拆分映射功能
已修改17个文件
已添加2个文件
337 ■■■■■ 文件已修改
src/main/kotlin/com/flightfeather/uav/biz/satellite/SatelliteGridManage.kt 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/entity/GridAodDetail.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/entity/GridCell.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/entity/GridDataDetail.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/entity/GridGroup.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/mapper/GridCellMapper.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/mapper/GridGroupMapper.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/repository/SatelliteGridRep.kt 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/eunm/SatelliteDataType.kt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/SatelliteDataCalculateService.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/SatelliteTelemetryService.kt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImpl.kt 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteTelemetryServiceImpl.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-test.yml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/GridGroupMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImplTest.kt 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteTelemetryServiceImplTest.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/ThirdPartyServiceImplTest.kt 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/biz/satellite/SatelliteGridManage.kt
@@ -1,7 +1,10 @@
package com.flightfeather.uav.biz.satellite
import com.flightfeather.uav.common.utils.MapUtil
import com.flightfeather.uav.domain.entity.BaseRealTimeData
import com.flightfeather.uav.domain.entity.GridCell
import com.flightfeather.uav.domain.entity.GridData
import com.flightfeather.uav.domain.entity.GridDataDetail
import kotlin.math.PI
import kotlin.math.sqrt
@@ -87,15 +90,15 @@
        val p2 = p.point2Lon to p.point2Lat
        val p3 = p.point3Lon to p.point3Lat
        val p4 = p.point4Lon to p.point4Lat
        // p1、p3的经纬度单位差值
        val dx1 = (p3.first - p1.first) / scale.toBigDecimal()
        val dy1 = (p3.second - p1.second) / scale.toBigDecimal()
        // p1、p4的经纬度单位差值
        val dx1 = (p4.first - p1.first) / scale.toBigDecimal()
        val dy1 = (p4.second - p1.second) / scale.toBigDecimal()
        // p1、p2的经纬度单位差值
        val dx2 = (p2.first - p1.first) / scale.toBigDecimal()
        val dy2 = (p2.second - p1.second) / scale.toBigDecimal()
        // p3、p4的经纬度单位差值
        val dx3 = (p4.first - p3.first) / scale.toBigDecimal()
        val dy3 = (p4.second - p3.second) / scale.toBigDecimal()
        // p4、p3的经纬度单位差值
        val dx3 = (p3.first - p4.first) / scale.toBigDecimal()
        val dy3 = (p3.second - p4.second) / scale.toBigDecimal()
        // ä¸­å¿ƒç‚¹å’Œp1的经纬度单位差值
        val dxC = (p.longitude - p1.first) / scale.toBigDecimal()
        val dyC = (p.latitude - p1.second) / scale.toBigDecimal()
@@ -116,14 +119,14 @@
                newGridCell1.point1Lon = g.point1Lon + dx1 * row.toBigDecimal()
                newGridCell1.point1Lat = g.point1Lat + dy1 * row.toBigDecimal()
                // å·¦ä¸‹è§’顶点根据所在行数在原始网格顶点基础上增加偏移量(比左上角顶点多一个偏移)
                newGridCell1.point3Lon = g.point1Lon + dx1 * (row + 1).toBigDecimal()
                newGridCell1.point3Lat = g.point1Lat + dy1 * (row + 1).toBigDecimal()
                newGridCell1.point4Lon = g.point1Lon + dx1 * (row + 1).toBigDecimal()
                newGridCell1.point4Lat = g.point1Lat + dy1 * (row + 1).toBigDecimal()
                // å³ä¸Šè§’顶点在细分网格左上角的基础上增加相应的偏移量
                newGridCell1.point2Lon = newGridCell1.point1Lon + dx2
                newGridCell1.point2Lat = newGridCell1.point1Lat + dy2
                // å³ä¸‹è§’顶点在细分网格左下角的基础上增加相应的偏移量
                newGridCell1.point4Lon = newGridCell1.point3Lon + dx3
                newGridCell1.point4Lat = newGridCell1.point3Lat + dy3
                newGridCell1.point3Lon = newGridCell1.point4Lon + dx3
                newGridCell1.point3Lat = newGridCell1.point4Lat + dy3
                // ä¸­å¿ƒç‚¹åœ¨ç»†åˆ†ç½‘格左上角的基础上增加固定偏移量
                newGridCell1.longitude = newGridCell1.point1Lon + dxC
                newGridCell1.latitude = newGridCell1.point1Lat + dyC
@@ -160,4 +163,66 @@
        return newGridCellList
    }
    /**
     * æ‹†åˆ†æ•°æ®ï¼Œå°†åŽŸå§‹å«æ˜Ÿç½‘æ ¼é¥æµ‹æ•°æ®æ˜ å°„åˆ°å¯¹åº”ç»†åˆ†ç½‘æ ¼ä¸Š
     * @param subGridCellList ç»†åˆ†ç½‘æ ¼, æŒ‰ç…§
     * @param subGridData ç»†åˆ†ç½‘格对应的数据索引
     * @param originGridDataDetailList ç»†åˆ†ç½‘格所属网格的原始网格数据
     */
    fun splitData(
        subGridCellList: List<GridCell?>, subGridData: GridData, originGridDataDetailList: List<GridDataDetail?>
    ): List<GridDataDetail> {
        if (subGridCellList.isEmpty() || originGridDataDetailList.isEmpty()) return emptyList()
        val result = mutableListOf<GridDataDetail>()
        // å°†ç»†åˆ†ç½‘格按照父网格id和自身网格id进行升序排列
        val _subGridCellList = subGridCellList.sortedWith(Comparator { o1, o2 ->
            if (o1 == null && o2 == null) {
                return@Comparator 0
            } else if (o1 == null) {
                return@Comparator -1
            } else if (o2 == null) {
                return@Comparator 1
            } else {
                if (o1.fatherCellIndex == o2.fatherCellIndex) {
                    return@Comparator o1.cellIndex - o2.cellIndex
                } else {
                    return@Comparator o1.fatherCellIndex - o2.fatherCellIndex
                }
            }
        })
        // å°†åŽŸå§‹ç½‘æ ¼æ•°æ®æŒ‰ç…§ç½‘æ ¼id升序排列
        val _originGridDataDetailIterator = originGridDataDetailList.sortedBy { it?.cellId }.iterator()
        var fatherGridData = _originGridDataDetailIterator.next()
        // éåŽ†ç»†åˆ†ç½‘æ ¼ï¼Œä¸ºæ¯ä¸ªç»†åˆ†ç½‘æ ¼ç”Ÿæˆä¸€æ¡ç½‘æ ¼æ•°æ®
        _subGridCellList.forEach {
            while (fatherGridData?.cellId != it?.fatherCellIndex && _originGridDataDetailIterator.hasNext()) {
                fatherGridData = _originGridDataDetailIterator.next()
            }
            val subGridDataDetail = GridDataDetail().apply {
                dataId = subGridData.id
                groupId = it?.groupId
                cellId = it?.cellIndex
                pm25 = fatherGridData?.pm25
                rank = fatherGridData?.rank
            }
            result.add(subGridDataDetail)
        }
        return result
    }
    /**
     * æ•°æ®èžåˆ
     * @param realTimeDataList å¾…融合的走航监测数据
     * @param gridData èžåˆåŽçš„æ•°æ®ç»„索引
     * @param gridCellList å¾…融合的卫星网格
     */
    fun dataFusion(realTimeDataList:List<BaseRealTimeData>, gridData: GridData, gridCellList: List<GridCell?>) {
    }
}
src/main/kotlin/com/flightfeather/uav/domain/entity/GridAodDetail.java
@@ -1,12 +1,11 @@
package com.flightfeather.uav.domain.entity;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.*;
@Table(name = "grid_aod_detail")
public class GridAodDetail {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    @Column(name = "aod_id")
src/main/kotlin/com/flightfeather/uav/domain/entity/GridCell.java
@@ -6,6 +6,7 @@
@Table(name = "grid_cell")
public class GridCell {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**
src/main/kotlin/com/flightfeather/uav/domain/entity/GridDataDetail.java
@@ -5,6 +5,7 @@
@Table(name = "grid_data_detail")
public class GridDataDetail {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**
src/main/kotlin/com/flightfeather/uav/domain/entity/GridGroup.java
@@ -6,6 +6,7 @@
@Table(name = "grid_group")
public class GridGroup {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**
@@ -49,6 +50,12 @@
     * ç½‘格类型,origin:原始网格;sub:子网格(细分网格)
     */
    private String type;
    /**
     * å½“网格类型是Sub(子网格)时,所属父网格组的id
     */
    @Column(name = "father_group_id")
    private Integer fatherGroupId;
    /**
     * @return id
@@ -243,4 +250,22 @@
    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }
    /**
     * èŽ·å–å½“ç½‘æ ¼ç±»åž‹æ˜¯Sub(子网格)时,所属父网格组的id
     *
     * @return father_group_id - å½“网格类型是Sub(子网格)时,所属父网格组的id
     */
    public Integer getFatherGroupId() {
        return fatherGroupId;
    }
    /**
     * è®¾ç½®å½“网格类型是Sub(子网格)时,所属父网格组的id
     *
     * @param fatherGroupId å½“网格类型是Sub(子网格)时,所属父网格组的id
     */
    public void setFatherGroupId(Integer fatherGroupId) {
        this.fatherGroupId = fatherGroupId;
    }
}
src/main/kotlin/com/flightfeather/uav/domain/mapper/GridCellMapper.kt
@@ -3,6 +3,14 @@
import com.flightfeather.uav.domain.MyMapper
import com.flightfeather.uav.domain.entity.GridCell
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Select
@Mapper
interface GridCellMapper : MyMapper<GridCell?>
interface GridCellMapper : MyMapper<GridCell?> {
    /**
     * é‡ç½®è‡ªå¢žid
     */
    @Select("alter table grid_cell auto_increment = #{param1}")
    fun resetAutoIncrement(id: Int)
}
src/main/kotlin/com/flightfeather/uav/domain/mapper/GridGroupMapper.kt
@@ -3,6 +3,14 @@
import com.flightfeather.uav.domain.MyMapper
import com.flightfeather.uav.domain.entity.GridGroup
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Select
@Mapper
interface GridGroupMapper : MyMapper<GridGroup?>
interface GridGroupMapper : MyMapper<GridGroup?> {
    /**
     * é‡ç½®è‡ªå¢žid
     */
    @Select("alter table grid_group auto_increment = #{param1}")
    fun resetAutoIncrement(id: Int)
}
src/main/kotlin/com/flightfeather/uav/domain/repository/SatelliteGridRep.kt
@@ -46,11 +46,35 @@
        return gridGroupMapper.select(gridGroup)
    }
    fun insertGridGroup(gridGroup: GridGroup): Int {
        return gridGroupMapper.insert(gridGroup)
    }
    @Transactional
    fun deleteGridGroup(groupId: Int) {
        gridCellMapper.delete(GridCell().apply { this.groupId = groupId })
        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)
        gridGroupMapper.selectByExample(
            Example(GridGroup::class.java).apply { orderBy("id").desc() }
        ).takeIf { it.isNotEmpty() }?.get(0)?.id?.let { id ->
            gridGroupMapper.resetAutoIncrement(id + 1)
        }
    }
    fun fetchGridCell(groupId: Int): List<GridCell?> {
        return gridCellMapper.selectByExample(Example(GridCell::class.java).apply {
            createCriteria().andEqualTo("groupId", groupId)
            orderBy("id")
        })
    }
    fun insertGridCell(gridCellList: List<GridCell?>): Int {
        return gridCellMapper.insertList(gridCellList)
    }
    fun fetchGridData(groupId: Int, dataTime: LocalDateTime?, type: Int?): List<GridData?> {
@@ -65,6 +89,18 @@
        return gridDataMapper.select(gridData)
    }
    fun fetchGridData(id: Int): GridData? {
        return gridDataMapper.selectByPrimaryKey(id)
    }
    fun insertGridData(gridData: GridData): Int {
        return gridDataMapper.insert(gridData)
    }
    fun insertGridDataDetail(gridDataDetails: List<GridDataDetail?>): Int {
        return gridDataDetailMapper.insertList(gridDataDetails)
    }
    fun fetchGridDataDetail(dataId: Int, groupId: Int?, cellId: Int?): List<GridDataDetail?> {
        return gridDataDetailMapper.selectByExample(Example(GridDataDetail::class.java).apply {
            createCriteria().andEqualTo("dataId", dataId)
src/main/kotlin/com/flightfeather/uav/lightshare/eunm/SatelliteDataType.kt
@@ -12,4 +12,6 @@
    Mix(1),
    // ç»†åˆ†ç½‘格数据
    Sub(2),
    // èµ°èˆªæ˜ å°„数据
    Monitor(3)
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/SatelliteDataCalculateService.kt
@@ -1,6 +1,7 @@
package com.flightfeather.uav.lightshare.service
import com.flightfeather.uav.domain.entity.GridCell
import com.flightfeather.uav.domain.entity.GridDataDetail
/**
 *
@@ -21,4 +22,11 @@
     * @param scale æ‹†åˆ†çš„系数,例如 2,表示将原有网格按边长的 1/2 æ‹†åˆ†æˆ 2 * 2 çš„4个网格
     */
    fun splitGrid(groupId: Int, scale: Int): List<GridCell?>
    /**
     * å°†åŽŸå§‹ç½‘æ ¼çš„æ•°æ®æ˜ å°„å¡«å……è‡³ç»†åˆ†ç½‘æ ¼
     * @param groupId ç»†åˆ†ç½‘格组索引id
     * @param dataId æ•°æ®ç´¢å¼•id
     */
    fun splitData(groupId: Int, dataId:Int): List<GridDataDetail?>
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/SatelliteTelemetryService.kt
@@ -22,6 +22,8 @@
    fun fetchGridGroup(areaVo: AreaVo, page: Int?, perPage: Int?): Pair<DataHead, List<GridGroup?>>
    fun deleteGridGroup(groupId: Int)
    fun fetchGridCell(groupId: Int): List<GridCell?>
    fun fetchGridData(groupId: Int, dataTime: LocalDateTime?, type: Int?): List<GridData?>
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImpl.kt
@@ -3,10 +3,18 @@
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.GridData
import com.flightfeather.uav.domain.entity.GridDataDetail
import com.flightfeather.uav.domain.entity.GridGroup
import com.flightfeather.uav.domain.repository.SatelliteGridRep
import com.flightfeather.uav.lightshare.eunm.GridType
import com.flightfeather.uav.lightshare.eunm.SatelliteDataType
import com.flightfeather.uav.lightshare.service.SatelliteDataCalculateService
import org.springframework.beans.BeanUtils
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import java.util.Date
import kotlin.math.round
/**
 * å«æ˜Ÿç½‘格坐标及监测数据二次计算
@@ -47,13 +55,74 @@
    }
    override fun splitGrid(groupId: Int, scale: Int): List<GridCell?> {
        // æ£€æŸ¥è¯¥ç½‘格属性是否合规
        val gridGroup =
            satelliteGridRep.fetchGridGroup(groupId) ?: throw BizException("该网格组不存在,无法进行网格细分")
        if (gridGroup.length == null) throw BizException("该网格组没有设定网格边长,无法进行网格细分")
        // æ£€æŸ¥è¯¥ç½‘格下该种类的细分网格是否存在,若不存在,则新建
        satelliteGridRep.fetchGridGroup(groupId)
        val searchGridGroup = GridGroup().apply {
            type = GridType.Sub.name.lowercase()
            fatherGroupId = gridGroup.id
            length = round(gridGroup.length / scale)
        }
        val subGridGroupList = satelliteGridRep.fetchGridGroup(searchGridGroup)
        // è‹¥ç»†åˆ†ç½‘格记录超过1个,说明业务逻辑存在问题,相同边长的细分网格应该只有1个
        if (subGridGroupList.size > 1) {
            throw BizException("该网格组下${searchGridGroup.length}米边长的网格记录超过1个,无法再进行网格细分,并且请检查生成逻辑是否问题")
        }
        // è‹¥ç»†åˆ†ç½‘格记录有且只有1个,则无需再次细分,直接返回已有结果
        else if (subGridGroupList.size == 1) {
            val g = subGridGroupList.first()
                ?: throw BizException("该网格组下的细分网格记录已损坏,无法使用,请检查数据库记录")
            return satelliteGridRep.fetchGridCell(g.id)
        }
        // å½“没有记录时,执行生成逻辑
        // ç”Ÿæˆæ–°çš„细分网格组记录
        val newGridGroup = GridGroup()
        BeanUtils.copyProperties(gridGroup, newGridGroup)
        newGridGroup.apply {
            id = null
            name += "${searchGridGroup.length.toInt()}米细分"
            createTime = Date()
            length = searchGridGroup.length
            type = GridType.Sub.name.lowercase()
            fatherGroupId = groupId
        }
        satelliteGridRep.insertGridGroup(newGridGroup)
        // èŽ·å–å…·ä½“ç½‘æ ¼ä¿¡æ¯
        val cellList = satelliteGridRep.fetchGridCell(groupId)
        // æŒ‰ç…§ç»™å®šçš„æ‹†åˆ†ç³»æ•°è¿›è¡Œæ‹†åˆ†
//        val subCellList = SatelliteGridManage.splitGrid(cellList, scale)
        val subCellList = SatelliteGridManage.splitGrid(cellList, scale, newGridGroup.id)
        satelliteGridRep.insertGridCell(subCellList)
        return emptyList()
        return subCellList
    }
    @Transactional
    override fun splitData(groupId: Int, dataId:Int): List<GridDataDetail?> {
        // æ£€æŸ¥æ˜¯å¦æ˜¯ç»†åˆ†ç½‘格类型
        val gridGroup = satelliteGridRep.fetchGridGroup(groupId) ?: throw BizException("该网格组不存在,无法进行细分网格数据映射")
        if (gridGroup.type != GridType.Sub.name.lowercase()) throw BizException("该网格组不是细分网格类型存在,无法进行细分网格数据映射")
        val subGridCellList = satelliteGridRep.fetchGridCell(groupId)
        val originGridData = satelliteGridRep.fetchGridData(dataId)
        val originGridDataDetailList = satelliteGridRep.fetchGridDataDetail(dataId, null, null)
        val subGridData = GridData().apply {
            this.groupId = groupId
            dataTime = originGridData?.dataTime
            type = SatelliteDataType.Sub.value.toByte()
        }
        satelliteGridRep.insertGridData(subGridData)
        val subGridDataDetailList =
            SatelliteGridManage.splitData(subGridCellList, subGridData, originGridDataDetailList)
        satelliteGridRep.insertGridDataDetail(subGridDataDetailList)
        return subGridDataDetailList
    }
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteTelemetryServiceImpl.kt
@@ -44,6 +44,10 @@
        return DataHead(pageInfo.pageNum, pageInfo.pages) to res
    }
    override fun deleteGridGroup(groupId: Int) {
        satelliteGridRep.deleteGridGroup(groupId)
    }
    override fun fetchGridCell(groupId: Int): List<GridCell?> {
        return satelliteGridRep.fetchGridCell(groupId)
    }
src/main/resources/application-test.yml
@@ -7,13 +7,13 @@
    #    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:
src/main/resources/generator/generatorConfig.xml
@@ -67,7 +67,7 @@
<!--        <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_cell" domainObjectName="GridCell" 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"/>-->
    </context>
src/main/resources/mapper/GridGroupMapper.xml
@@ -18,12 +18,13 @@
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="length" jdbcType="DOUBLE" property="length" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="father_group_id" jdbcType="INTEGER" property="fatherGroupId" />
  </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
    town_code, town_name, create_time, length, type, father_group_id
  </sql>
</mapper>
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImplTest.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
package com.flightfeather.uav.lightshare.service.impl
import com.flightfeather.uav.lightshare.service.SatelliteDataCalculateService
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 SatelliteDataCalculateServiceImplTest {
    @Autowired
    lateinit var satelliteDataCalculateService: SatelliteDataCalculateService
    @Test
    fun splitGrid() {
        val res = satelliteDataCalculateService.splitGrid(1, 4)
//        println(res)
    }
    @Test
    fun splitData() {
        val res = satelliteDataCalculateService.splitData(4, 25)
//        println(res)
    }
}
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteTelemetryServiceImplTest.kt
@@ -27,4 +27,9 @@
    fun calGridVertex() {
        satelliteTelemetryService.calGridVertex(1)
    }
    @Test
    fun deleteGridGroup() {
        satelliteTelemetryService.deleteGridGroup(2)
    }
}
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/ThirdPartyServiceImplTest.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
package com.flightfeather.uav.lightshare.service.impl
import com.flightfeather.uav.lightshare.eunm.ThirdPartyLabel
import com.flightfeather.uav.lightshare.service.ThirdPartyService
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 ThirdPartyServiceImplTest {
    @Autowired
    lateinit var thirdPartyService: ThirdPartyService
    @Test
    fun fetchMissionData() {
        thirdPartyService.fetchMissionData(ThirdPartyLabel.ShenXin.value, "20240914")
    }
}