Browse Source

断面数据统计添加设备类型

develop
xiepufeng 8 months ago
parent
commit
296c704ea6
  1. 5
      zc-business/src/main/java/com/zc/business/domain/DcTrafficSectionData.java
  2. 5
      zc-business/src/main/java/com/zc/business/request/DcTrafficMetricsDataRequest.java
  3. 4
      zc-business/src/main/java/com/zc/business/statistics/handler/TrafficStatistics.java

5
zc-business/src/main/java/com/zc/business/domain/DcTrafficSectionData.java

@ -72,6 +72,11 @@ public class DcTrafficSectionData {
*/ */
private Integer stakeMark; private Integer stakeMark;
/**
* 设备类型
*/
private Integer deviceType;
/** 创建时间 */ /** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")

5
zc-business/src/main/java/com/zc/business/request/DcTrafficMetricsDataRequest.java

@ -41,4 +41,9 @@ public class DcTrafficMetricsDataRequest {
* 是否分路段统计 * 是否分路段统计
*/ */
private boolean segmented; private boolean segmented;
/**
* 设备类型
*/
private Integer deviceType;
} }

4
zc-business/src/main/java/com/zc/business/statistics/handler/TrafficStatistics.java

@ -321,6 +321,8 @@ public class TrafficStatistics {
data.setPeriodType(TrafficDataPeriodTypeEnum.DAY); data.setPeriodType(TrafficDataPeriodTypeEnum.DAY);
// 将设备的桩号转换为整数后设置 // 将设备的桩号转换为整数后设置
data.setStakeMark(dcDevice.stakeMarkToInt()); data.setStakeMark(dcDevice.stakeMarkToInt());
// 设置设备类型
data.setDeviceType(Integer.valueOf(dcDevice.getDeviceType()));
} }
@ -459,6 +461,8 @@ public class TrafficStatistics {
aggregatedData.setDirection(firstDcTrafficSectionData.getDirection()); aggregatedData.setDirection(firstDcTrafficSectionData.getDirection());
// 上报时间 // 上报时间
aggregatedData.setReportTime(firstDcTrafficSectionData.getReportTime()); aggregatedData.setReportTime(firstDcTrafficSectionData.getReportTime());
// 设备类型
aggregatedData.setDeviceType(firstDcTrafficSectionData.getDeviceType());
// 计算平均车速并设置到汇总统计对象中 // 计算平均车速并设置到汇总统计对象中
if (trafficVolume != 0) { if (trafficVolume != 0) {

Loading…
Cancel
Save