diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt index 49a52b6033..6109b19a93 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt @@ -59,7 +59,7 @@ object TrackerSourceColorHelper { } // pnc预警 - WarningHelper.getPncColor(data.uuid.toString()){ + WarningHelper.getPncColor(data.uuid.toString()) { if (it.isNotBlank()) { color = it } @@ -111,26 +111,29 @@ object TrackerSourceColorHelper { */ @SuppressLint("NewApi") fun isV2I(data: TrackedObject): Pair { - val source = data.trackedSourceList.stream().allMatch { - it.source == 4 - } - if (source) { - val first = data.trackedSourceList.stream() - .filter { trackedSource: TrackedSource -> trackedSource.source == 4 }.findFirst() - if (first.isPresent) { - val subV2I = first.get().subSourceList.stream().allMatch { - it.source == 6 - } - if (subV2I) { - val subFirst = first.get().subSourceList.stream() - .filter { subSource: SubSource -> subSource.source == 6 } - .findFirst() - if (subFirst.isPresent) { - return Pair(subFirst.get(), true) + if (data.trackedSourceList.size == 1) { // 如果仅有一个类型 + val source = data.trackedSourceList.stream().allMatch { it.source == 2 } + if (source) { + val first = data.trackedSourceList.stream() + .filter { trackedSource: TrackedSource -> trackedSource.source == 2 } + .findFirst() + if (first.isPresent) { + val subV2I = first.get().subSourceList.stream().allMatch { + it.source == 6 + } + if (subV2I) { + val subFirst = first.get().subSourceList.stream() + .filter { subSource: SubSource -> subSource.source == 6 } + .findFirst() + if (subFirst.isPresent) { + return Pair(subFirst.get(), true) + } } } } } return Pair(null, false) } + + } \ No newline at end of file