|
|
@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.ruoyi.common.core.redis.RedisCache; |
|
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
|
import com.zc.business.constant.RedisKeyConstants; |
|
|
|
import com.zc.business.constant.StatisticalRecoveryOffsetTime; |
|
|
|
import com.zc.business.controller.DcDeviceController; |
|
|
|
import com.zc.business.domain.DcDevice; |
|
|
|
import com.zc.business.domain.DcTrafficSectionData; |
|
|
@ -247,16 +246,16 @@ public class TrafficStatistics { |
|
|
|
* @param reportTime 报告时间,标识数据的时间戳。 |
|
|
|
* @return 返回一个Map,包含上行和下行的交通段数据。 |
|
|
|
*/ |
|
|
|
private Map<LaneDirection, DcTrafficSectionData> processLaneData(JSONArray lanes, DcDevice dcDevice, Date reportTime) { |
|
|
|
private Map<LaneDirectionEnum, DcTrafficSectionData> processLaneData(JSONArray lanes, DcDevice dcDevice, Date reportTime) { |
|
|
|
|
|
|
|
Map<LaneDirection, DcTrafficSectionData> resultMap = new HashMap<>(); |
|
|
|
Map<LaneDirectionEnum, DcTrafficSectionData> resultMap = new HashMap<>(); |
|
|
|
|
|
|
|
// 初始化上行和下行的交通段数据
|
|
|
|
DcTrafficSectionData upwardData = new DcTrafficSectionData(); |
|
|
|
DcTrafficSectionData downwardData = new DcTrafficSectionData(); |
|
|
|
|
|
|
|
initializeTrafficSectionData(upwardData, dcDevice, reportTime, LaneDirection.UPWARD); |
|
|
|
initializeTrafficSectionData(downwardData, dcDevice, reportTime, LaneDirection.DOWNWARD); |
|
|
|
initializeTrafficSectionData(upwardData, dcDevice, reportTime, LaneDirectionEnum.UPWARD); |
|
|
|
initializeTrafficSectionData(downwardData, dcDevice, reportTime, LaneDirectionEnum.DOWNWARD); |
|
|
|
|
|
|
|
// 初始化上行和下行的车流量
|
|
|
|
int upwardTrafficVolume = 0, downwardTrafficVolume = 0; |
|
|
@ -294,8 +293,8 @@ public class TrafficStatistics { |
|
|
|
setTrafficSectionData(downwardData, downwardTrafficVolume, downwardCumulativeAverageSpeed, downwardLargeTrafficVolume); |
|
|
|
|
|
|
|
// 将上行和下行的交通段数据放入结果映射中
|
|
|
|
resultMap.put(LaneDirection.UPWARD, upwardData); |
|
|
|
resultMap.put(LaneDirection.DOWNWARD, downwardData); |
|
|
|
resultMap.put(LaneDirectionEnum.UPWARD, upwardData); |
|
|
|
resultMap.put(LaneDirectionEnum.DOWNWARD, downwardData); |
|
|
|
|
|
|
|
return resultMap; |
|
|
|
} |
|
|
@ -308,7 +307,7 @@ public class TrafficStatistics { |
|
|
|
* @param reportTime 数据上报时间 |
|
|
|
* @param direction 车道方向 |
|
|
|
*/ |
|
|
|
private void initializeTrafficSectionData(DcTrafficSectionData data, DcDevice dcDevice, Date reportTime, LaneDirection direction) { |
|
|
|
private void initializeTrafficSectionData(DcTrafficSectionData data, DcDevice dcDevice, Date reportTime, LaneDirectionEnum direction) { |
|
|
|
|
|
|
|
// 设置设备id
|
|
|
|
data.setDeviceId(dcDevice.getId()); |
|
|
|