Commit cbf4195a authored by zhoushiguang's avatar zhoushiguang

停车次数保留2位小数

parent e8fcdaac
...@@ -231,82 +231,82 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService { ...@@ -231,82 +231,82 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
.mapToDouble(CrossDataHistPOExt::getNoStopRate) .mapToDouble(CrossDataHistPOExt::getNoStopRate)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_RATE.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_RATE.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDataHistPOExt::getOneStopRate) .mapToDouble(CrossDataHistPOExt::getOneStopRate)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_DELAY.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_DELAY.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToInt(CrossDataHistPOExt::getDelayTime) .mapToInt(CrossDataHistPOExt::getDelayTime)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.MAX_QUEUE_LENGTH.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.MAX_QUEUE_LENGTH.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDataHistPOExt::getQueueLength) .mapToDouble(CrossDataHistPOExt::getQueueLength)
.max() .max()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_TIMES.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_TIMES.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDataHistPOExt::getStopTimes) .mapToDouble(CrossDataHistPOExt::getStopTimes)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(v);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_SPEED.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_SPEED.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDataHistPOExt::getSpeed) .mapToDouble(CrossDataHistPOExt::getSpeed)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.GREEN_LIGHT_EFFICIENCY.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.GREEN_LIGHT_EFFICIENCY.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDataHistPOExt::getGreenLightEfficiency) .mapToDouble(CrossDataHistPOExt::getGreenLightEfficiency)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.SATURATION.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.SATURATION.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDataHistPOExt::getSturation) .mapToDouble(CrossDataHistPOExt::getSturation)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.LOAD_BALANCE.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.LOAD_BALANCE.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDataHistPOExt::getLoadBalance) .mapToDouble(CrossDataHistPOExt::getLoadBalance)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.EFFUSION_RATE.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.EFFUSION_RATE.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDataHistPOExt::getEffusionRate) .mapToDouble(CrossDataHistPOExt::getEffusionRate)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.EMPTY_PHASE.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.EMPTY_PHASE.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDataHistPOExt::getEmptyPhase) .mapToDouble(CrossDataHistPOExt::getEmptyPhase)
.sum(); .sum();
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.FLOW.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.FLOW.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDataHistPOExt::getFlow) .mapToDouble(CrossDataHistPOExt::getFlow)
.sum(); .sum();
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} }
// 排序用 // 排序用
...@@ -364,62 +364,62 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService { ...@@ -364,62 +364,62 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
.mapToDouble(CrossDirDataHistPO::getNoStopRate) .mapToDouble(CrossDirDataHistPO::getNoStopRate)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_RATE.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_RATE.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDirDataHistPO::getOneStopRate) .mapToDouble(CrossDirDataHistPO::getOneStopRate)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_DELAY.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_DELAY.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToInt(CrossDirDataHistPO::getDelayTime) .mapToInt(CrossDirDataHistPO::getDelayTime)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.MAX_QUEUE_LENGTH.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.MAX_QUEUE_LENGTH.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDirDataHistPO::getQueueLength) .mapToDouble(CrossDirDataHistPO::getQueueLength)
.max() .max()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_TIMES.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_TIMES.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDirDataHistPO::getStopTimes) .mapToDouble(CrossDirDataHistPO::getStopTimes)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(v);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_SPEED.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_SPEED.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDirDataHistPO::getSpeed) .mapToDouble(CrossDirDataHistPO::getSpeed)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.GREEN_LIGHT_EFFICIENCY.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.GREEN_LIGHT_EFFICIENCY.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDirDataHistPO::getGreenLightEfficiency) .mapToDouble(CrossDirDataHistPO::getGreenLightEfficiency)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.SATURATION.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.SATURATION.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDirDataHistPO::getSturation) .mapToDouble(CrossDirDataHistPO::getSturation)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.FLOW.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.FLOW.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossDirDataHistPO::getFlow) .mapToDouble(CrossDirDataHistPO::getFlow)
.sum(); .sum();
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} }
// 排序用 // 排序用
...@@ -479,62 +479,62 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService { ...@@ -479,62 +479,62 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
.mapToDouble(CrossTurnDataHistPO::getNoStopRate) .mapToDouble(CrossTurnDataHistPO::getNoStopRate)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_RATE.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_RATE.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossTurnDataHistPO::getOneStopRate) .mapToDouble(CrossTurnDataHistPO::getOneStopRate)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_DELAY.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_DELAY.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToInt(CrossTurnDataHistPO::getDelayTime) .mapToInt(CrossTurnDataHistPO::getDelayTime)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.MAX_QUEUE_LENGTH.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.MAX_QUEUE_LENGTH.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossTurnDataHistPO::getQueueLength) .mapToDouble(CrossTurnDataHistPO::getQueueLength)
.max() .max()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_TIMES.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_TIMES.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossTurnDataHistPO::getStopTimes) .mapToDouble(CrossTurnDataHistPO::getStopTimes)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(v);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_SPEED.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_SPEED.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossTurnDataHistPO::getSpeed) .mapToDouble(CrossTurnDataHistPO::getSpeed)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.GREEN_LIGHT_EFFICIENCY.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.GREEN_LIGHT_EFFICIENCY.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossTurnDataHistPO::getGreenLightEfficiency) .mapToDouble(CrossTurnDataHistPO::getGreenLightEfficiency)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.SATURATION.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.SATURATION.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossTurnDataHistPO::getSturation) .mapToDouble(CrossTurnDataHistPO::getSturation)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.FLOW.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.FLOW.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossTurnDataHistPO::getFlow) .mapToDouble(CrossTurnDataHistPO::getFlow)
.sum(); .sum();
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} }
// 排序用 // 排序用
...@@ -599,62 +599,62 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService { ...@@ -599,62 +599,62 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
.mapToDouble(CrossLaneDataHistPOExt::getNoStopRate) .mapToDouble(CrossLaneDataHistPOExt::getNoStopRate)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_RATE.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_RATE.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossLaneDataHistPOExt::getOneStopRate) .mapToDouble(CrossLaneDataHistPOExt::getOneStopRate)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_DELAY.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_DELAY.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToInt(CrossLaneDataHistPOExt::getDelayTime) .mapToInt(CrossLaneDataHistPOExt::getDelayTime)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.MAX_QUEUE_LENGTH.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.MAX_QUEUE_LENGTH.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossLaneDataHistPOExt::getQueueLength) .mapToDouble(CrossLaneDataHistPOExt::getQueueLength)
.max() .max()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_TIMES.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.STOP_TIMES.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossLaneDataHistPOExt::getStopTimes) .mapToDouble(CrossLaneDataHistPOExt::getStopTimes)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(v);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_SPEED.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.AVERAGE_SPEED.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossLaneDataHistPOExt::getSpeed) .mapToDouble(CrossLaneDataHistPOExt::getSpeed)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.GREEN_LIGHT_EFFICIENCY.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.GREEN_LIGHT_EFFICIENCY.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossLaneDataHistPOExt::getGreenLightEfficiency) .mapToDouble(CrossLaneDataHistPOExt::getGreenLightEfficiency)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.SATURATION.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.SATURATION.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossLaneDataHistPOExt::getSturation) .mapToDouble(CrossLaneDataHistPOExt::getSturation)
.average() .average()
.orElse(0.0); .orElse(0.0);
int round = (int) (Math.round(v * 100)); double round = (double) (Math.round(v * 100));
vo.setValue(round); vo.setValue(round);
} else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.FLOW.getCode())) { } else if (Objects.equals(metricCode, StrategyAndMetricsEnum.Metrics.FLOW.getCode())) {
double v = filteredList.stream() double v = filteredList.stream()
.mapToDouble(CrossLaneDataHistPOExt::getFlow) .mapToDouble(CrossLaneDataHistPOExt::getFlow)
.sum(); .sum();
int round = (int) (Math.round(v)); double round = (double) (Math.round(v));
vo.setValue(round); vo.setValue(round);
} }
// 排序用 // 排序用
...@@ -1622,7 +1622,7 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService { ...@@ -1622,7 +1622,7 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
.mapToDouble(CrossDirDataHistPOExt::getStopTimes) .mapToDouble(CrossDirDataHistPOExt::getStopTimes)
.average() .average()
.orElse(0.0); .orElse(0.0);
dirValue = (int) Math.round(average); //dirValue = (int) Math.round(average);
} else if (Objects.equals(metricName, StrategyAndMetricsEnum.Metrics.AVERAGE_DELAY.getDescription())) { } else if (Objects.equals(metricName, StrategyAndMetricsEnum.Metrics.AVERAGE_DELAY.getDescription())) {
double average = crossDirDataHistPOList.stream() double average = crossDirDataHistPOList.stream()
.mapToDouble(CrossDirDataHistPOExt::getDelayTime) .mapToDouble(CrossDirDataHistPOExt::getDelayTime)
......
...@@ -20,7 +20,7 @@ public class MainlineEvaluateBottomCurveVO { ...@@ -20,7 +20,7 @@ public class MainlineEvaluateBottomCurveVO {
private String scopeName; private String scopeName;
@ApiModelProperty(value = "数值") @ApiModelProperty(value = "数值")
private Integer value; private Double value;
@ApiModelProperty(value = "指标时间戳") @ApiModelProperty(value = "指标时间戳")
private Long metricTimeStamp; private Long metricTimeStamp;
......
...@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import net.wanji.databus.config.DoubleToTwoDecimalPlacesSerializer;
import org.omg.CORBA.UNKNOWN; import org.omg.CORBA.UNKNOWN;
import java.util.Date; import java.util.Date;
...@@ -121,6 +123,7 @@ public class CrossDataRealtimePO { ...@@ -121,6 +123,7 @@ public class CrossDataRealtimePO {
* 停车次数(次) * 停车次数(次)
*/ */
@ApiModelProperty(value = "停车次数(次)", notes = "") @ApiModelProperty(value = "停车次数(次)", notes = "")
@JsonSerialize(using = DoubleToTwoDecimalPlacesSerializer.class)
private Double stopTimes; private Double stopTimes;
/** /**
* 延误时间(秒) * 延误时间(秒)
......
...@@ -3,9 +3,11 @@ package net.wanji.databus.po; ...@@ -3,9 +3,11 @@ package net.wanji.databus.po;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import net.wanji.databus.config.DoubleToTwoDecimalPlacesSerializer;
import java.util.Date; import java.util.Date;
...@@ -46,6 +48,7 @@ public class CrossDirDataRealtimePO { ...@@ -46,6 +48,7 @@ public class CrossDirDataRealtimePO {
@ApiModelProperty(name = "排队长度(米)",notes = "") @ApiModelProperty(name = "排队长度(米)",notes = "")
public Double queueLength; public Double queueLength;
@ApiModelProperty(name = "停车次数",notes = "") @ApiModelProperty(name = "停车次数",notes = "")
@JsonSerialize(using = DoubleToTwoDecimalPlacesSerializer.class)
public Double stopTimes; public Double stopTimes;
@ApiModelProperty(name = "延误时间",notes = "") @ApiModelProperty(name = "延误时间",notes = "")
public Integer delayTime; public Integer delayTime;
......
...@@ -2,9 +2,11 @@ package net.wanji.databus.po; ...@@ -2,9 +2,11 @@ package net.wanji.databus.po;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import net.wanji.databus.config.DoubleToTwoDecimalPlacesSerializer;
import java.util.Date; import java.util.Date;
...@@ -31,6 +33,7 @@ public class CrossLaneDataRealTimePO { ...@@ -31,6 +33,7 @@ public class CrossLaneDataRealTimePO {
@ApiModelProperty(name = "排队长度(米)",notes = "") @ApiModelProperty(name = "排队长度(米)",notes = "")
private Double queueLength; private Double queueLength;
@ApiModelProperty(name = "停车次数",notes = "") @ApiModelProperty(name = "停车次数",notes = "")
@JsonSerialize(using = DoubleToTwoDecimalPlacesSerializer.class)
private Double stopTimes; private Double stopTimes;
@ApiModelProperty(name = "延误时间",notes = "") @ApiModelProperty(name = "延误时间",notes = "")
private Integer delayTime; private Integer delayTime;
......
...@@ -3,9 +3,11 @@ package net.wanji.databus.po; ...@@ -3,9 +3,11 @@ package net.wanji.databus.po;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import net.wanji.databus.config.DoubleToTwoDecimalPlacesSerializer;
import java.util.Date; import java.util.Date;
...@@ -54,6 +56,7 @@ public class CrossTurnDataRealtimePO { ...@@ -54,6 +56,7 @@ public class CrossTurnDataRealtimePO {
public Double queueLength ; public Double queueLength ;
/** 停车次数(次) */ /** 停车次数(次) */
@ApiModelProperty(name = "停车次数(次)",notes = "") @ApiModelProperty(name = "停车次数(次)",notes = "")
@JsonSerialize(using = DoubleToTwoDecimalPlacesSerializer.class)
public Double stopTimes ; public Double stopTimes ;
/** 延误时间(秒) */ /** 延误时间(秒) */
@ApiModelProperty(name = "延误时间(秒)",notes = "") @ApiModelProperty(name = "延误时间(秒)",notes = "")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment