Browse Source

修复默认拥堵里程数据错误的问题

develop
xiepufeng 8 months ago
parent
commit
e4fafeda7a
  1. 2
      zc-business/src/main/java/com/zc/business/domain/DcTrafficMetricsData.java
  2. 10
      zc-business/src/main/java/com/zc/business/enums/ChannelCongestionLevelEnum.java
  3. 1
      zc-business/src/main/java/com/zc/business/statistics/handler/TrafficAnalysis.java

2
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;
}

10
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;
}

1
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);
}
}

Loading…
Cancel
Save