From e4fafeda7a19d36ba78ce105d8f244ca40f61354 Mon Sep 17 00:00:00 2001 From: xiepufeng <1072271977@qq.com> Date: Tue, 2 Apr 2024 16:05:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=BB=98=E8=AE=A4=E6=8B=A5?= =?UTF-8?q?=E5=A0=B5=E9=87=8C=E7=A8=8B=E6=95=B0=E6=8D=AE=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/domain/DcTrafficMetricsData.java | 2 +- .../zc/business/enums/ChannelCongestionLevelEnum.java | 10 +++++----- .../business/statistics/handler/TrafficAnalysis.java | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcTrafficMetricsData.java b/zc-business/src/main/java/com/zc/business/domain/DcTrafficMetricsData.java index 29e180af..3fee49b5 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcTrafficMetricsData.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcTrafficMetricsData.java @@ -63,7 +63,7 @@ public class DcTrafficMetricsData { private Integer congestedSectionQuantity; /** - * 拥堵里程 + * 拥堵里程(单位:m) */ private Integer congestedDistance; } diff --git a/zc-business/src/main/java/com/zc/business/enums/ChannelCongestionLevelEnum.java b/zc-business/src/main/java/com/zc/business/enums/ChannelCongestionLevelEnum.java index f151e262..24922754 100644 --- a/zc-business/src/main/java/com/zc/business/enums/ChannelCongestionLevelEnum.java +++ b/zc-business/src/main/java/com/zc/business/enums/ChannelCongestionLevelEnum.java @@ -22,17 +22,17 @@ public enum ChannelCongestionLevelEnum { /** * 表示通道轻度拥堵,速度阈值为40 km/h */ - LIGHT_CONGESTION(40, 1, "轻度拥堵"), + LIGHT_CONGESTION(40, 1000, "轻度拥堵"), /** * 表示通道中度拥堵,速度阈值为20 km/h */ - MEDIUM_CONGESTION(20, 2, "中度拥堵"), + MEDIUM_CONGESTION(20, 2000, "中度拥堵"), /** * 使用负数作为默认值,表示无限小,始终小于其他速度阈值,表示通道严重拥堵 */ - SEVERE_CONGESTION(-1, 4, "严重拥堵"); + SEVERE_CONGESTION(-1, 4000, "严重拥堵"); /** * 速度阈值,用于判断通道拥挤程度 @@ -55,9 +55,9 @@ public enum ChannelCongestionLevelEnum { * @param speedThreshold 速度阈值 * @param description 等级描述 */ - ChannelCongestionLevelEnum(int speedThreshold, int defaultCongestionMiles, String description) { + ChannelCongestionLevelEnum(int speedThreshold, int defaultCongestionDistance, String description) { this.speedThreshold = speedThreshold; - this.defaultCongestionDistance = defaultCongestionMiles; + this.defaultCongestionDistance = defaultCongestionDistance; this.description = description; } diff --git a/zc-business/src/main/java/com/zc/business/statistics/handler/TrafficAnalysis.java b/zc-business/src/main/java/com/zc/business/statistics/handler/TrafficAnalysis.java index 657927ac..1be1f17c 100644 --- a/zc-business/src/main/java/com/zc/business/statistics/handler/TrafficAnalysis.java +++ b/zc-business/src/main/java/com/zc/business/statistics/handler/TrafficAnalysis.java @@ -444,6 +444,7 @@ public class TrafficAnalysis { totalCongestionDistance.addAndGet(defaultCongestionDistance); } else { totalCongestionDistance.addAndGet(congestionDistance); + // 如果当前路段被计算过,则累加拥堵路段数量 congestedSectionQuantity.addAndGet(1); } }