From db447bb757b51f8d03e62d6ae4f183b4608723ef Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期五, 07 三月 2025 17:10:43 +0800 Subject: [PATCH] 卫星遥测系统相关接口新增及调整 --- src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImplTest.kt | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImplTest.kt b/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImplTest.kt index c01f0d5..0ad77e0 100644 --- a/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImplTest.kt +++ b/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImplTest.kt @@ -1,11 +1,14 @@ package com.flightfeather.uav.lightshare.service.impl +import com.flightfeather.uav.domain.entity.GridDataDetail +import com.flightfeather.uav.domain.mapper.GridDataDetailMapper 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 +import tk.mybatis.mapper.entity.Example @RunWith(SpringRunner::class) @@ -15,6 +18,27 @@ @Autowired lateinit var satelliteDataCalculateService: SatelliteDataCalculateService + @Autowired + lateinit var gridDataDetailMapper: GridDataDetailMapper + + /** + * 鍒锋柊姣忕粍鏁版嵁鐨勬暟鎹帓鍚� + */ + @Test + fun refreshDataRank() { + for (i in 64..69) { + val dataDetailList = gridDataDetailMapper.selectByExample(Example(GridDataDetail::class.java).apply { + createCriteria().andEqualTo("dataId", i) + orderBy("pm25").desc() + }) + dataDetailList.forEachIndexed { index, d -> + d?.rank = index + 1 + gridDataDetailMapper.updateByPrimaryKey(d) + } + println("finish --${i}") + } + } + @Test fun splitGrid() { val res = satelliteDataCalculateService.splitGrid(1, 4) @@ -23,7 +47,29 @@ @Test fun splitData() { - val res = satelliteDataCalculateService.splitData(4, 25) -// println(res) + val groupIdList = listOf(2, 4) + val dataId = listOf(34, 29, 25, 18, 8) + + groupIdList.forEach {g -> + dataId.forEach { d -> + satelliteDataCalculateService.splitData(g, d) + } + } +// val res = satelliteDataCalculateService.splitData(2, 25) + } + + @Test + fun dataFusion() { + val missionList = + listOf("SH-CN-20241202", "SH-CN-20241127", "SH-CN-20241126-1", "SH-CN-20241126-2", "SH-CN-20241108", "SH-CN-20240823") + missionList.forEach { m -> + satelliteDataCalculateService.dataFusion(m, 3) + } +// val res = satelliteDataCalculateService.dataFusion("SH-CN-20241216", 3) + } + + @Test + fun splitDataAndDataFusion() { + } } \ No newline at end of file -- Gitblit v1.9.3