diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/FMInfoMsg.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/FMInfoMsg.kt index b88f1e5a9a..199b6848b7 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/FMInfoMsg.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/FMInfoMsg.kt @@ -9,4 +9,13 @@ import java.io.Serializable data class FMInfoMsg( var fmInfoList: List?, var policyCode: String? -) : Serializable \ No newline at end of file +) : Serializable + +/** + * 数据中心使用,用于过滤变更数据 + */ +data class FMFilterInfoMsg( + var fmInfoList: List?, + var policyCode: String?, + var cacheFilterList: MutableList? +) \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerFaultManagementStateListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerFaultManagementStateListenerManager.kt index 59bfb669e2..19caf800a9 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerFaultManagementStateListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerFaultManagementStateListenerManager.kt @@ -1,8 +1,12 @@ package com.mogo.eagle.core.function.call.autopilot -import androidx.collection.ArraySet +import com.mogo.eagle.core.data.msgbox.FMFilterInfoMsg +import com.mogo.eagle.core.data.msgbox.FMInfoMsg +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.function.api.autopilot.IMoGoFaultManagementStateListener import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import fault_management.FmInfo /** @@ -10,18 +14,60 @@ import fault_management.FmInfo */ object CallerFaultManagementStateListenerManager : CallerBase() { - private val cacheFaultList = ArrayList() - private val cachePolicyMap = hashMapOf() + private val cachePolicyMap = hashMapOf() fun invokeFaultManagementState(fmInfo: FmInfo.FaultResultMsg) { - val list = fmInfo.infosList - - list.forEach { - cacheFaultList.add(it.faultId) + val policyCode = fmInfo.downgradePolicyCode + if (policyCode == null || policyCode.isEmpty()) { + return } -// M_LISTENERS.forEach { -// val listener = it.value -// listener.onFaultManagementState(fmInfo) -// } + val list = fmInfo.infosList ?: return + //报告类数据不下发 + if ("FM_DP_NO_ACTION" == policyCode) { + return + } + val fmFilterInfoMsg = cachePolicyMap[policyCode] + val cacheFaultList = ArrayList() + if (fmFilterInfoMsg?.cacheFilterList != null) { + if (fmFilterInfoMsg.cacheFilterList?.size == list.size) { + //判断两个集合重复 true:return + var sameResult = false + list.forEach { + sameResult = fmFilterInfoMsg.cacheFilterList?.contains(it.faultId) == true + } + if (sameResult) { + return + } + } + // 更新数据内容 + list.forEach { + cacheFaultList.add(it.faultId) + } + fmFilterInfoMsg.cacheFilterList?.clear() + fmFilterInfoMsg.cacheFilterList = cacheFaultList + fmFilterInfoMsg.fmInfoList = list + cachePolicyMap[policyCode] = fmFilterInfoMsg + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.FMINFO, + FMInfoMsg(list, policyCode) + ) + ) + } else { + // 首次添加 listener + cachePolicyMap.clear() + list.forEach { + cacheFaultList.add(it.faultId) + } + cachePolicyMap[policyCode] = FMFilterInfoMsg(list, policyCode, cacheFaultList) + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.FMINFO, + FMInfoMsg(list, policyCode) + ) + ) + } + } + } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index ef897e5018..4c6b041c4c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -61,7 +61,7 @@ bytex.ASM_API=ASM7 ################ 外部依赖引用 ################ # loglib -LOGLIB_VERSION=1.9.18 +LOGLIB_VERSION=1.10.2 ######## MogoAiCloudSDK Version ######## # 网络请求LOGLIB_VERSION MOGO_NETWORK_VERSION=1.4.7.19