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 a8963eb918..64120bb31f 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 @@ -4,6 +4,7 @@ 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.data.msgbox.MsgFmData 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 @@ -18,6 +19,11 @@ object CallerFaultManagementStateListenerManager : CallerBase() + private var currentHighAction: Int = 10 //故障Level,默认为10 + private var faultIdStr: String = "" //故障信息内容 + private var lastFaultTime: Long= 0 //故障时间 + private var tempHighAction: Int = 9 //临时故障Level + fun invokeFaultManagementState(fmInfo: FmInfo.FaultResultMsg) { val policyCode = fmInfo.downgradePolicyCode if (policyCode == null || policyCode.isEmpty()) { @@ -32,6 +38,43 @@ object CallerFaultManagementStateListenerManager : CallerBase + if(info.faultActionCount != 0){ + info.faultActionList.forEach { action -> + //如果此故障Level高于之前的最高优先级的故障,则进行赋值 + if(MsgFmData.FaultAction.getFaultLevel(action) < tempHighAction){ + tempHighAction = MsgFmData.FaultAction.getFaultLevel(action) + } + } + } + fmFaultReason.append(info.faultId) + } + if(tempHighAction == currentHighAction){ + //最高优先级的Action无变化,故障信息内容对比上一次无变化时,10min内仅产生一条消息 + if(faultIdStr == fmFaultReason.toString()){ + if(System.currentTimeMillis() - lastFaultTime < 10*60*1000){ + return + } + }else{ + //当最高优先级的actions无变化、故障信息内容对比上一次有变化时,1min内仅产生一条消息 + if(faultIdStr != fmFaultReason.toString()){ + if(System.currentTimeMillis() - lastFaultTime < 60*1000){ + return + } + } + } + }else{ + currentHighAction = tempHighAction + } + faultIdStr = fmFaultReason.toString() val fmFilterInfoMsg = cachePolicyMap[policyCode] val cacheFaultList = ArrayList() val policyTime = fmInfo.time @@ -40,11 +83,7 @@ object CallerFaultManagementStateListenerManager : CallerBase