From 01eae19a4870033e879a3faa6749eece92926cab Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 26 一月 2024 17:10:55 +0800
Subject: [PATCH] 1. 新增多项yml配置文件 2. 新增导入静安监测数据功能模块(未完成)

---
 src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImplTest.kt |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 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 e306742..d8b7e78 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
@@ -4,7 +4,13 @@
 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.flightfeather.uav.model.epw.EPWDataPrep
+import com.flightfeather.uav.repository.AirDataRepository
+import com.flightfeather.uav.repository.impl.AirDataRepositoryImpl
+import com.flightfeather.uav.socket.eunm.UWDeviceType
 import com.github.pagehelper.PageHelper
 import org.apache.poi.xssf.streaming.SXSSFWorkbook
 import org.junit.Test
@@ -28,6 +34,12 @@
 
     @Autowired
     lateinit var realTimeDataService: RealTimeDataService
+
+    @Autowired
+    lateinit var realTimeDataVehicleMapper: RealTimeDataVehicleMapper
+
+    @Autowired
+    lateinit var airDataRepository: AirDataRepositoryImpl
 
     @Test
     fun outToExcel() {
@@ -137,4 +149,31 @@
         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