From 594de76ed51fd49fb79b912212bb0052a63e7671 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 09 四月 2026 16:10:45 +0800
Subject: [PATCH] 2026.4.9
---
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/SatelliteDataCalculateServiceImpl.kt | 2
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImpl.kt | 13 +++-
src/main/kotlin/com/flightfeather/uav/common/exception/BizException.kt | 2
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt | 2
src/test/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceControllerTest.kt | 4
src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt | 11 +++
src/main/resources/application-pro.yml | 10 +-
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/MissionServiceImplTest.kt | 2
src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt | 9 +++
src/main/kotlin/com/flightfeather/uav/lightshare/web/BaseResPack.kt | 3 +
src/main/kotlin/com/flightfeather/uav/domain/repository/SatelliteGridRep.kt | 4 +
src/test/kotlin/com/flightfeather/uav/common/net/ShenXinServiceTest.kt | 8 +-
src/main/kotlin/com/flightfeather/uav/domain/repository/SourceTraceRep.kt | 3
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImplTest.kt | 2
src/main/kotlin/com/flightfeather/uav/lightshare/service/DataAnalysisService.kt | 3
src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt | 4 +
src/main/kotlin/com/flightfeather/uav/domain/repository/impl/AirDataRepImpl.kt | 18 +++---
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/MissionServiceImpl.kt | 2
src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt | 25 ++++++++
19 files changed, 97 insertions(+), 30 deletions(-)
diff --git a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt
index 073926b..4d85e8f 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedData.kt
@@ -203,7 +203,9 @@
excGroup = exceptionDataGroup().map { ExcGroup(it, e.first.main) }
avgPer = excGroup?.mapNotNull { it.per }?.average()
+ if (avgPer?.isNaN() == true) avgPer = .0
avgRate = excGroup?.mapNotNull { it.rate }?.average()
+ if (avgRate?.isNaN() == true) avgRate = .0
}
}
}
diff --git a/src/main/kotlin/com/flightfeather/uav/common/exception/BizException.kt b/src/main/kotlin/com/flightfeather/uav/common/exception/BizException.kt
index 7a7746b..1b22076 100644
--- a/src/main/kotlin/com/flightfeather/uav/common/exception/BizException.kt
+++ b/src/main/kotlin/com/flightfeather/uav/common/exception/BizException.kt
@@ -3,7 +3,7 @@
/**
* 鍏佽鎺ュ彛杩斿洖鐨勪笟鍔″眰闈㈢殑閿欒
*/
-class BizException : Exception {
+class BizException : RuntimeException {
constructor():super()
constructor(message: String) : super(message)
constructor(message: String, cause: Throwable?) : super(message, cause)
diff --git a/src/main/kotlin/com/flightfeather/uav/domain/repository/SatelliteGridRep.kt b/src/main/kotlin/com/flightfeather/uav/domain/repository/SatelliteGridRep.kt
index 9233bcb..4cf2d0f 100644
--- a/src/main/kotlin/com/flightfeather/uav/domain/repository/SatelliteGridRep.kt
+++ b/src/main/kotlin/com/flightfeather/uav/domain/repository/SatelliteGridRep.kt
@@ -105,6 +105,10 @@
return gridDataMapper.insert(gridData)
}
+ fun updateGridData(gridData: GridData): Int {
+ return gridDataMapper.updateByPrimaryKey(gridData)
+ }
+
fun insertGridDataDetail(gridDataDetails: List<GridDataDetail?>): Int {
return gridDataDetailMapper.insertList(gridDataDetails)
}
diff --git a/src/main/kotlin/com/flightfeather/uav/domain/repository/SourceTraceRep.kt b/src/main/kotlin/com/flightfeather/uav/domain/repository/SourceTraceRep.kt
index 3d8d7e7..d5c2e0a 100644
--- a/src/main/kotlin/com/flightfeather/uav/domain/repository/SourceTraceRep.kt
+++ b/src/main/kotlin/com/flightfeather/uav/domain/repository/SourceTraceRep.kt
@@ -133,7 +133,8 @@
else -> null
}
}
- stMsgCache[key] = stMsgList
+ // Fixme 2026.1.21 婧簮璁板綍鐨勭紦瀛橀�昏緫鏆傜己澶憋紝姝ゅ澶勭悊涓嶆伆褰�
+// stMsgCache[key] = stMsgList
}
// 绛涢�夊嚭寮傚父鏁版嵁PollutedClue涓紓甯哥櫨鍒嗘瘮澶т簬minPer鐨�
return stMsgList.filter {
diff --git a/src/main/kotlin/com/flightfeather/uav/domain/repository/impl/AirDataRepImpl.kt b/src/main/kotlin/com/flightfeather/uav/domain/repository/impl/AirDataRepImpl.kt
index 2931e5b..59e2d87 100644
--- a/src/main/kotlin/com/flightfeather/uav/domain/repository/impl/AirDataRepImpl.kt
+++ b/src/main/kotlin/com/flightfeather/uav/domain/repository/impl/AirDataRepImpl.kt
@@ -35,11 +35,11 @@
private val tmpVehicleDataList = mutableListOf<BaseRealTimeData>()
// 璧拌埅鐩戞祴鏍″噯绯绘暟
- private val calibrationMap = mutableMapOf<String, MutableMap<Int, Float>>()
+ private val calibrationMap = mutableMapOf<String?, MutableMap<Int, Float>>()
// 璧拌埅鐩戞祴鏍″噯绯绘暟鏇存柊鏃堕棿
private var cUpdateTime = LocalDateTime.now()
// 璧拌埅鐩戞祴鏍″噯绯绘暟鏇存柊鏃堕棿闂撮殧锛堝垎閽燂級
- private val cInterval = 5L
+ private val cInterval = 1L
override fun saveAirData(dataPackage: AirDataPackage): Int {
val data = RealTimeData().apply {
@@ -135,7 +135,7 @@
val d = vo.toBaseRealTimeData(RealTimeDataVehicle::class.java)
/***************************************************************************************************/
// FIXME: 2021/10/27 杞﹁浇鐩戞祴閮ㄥ垎鍥犲瓙閲忕骇璋冩暣
- calibration(d, UWDeviceType.VEHICLE)
+ calibration(d, d.deviceCode)
/***************************************************************************************************/
realTimeDataVehicleMapper.insert(d)
res.add(d)
@@ -267,20 +267,20 @@
}
}
- private fun calibration(data: BaseRealTimeData, type: UWDeviceType) {
+ private fun calibration(data: BaseRealTimeData, deviceCode: String?) {
//1. 鏍″噯绯绘暟鎸夌収涓�瀹氭椂闂撮棿闅旇繘琛屽埛鏂�
val now = LocalDateTime.now()
- if (calibrationMap.isEmpty() || now.minusMinutes(cInterval).isAfter(cUpdateTime)) {
+ if (calibrationMap[deviceCode].isNullOrEmpty() || now.minusMinutes(cInterval).isAfter(cUpdateTime)) {
cUpdateTime = now
- calibrationMap[type.value] = mutableMapOf()
+ calibrationMap[deviceCode] = mutableMapOf()
factorCalibrationMapper.selectByExample(Example(FactorCalibration::class.java).apply {
- createCriteria().andEqualTo("deviceType", type.value)
+ createCriteria().andEqualTo("deviceType", deviceCode)
}).forEach {
- calibrationMap[type.value]?.put(it.factorId, it.factorScale)
+ calibrationMap[deviceCode]?.put(it.factorId, it.factorScale)
}
}
//2. 鏍规嵁鏍″噯绯绘暟璁$畻
- calibrationMap[type.value]?.let{
+ calibrationMap[deviceCode]?.let {
data.voc = data.voc?.times(it[FactorType.VOC.value] ?: 1f)
data.co = data.co?.times(it[FactorType.CO.value] ?: 1f)
data.pm25 = data.pm25?.times(it[FactorType.PM25.value] ?: 1f)
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt
index 65c0fab..ebd420d 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt
@@ -35,6 +35,15 @@
return null
}
+ fun setFactorData(type: FactorType, value: Double?) {
+ if (values == null) throw IllegalStateException(this.javaClass.name + ": 鐩戞祴鏁版嵁鏁扮粍涓簄ull")
+ for (d in values!!) {
+ if (d.factorName == type.name) {
+ d.factorData = value
+ }
+ }
+ }
+
fun toRowContent(): Array<Any> {
val row = mutableListOf<Any>()
row.add(deviceCode ?: "")
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/DataAnalysisService.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/DataAnalysisService.kt
index 0587c85..80a6e19 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/service/DataAnalysisService.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/DataAnalysisService.kt
@@ -12,6 +12,7 @@
import com.flightfeather.uav.domain.entity.Mission
import com.flightfeather.uav.domain.entity.SceneInfo
import com.flightfeather.uav.lightshare.bean.AreaVo
+import com.flightfeather.uav.lightshare.bean.DataHead
import com.flightfeather.uav.lightshare.bean.GridDataDetailMixVo
import com.flightfeather.uav.lightshare.eunm.PollutionDegree
import com.flightfeather.uav.socket.eunm.FactorType
@@ -42,7 +43,7 @@
* @param minPer 鏈�灏忔薄鏌撶櫨鍒嗘瘮锛岀敤浜庣瓫閫夊紓甯告暟鎹偣锛堝彲閫夛級
* @return 鍘嗗彶姹℃煋婧簮缁撴灉鐨勫瓧绗︿覆琛ㄧず锛堝叿浣撴牸寮忛渶鍙傝�冨疄鐜扮被锛�
*/
- fun fetchHistory(missionCode: String, minPer: Double?): String
+ fun fetchHistory(missionCode: String, minPer: Double?, page: Int?, perPage: Int?): Pair<DataHead, String>
/**
* 鐢熸垚璧拌埅浠诲姟姹囨�荤粺璁�
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImpl.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImpl.kt
index ad2cc21..b7fcaf3 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImpl.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImpl.kt
@@ -15,13 +15,16 @@
import com.flightfeather.uav.domain.mapper.MissionMapper
import com.flightfeather.uav.domain.repository.*
import com.flightfeather.uav.lightshare.bean.AreaVo
+import com.flightfeather.uav.lightshare.bean.DataHead
import com.flightfeather.uav.lightshare.bean.GridDataDetailMixVo
+import com.flightfeather.uav.lightshare.bean.SourceTraceMsgVo
import com.flightfeather.uav.lightshare.eunm.PollutionDegree
import com.flightfeather.uav.lightshare.eunm.SceneType
import com.flightfeather.uav.lightshare.service.DataAnalysisService
import com.flightfeather.uav.lightshare.service.SatelliteDataCalculateService
import com.flightfeather.uav.socket.eunm.FactorType
import com.flightfeather.uav.socket.sender.MsgType
+import com.github.pagehelper.PageHelper
import org.springframework.stereotype.Service
import java.util.*
@@ -81,11 +84,15 @@
* @return 鍘嗗彶姹℃煋婧簮缁撴灉鐨凧SON瀛楃涓诧紝鍏蜂綋鏍煎紡鐢眘ourceTraceRep瀹炵幇鍐冲畾
* @throws BizException 褰撹蛋鑸换鍔′笉瀛樺湪鏃舵姏鍑�
*/
- override fun fetchHistory(missionCode: String, minPer: Double?): String {
+ override fun fetchHistory(missionCode: String, minPer: Double?, page: Int?, perPage: Int?): Pair<DataHead, String> {
val mission = missionRep.findOne(missionCode) ?: throw BizException("璧拌埅浠诲姟涓嶅瓨鍦�")
-
+ val p = if (page != null && perPage != null) {
+ PageHelper.startPage<SourceTraceMsgVo>(page, perPage)
+ } else {
+ null
+ }
val res = sourceTraceRep.fetchList(mission.deviceCode, mission.startTime, mission.endTime, minPer = minPer ?: 0.5)
- return GsonUtils.gson.toJson(res)
+ return DataHead(p?.pageNum ?: 1, p?.pages ?: 1) to GsonUtils.gson.toJson(res)
}
/**
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/MissionServiceImpl.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/MissionServiceImpl.kt
index 54484a9..c8ace2f 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/MissionServiceImpl.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/MissionServiceImpl.kt
@@ -94,7 +94,7 @@
val data = realTimeDataRep.fetchData(mission)
mission.kilometres = MissionUtil.calKilometres(data).toFloat()
// todo: 璁$畻璧拌埅浠诲姟鎵�鍦ㄤ腑蹇冨尯鍩�
-// mission.region = MissionUtil.calRegion(data)
+ mission.region = MissionUtil.calRegion(data)
return updateMission(mission)
}
}
\ No newline at end of file
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 93866e6..f4755fe 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
@@ -142,6 +142,7 @@
// 鏌ヨ璧拌埅浠诲姟鍙婂搴旇蛋鑸洃娴嬫暟鎹�
val mission = missionRep.findOne(missionCode) ?: throw BizException("浠诲姟涓嶅瓨鍦�")
val data = realTimeDataRep.fetchData(mission)
+ if (data.isEmpty()) throw BizException("娌℃湁璧拌埅鏁版嵁锛屾棤娉曠敓鎴愯蛋鑸綉鏍�")
// 鏌ユ壘鏄惁宸叉湁璧拌埅铻嶅悎璁板綍
val oldGridDataList = satelliteGridRep.fetchGridData(GridData().apply {
@@ -184,6 +185,7 @@
return gridDataDetailList
} else {
+ satelliteGridRep.updateGridData(gridData)
val oldGridData = oldGridDataList.first()
val oldGridDataDetailList = satelliteGridRep.fetchGridDataDetail(oldGridData?.id, oldGridData?.groupId)
// 鏌ヨ缃戞牸鍗曞厓鏍间俊鎭�
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/web/BaseResPack.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/web/BaseResPack.kt
index f9687d8..509fcee 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/web/BaseResPack.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/web/BaseResPack.kt
@@ -23,5 +23,8 @@
}
} catch (e: BizException) {
BaseResponse(false, message = e.message ?: "")
+ } catch (e: Exception) {
+ e.printStackTrace()
+ BaseResponse(false, message = e.message ?: "鏈嶅姟鍣ㄥ嚭鐜板唴閮ㄩ敊璇�")
}
}
\ No newline at end of file
diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt
index f06e332..ba34105 100644
--- a/src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt
+++ b/src/main/kotlin/com/flightfeather/uav/lightshare/web/DataAnalysisController.kt
@@ -33,7 +33,9 @@
fun fetchHistory(
@ApiParam("璧拌埅浠诲姟缂栧彿") @RequestParam missionCode: String,
@ApiParam("鏈�灏忔薄鏌撶櫨鍒嗘瘮锛岀敤浜庣瓫閫夊紓甯告暟鎹偣锛堝彲閫夛級") @RequestParam(required = false) minPer: Double? = null,
- ) = resPack { dataAnalysisService.fetchHistory(missionCode, minPer) }
+ @RequestParam(value = "page", required = false) page: Int?,
+ @RequestParam(value = "perPage", required = false) perPage: Int?,
+ ) = resPack { dataAnalysisService.fetchHistory(missionCode, minPer, page, perPage) }
@ApiOperation(value = "鐢熸垚璧拌埅浠诲姟姹囨�荤粺璁�")
@PostMapping("/report/missionSummary")
diff --git a/src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt b/src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt
index 45f9b80..92cca2d 100644
--- a/src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt
+++ b/src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt
@@ -12,6 +12,7 @@
import kotlin.math.min
import kotlin.math.round
import kotlin.math.sqrt
+import kotlin.time.times
/**
* 鏁版嵁骞虫粦棰勫鐞�
@@ -148,6 +149,7 @@
i = 0
}
while (i < mDataList.size) {
+ // 閽堝姣忎釜鐩戞祴鍥犲瓙锛屽垎鍒仛鏁版嵁骞虫粦澶勭悊
for (y in mDataList[i].values?.indices ?: 0..0) {
val it = mDataList[i].values?.get(y) ?: continue
val vMax = FactorType.getVMin(it.factorName) ?: continue
@@ -192,6 +194,29 @@
}
}
+ // 鏍规嵁鐗╃悊瑙勫緥锛屽墧闄ゆ垨淇涓嶅悎鐞嗙殑鏁版嵁
+ val data = mDataList[i]
+ // 1. PM2.5 搴旇濮嬬粓灏忎簬PM10
+ val pm25 = data.getFactorData(FactorType.PM25)
+ val pm10 = data.getFactorData(FactorType.PM10)
+ if (pm25 != null && pm10 != null) {
+ // 鑻m2.5澶т簬pm10
+ if (pm25 >= pm10){
+ val lastIndex = i - 1
+ // 鍒欏皢pm2.5淇敼涓哄墠涓�涓暟鎹殑鍊�
+ if (lastIndex >= 0) {
+ data.setFactorData(FactorType.PM25, mDataList[lastIndex].getFactorData(FactorType.PM25))
+ } else {
+ if (lastData.isEmpty()) {
+ // 娌℃湁鍘嗗彶鏁版嵁鏃讹紝淇敼涓簆m10鐨�80%(鍚庣画寰呬紭鍖栨瘮渚� 2026.3.6)
+ data.setFactorData(FactorType.PM25, data.getFactorData(FactorType.PM10)?.times(.8))
+ } else {
+ data.setFactorData(FactorType.PM25, lastData.last().getFactorData(FactorType.PM25))
+ }
+ }
+ }
+ }
+
i++
}
diff --git a/src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt b/src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt
index 8d7f42f..0058d2b 100644
--- a/src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt
+++ b/src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt
@@ -72,6 +72,8 @@
fun saveToDataBase(dataPackage: AirDataPackage): List<BaseRealTimeData>? {
when (dataPackage.commandUnit) {
AirCommandUnit.AirData.value -> {
+ // 瀛樺偍鍓嶅垽鏂暟鎹槸鍚︽湁鏁�
+ if (!isValid(dataPackage)) return null
// 浠son鏍煎紡瀛樺偍鍘熷鏁版嵁
airDataRep.saveAirData(dataPackage)
// 杩涜棰勫鐞嗗悗锛屽瓨鍌ㄨ嚦瀵瑰簲鏁版嵁琛�
@@ -145,4 +147,13 @@
return sb.toString()
}
+
+ /**
+ * 鏁版嵁鏈夋晥鎬у垽鏂�
+ */
+ private fun isValid(dataPackage: AirDataPackage): Boolean {
+ if (dataPackage.dataTime == null) return false
+ val check1 = dataPackage.dataTime!!.time < Date().time
+ return check1
+ }
}
\ No newline at end of file
diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml
index a01fab2..a4688c1 100644
--- a/src/main/resources/application-pro.yml
+++ b/src/main/resources/application-pro.yml
@@ -1,15 +1,15 @@
spring:
datasource:
# 绾夸笂鏈嶅姟鍣� 47
-# url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
-# username: dronemonitor
-# password: dronemonitor_hackxrnomxm
-
- # 绾夸笂鏈嶅姟鍣� 114
url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
username: dronemonitor
password: dronemonitor_hackxrnomxm
+ # 绾夸笂鏈嶅姟鍣� 114
+# url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
+# username: dronemonitor
+# password: dronemonitor_hackxrnomxm
+
springfox:
documentation:
swagger:
diff --git a/src/test/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceControllerTest.kt b/src/test/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceControllerTest.kt
index 2a48760..9e36bd2 100644
--- a/src/test/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceControllerTest.kt
+++ b/src/test/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceControllerTest.kt
@@ -39,7 +39,7 @@
@Test
fun autoSourceTrace() {
val sourceTraceController = SourceTraceController(sceneInfoRep, sourceTraceRep, true)
- val startTime = LocalDateTime.of(2025, 11, 19, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant()
+ val startTime = LocalDateTime.of(2025, 10, 1, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant()
// val endTime = LocalDateTime.of(2025, 11, 19, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant()
// val startTime = LocalDateTime.of(2025, 11, 1, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant()
val endTime = LocalDateTime.of(2025, 12, 31, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant()
@@ -67,7 +67,7 @@
@Test
fun deleteSourceTrace() {
- val startTime = LocalDateTime.of(2025, 11, 19, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant()
+ val startTime = LocalDateTime.of(2025, 12, 18, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant()
// val endTime = LocalDateTime.of(2025, 11, 19, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant()
// val startTime = LocalDateTime.of(2025, 11, 1, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant()
val endTime = LocalDateTime.of(2025, 12, 31, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant()
diff --git a/src/test/kotlin/com/flightfeather/uav/common/net/ShenXinServiceTest.kt b/src/test/kotlin/com/flightfeather/uav/common/net/ShenXinServiceTest.kt
index b57805a..bd2f472 100644
--- a/src/test/kotlin/com/flightfeather/uav/common/net/ShenXinServiceTest.kt
+++ b/src/test/kotlin/com/flightfeather/uav/common/net/ShenXinServiceTest.kt
@@ -12,15 +12,15 @@
@Test
fun fetchData() {
val mission = Mission().apply {
- missionCode = "SHJA-20240813"
+ missionCode = "20260119"
deviceType = "0a"
deviceCode = "TX105"
- startTime = Date.from(LocalDateTime.of(2024, 8, 13, 11, 30, 0, 0).atZone(ZoneId.systemDefault())
+ startTime = Date.from(LocalDateTime.of(2026, 1, 19, 8, 30, 0, 0).atZone(ZoneId.systemDefault())
.toInstant())
- endTime = Date.from(LocalDateTime.of(2024, 8, 13, 17, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant())
+ endTime = Date.from(LocalDateTime.of(2026, 1, 19, 16, 30, 0, 0).atZone(ZoneId.systemDefault()).toInstant())
districtName = "闈欏畨鍖�"
}
- val date = LocalDateTime.of(2024, 8, 13, 15, 43, 0, 0)
+ val date = LocalDateTime.of(2026, 1, 19, 14, 0, 0, 0)
val res = ShenXinService.fetchData(mission, date)
println(res)
}
diff --git a/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImplTest.kt b/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImplTest.kt
index fe09759..93421c9 100644
--- a/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImplTest.kt
+++ b/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/DataAnalysisServiceImplTest.kt
@@ -34,7 +34,7 @@
@Test
fun fetchHistory() {
- dataAnalysisService.fetchHistory("SH-CN-20250723(01)", .0)
+ dataAnalysisService.fetchHistory("SH-CN-20260121", .0, 1, 10000)
}
@Test
diff --git a/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/MissionServiceImplTest.kt b/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/MissionServiceImplTest.kt
index bc62623..0efb7d0 100644
--- a/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/MissionServiceImplTest.kt
+++ b/src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/MissionServiceImplTest.kt
@@ -34,7 +34,7 @@
@Test
fun calMissionInfo() {
missionMapper.selectByExample(Example(Mission::class.java).apply {
- createCriteria().andBetween("startTime", "2025-12-11 00:00:00", "2025-12-11 23:59:59")
+ createCriteria().andBetween("startTime", "2026-01-29 00:00:00", "2026-12-31 23:59:59")
}).forEach {mission ->
mission?.let { missionService.calMissionInfo(it.missionCode) }
Thread.sleep(1000)
--
Gitblit v1.9.3