From 698f8f0f22af4c66581ce284407e986ca036aec6 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 23 一月 2025 17:10:26 +0800
Subject: [PATCH] 1. 网格细分逻辑(编写中)

---
 src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImplTest.kt |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImplTest.kt b/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImplTest.kt
index 24c36bc..1d70ec0 100644
--- a/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImplTest.kt
+++ b/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImplTest.kt
@@ -1,23 +1,17 @@
 package com.flightfeather.uav.lightshare.service.impl
 
-import com.flightfeather.uav.common.utils.DateUtil
-import com.flightfeather.uav.common.utils.ExcelUtil
-import com.flightfeather.uav.dataprocess.DataProcess
-import com.flightfeather.uav.domain.entity.RealTimeData
+import com.flightfeather.uav.domain.entity.RealTimeDataVehicle
+import com.flightfeather.uav.domain.mapper.RealTimeDataVehicleMapper
 import com.flightfeather.uav.lightshare.service.RealTimeDataService
-import com.github.pagehelper.PageHelper
-import org.apache.poi.xssf.streaming.SXSSFWorkbook
+import com.flightfeather.uav.domain.repository.impl.AirDataRepImpl
 import org.junit.Test
 
-import org.junit.Assert.*
 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
 import java.io.File
 import java.io.FileOutputStream
-import java.util.*
 
 @RunWith(SpringRunner::class)
 @SpringBootTest
@@ -25,6 +19,12 @@
 
     @Autowired
     lateinit var realTimeDataService: RealTimeDataService
+
+    @Autowired
+    lateinit var realTimeDataVehicleMapper: RealTimeDataVehicleMapper
+
+    @Autowired
+    lateinit var airDataRepository: AirDataRepImpl
 
     @Test
     fun outToExcel() {
@@ -119,6 +119,46 @@
 
     @Test
     fun dataPreprocessing() {
-        realTimeDataService.dataPreprocessing()
+        val r = realTimeDataService.dataPreprocessing()
+        println(r.data)
+    }
+
+    @Test
+    fun averageData() {
+        val r = realTimeDataService.averageData()
+        println(r.data)
+    }
+
+    @Test
+    fun dataCalibration() {
+        val r = realTimeDataService.dataCalibration()
+        println(r.data)
+    }
+
+    @Test
+    fun dataTransform() {
+
+        var page = 1
+        var total = -1
+        var count = 0
+
+        while (total == -1 || page <= total) {
+            println("------杞﹁浇鏁版嵁杞崲start------")
+            val res = realTimeDataService.getOriginData("0a0000000001", "2021-01-01 00:00:00", "2021-10-25 15:37:21", page, 50000)
+            res.head?.let {
+                total = it.totalPage
+            }
+            if (page == 1) {
+                println("鎬婚〉鏁帮細$total")
+            }
+            println("褰撳墠椤垫暟锛�$page")
+            res.data?.forEach {vo ->
+                val d = RealTimeDataVehicle()
+                airDataRepository.dataTransform(vo, d)
+                realTimeDataVehicleMapper.insert(d)
+                count++
+            }
+            page++
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3