From 2de612e9b260df2e76d4dd620ca739aa3b6e8c57 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 25 八月 2025 16:07:16 +0800
Subject: [PATCH] 2025.8.25 1. 添加走航季度报告相关统计功能(待完成)

---
 src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImpl.kt |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImpl.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImpl.kt
index ece5805..93866e6 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImpl.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImpl.kt
@@ -60,6 +60,7 @@
         return cellList
     }
 
+    @Transactional
     override fun splitGrid(groupId: Int, scale: Int): List<GridCell?> {
         // 妫�鏌ヨ缃戞牸灞炴�ф槸鍚﹀悎瑙�
         val gridGroup =
@@ -134,7 +135,10 @@
     }
 
     @Transactional
-    override fun dataFusion(missionCode: String, groupId: Int): List<GridDataDetail?> {
+    override fun dataFusion(gridData: GridData): List<GridDataDetail?> {
+        val missionCode = gridData.missionCode ?: throw BizException("缂哄皯浠诲姟缂栧彿")
+        val groupId = gridData.groupId ?: throw BizException("缂哄皯缃戞牸缁刬d")
+
         // 鏌ヨ璧拌埅浠诲姟鍙婂搴旇蛋鑸洃娴嬫暟鎹�
         val mission = missionRep.findOne(missionCode) ?: throw BizException("浠诲姟涓嶅瓨鍦�")
         val data = realTimeDataRep.fetchData(mission)
@@ -142,25 +146,24 @@
         // 鏌ユ壘鏄惁宸叉湁璧拌埅铻嶅悎璁板綍
         val oldGridDataList = satelliteGridRep.fetchGridData(GridData().apply {
             this.groupId = groupId
-            mixDataId = missionCode
+            this.missionCode = missionCode
             this.type = SatelliteDataType.Monitor.value.toByte()
         })
 
         if (oldGridDataList.isEmpty()) {
             // 鍒涘缓铻嶅悎鏁版嵁绱㈠紩瀵硅薄
-            val newGridData = GridData().apply {
+            val newGridData = gridData.apply {
                 this.groupId = groupId
                 dataTime = mission.startTime
                 type = SatelliteDataType.Monitor.value.toByte()
                 this.missionCode = mission.missionCode
-                // Fixme 2025.3.27: 琛屾斂鍖哄垝鍦ㄨ蛋鑸换鍔℃坊鍔犲搴斿瓧娈靛悗杩涜璧嬪��
-                provinceCode
-                provinceName
-                cityCode
-                cityName
-                districtCode
+                provinceCode = mission.provinceCode
+                provinceName = mission.provinceName
+                cityCode = mission.cityCode
+                cityName = mission.cityName
+                districtCode = mission.districtCode
                 districtName = mission.districtName
-                // Fixme 2025.3.27: 鎵�灞炵洃娴嬬偣鍖哄煙鐩墠闇�瑕侀�氳繃鐢ㄦ埛閫夋嫨纭畾
+                // 2025.3.27: 鎵�灞炵洃娴嬬偣鍖哄煙闇�瑕侀�氳繃鐢ㄦ埛閫夋嫨纭畾
                 zone
                 pollutionDegreeIndex
                 pollutionDegree
@@ -199,7 +202,7 @@
         }
     }
 
-    override fun mixGridData(groupId: Int, dataIdList: List<Int>): List<GridDataDetailMixVo> {
+    override fun mixUnderwayGridData(groupId: Int, dataIdList: List<Int>): List<GridDataDetailMixVo> {
         // 鑾峰彇鎵�浣跨敤鐨勭綉鏍肩粍缃戞牸淇℃伅
         val gridCellList = satelliteGridRep.fetchGridCell(groupId)
 
@@ -248,10 +251,11 @@
         gridDataDetailList: List<GridDataDetail>,
         searchLength: Int,
     ): List<GridDataDetail> {
+        val gridGroup =satelliteGridRep.fetchGridGroup(groupId)
         val gridCellList = satelliteGridRep.fetchGridCell(groupId)
         val originCellIdList = gridDataDetailList.map { it.cellId }
         // Fixme 2025.3.24: 姝ゅ鏍规嵁鐜版湁鐨勭綉鏍间俊鎭璁℃柟寮忥紝浣跨敤涓存椂鐨勫弬鏁帮紝鍚庣画灏嗙綉鏍奸�氳繃浜岀淮鍧愭爣褰㈠紡琛ㄧず锛屾澶勫弬鏁板幓闄�
-        val option = GridGroupOption(120, 90, 10, 10)
+        val option = GridGroupOption(gridGroup?.maxXaxis ?: 120, gridGroup?.maxYaxis ?: 90, 10, 10)
 
         val resMap = mutableMapOf<Int, MutableList<GridDataDetail>>()
 

--
Gitblit v1.9.3