Commit 0ccb6829 authored by hanbing's avatar hanbing

[add] 新信号评价-方案评价-效率提升策略总体评价

parent 88b04a94
......@@ -14,6 +14,9 @@ import java.util.Date;
@Data
@ApiModel(value = "SchemeDetailOverallBO", description = "方案详情-总体评价入参")
public class SchemeDetailOverallBO {
@ApiModelProperty(value = "路口ID")
private String crossId;
@ApiModelProperty(value = "年月日,格式 2023/7/9")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/M/d", timezone = "GMT+8")
private Date problemDate;
......@@ -24,6 +27,6 @@ public class SchemeDetailOverallBO {
@ApiModelProperty(value = "结束时间 HH:mm")
String endTime;
@ApiModelProperty(value = "策略编号")
@ApiModelProperty(value = "策略编号 100030均衡调控 100152效率提升 100010安全保障")
String strategyCode;
}
......@@ -8,9 +8,11 @@ import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.bo.CrossIdBO;
import net.wanji.opt.bo.CrossSchemeListBO;
import net.wanji.opt.bo.ProblemSchemeBO;
import net.wanji.opt.bo.SchemeDetailOverallBO;
import net.wanji.opt.service.impl.SchemeEvaluateServiceImpl;
import net.wanji.opt.vo.SchemeEvaluateCrossSchemeListVO;
import net.wanji.opt.vo.SchemeEvaluateProblemSchemeVO;
import net.wanji.opt.vo.SchemeEvaluateSchemeDetailOverallVO;
import net.wanji.opt.vo.SchemeEvaluateStrategyMetricMenuVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -18,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.ws.rs.core.MediaType;
import java.text.ParseException;
import java.util.List;
/**
......@@ -71,16 +74,17 @@ public class SchemeEvaluateController {
return JsonViewObject.newInstance().success(res);
}
// @ApiOperation(value = "方案详情-总体评价", notes = "方案详情-总体评价", response = JsonViewObject.class,
// produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
// @PostMapping(value = "/schemeDetailOverall",
// produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
// @ApiResponses({
// @ApiResponse(code = 200, message = "OK", response = SchemeEvaluateSchemeDetailOverallVO.class),
// })
// public JsonViewObject schemeDetailOverall(@RequestBody SchemeDetailOverallBO schemeDetailOverallBO) {
// SchemeEvaluateSchemeDetailOverallVO res = schemeEvaluateService.schemeDetailOverall(schemeDetailOverallBO);
// return JsonViewObject.newInstance().success(res);
// }
@ApiOperation(value = "方案详情-总体评价", notes = "方案详情-总体评价", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/schemeDetailOverall",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = SchemeEvaluateSchemeDetailOverallVO.class),
})
public JsonViewObject schemeDetailOverall(@RequestBody SchemeDetailOverallBO schemeDetailOverallBO)
throws ParseException {
SchemeEvaluateSchemeDetailOverallVO res = schemeEvaluateService.schemeDetailOverall(schemeDetailOverallBO);
return JsonViewObject.newInstance().success(res);
}
}
\ No newline at end of file
......@@ -3,10 +3,13 @@ package net.wanji.opt.service;
import net.wanji.databus.bo.CrossIdBO;
import net.wanji.opt.bo.CrossSchemeListBO;
import net.wanji.opt.bo.ProblemSchemeBO;
import net.wanji.opt.bo.SchemeDetailOverallBO;
import net.wanji.opt.vo.SchemeEvaluateCrossSchemeListVO;
import net.wanji.opt.vo.SchemeEvaluateProblemSchemeVO;
import net.wanji.opt.vo.SchemeEvaluateSchemeDetailOverallVO;
import net.wanji.opt.vo.SchemeEvaluateStrategyMetricMenuVO;
import java.text.ParseException;
import java.util.List;
public interface SchemeEvaluateService {
......@@ -15,4 +18,6 @@ public interface SchemeEvaluateService {
List<SchemeEvaluateStrategyMetricMenuVO> strategyMetricMenu(CrossIdBO crossIdBO);
List<SchemeEvaluateCrossSchemeListVO> crossSchemeList(CrossSchemeListBO crossSchemeListBO);
SchemeEvaluateSchemeDetailOverallVO schemeDetailOverall(SchemeDetailOverallBO schemeDetailOverallBO) throws ParseException;
}
......@@ -19,7 +19,7 @@ public class SchemeEvaluateSchemeDetailOverallVO {
String serviceLevel;
@ApiModelProperty(value = "策略评价")
List<String> strategyEvaluate;
List<String> strategyEvaluateList;
@ApiModelProperty(value = "指标数据")
List<OverallMetrics> overallMetricsList;
......@@ -34,7 +34,7 @@ public class SchemeEvaluateSchemeDetailOverallVO {
String metricName;
@ApiModelProperty(value = "指标数值")
String metricValue;
Integer metricValue;
@ApiModelProperty(value = "指标数值单位")
String metricUnit;
......
......@@ -124,7 +124,7 @@ public class BaseEnum {
private String nick;
public static SignalDirectionEnum getNameByCode(int code) {
public static SignalDirectionEnum getNickByCode(int code) {
for (SignalDirectionEnum signalDirectionEnum : SignalDirectionEnum.values()) {
if (signalDirectionEnum.getCode() == code) {
return signalDirectionEnum;
......@@ -133,6 +133,15 @@ public class BaseEnum {
return null;
}
public static String getNameByCode(int code) {
for (SignalDirectionEnum signalDirectionEnum : SignalDirectionEnum.values()) {
if (signalDirectionEnum.getCode() == code) {
return signalDirectionEnum.getName();
}
}
return null;
}
public static SignalDirectionEnum getNameByNick(String nick) {
for (SignalDirectionEnum signalDirectionEnum : SignalDirectionEnum.values()) {
if (signalDirectionEnum.getNick().equals(nick)) {
......
......@@ -35,25 +35,28 @@ public class StrategyAndMetricsEnum {
}
public enum Metrics {
NO_STOP_THROUGH_RATE(1, "不停车通过率"),
STOP_THROUGH_RATE(2, "一/二/三次及以上停车通过率"),
AVERAGE_DELAY(3, "平均延误"),
MAX_QUEUE_LENGTH(4, "最大排队长度"),
STOP_COUNT(5, "停车次数"),
AVERAGE_SPEED(6, "平均速度"),
GREEN_LIGHT_UTILIZATION(7, "绿灯有效利用率"),
SATURATION(8, "饱和度"),
LOAD_BALANCE(9, "负载均衡度"),
OVERFLOW_RATE(10, "溢流率"),
GREEN_INTERVAL_CLEAR(11, "绿灯间隔清空率"),
EMERGENCY_COUNT(12, "三急一速数量");
NO_STOP_THROUGH_RATE(1, "不停车通过率", "%"),
STOP_THROUGH_RATE(2, "一/二/三次及以上停车通过率", "%"),
AVERAGE_DELAY(3, "平均延误", "s"),
MAX_QUEUE_LENGTH(4, "最大排队长度", "m"),
STOP_COUNT(5, "停车次数", "次"),
AVERAGE_SPEED(6, "平均速度", "km/h"),
GREEN_LIGHT_UTILIZATION(7, "绿灯有效利用率", "%"),
SATURATION(8, "饱和度", ""),
LOAD_BALANCE(9, "负载均衡度", ""),
OVERFLOW_RATE(10, "溢流率", "%"),
GREEN_INTERVAL_CLEAR(11, "绿灯间隔清空率", "%"),
EMERGENCY_COUNT(12, "三急一速数量", "");
private final Integer code;
private final String description;
private final String unit;
Metrics(Integer code, String description) {
Metrics(Integer code, String description, String unit) {
this.code = code;
this.description = description;
this.unit = unit;
}
public String getDescription() {
......@@ -63,6 +66,10 @@ public class StrategyAndMetricsEnum {
public Integer getCode() {
return code;
}
public String getUnit() {
return unit;
}
}
public static final Map<Strategy, List<Metrics>> STRATEGY_METRICS_MAP;
......
......@@ -34,4 +34,10 @@ public interface CrossDirDataHistMapper extends BaseMapper<CrossDirDataHistPO> {
List<CrossDirDataHistPO> selectPhaseQueueEnd(String crossId, Integer dir, long currentSeconds, long preSeconds);
List<MetricHistDTO> selectMetricHistDTO(String crossId, int startStamp, int endStamp);
List<CrossDirDataHistPO> selectByCrossIdAndStartEnd(String crossId, int startStamp, int endStamp);
Double selectAvgDelayTime(String crossId, Integer dirType, Integer inOutType, int startStamp, int endStamp);
Double selectAvgQueueLength(String crossId, Integer dirType, Integer inOutType, int startStamp, int endStamp);
}
......@@ -119,4 +119,28 @@
order by batch_time
</select>
<select id="selectByCrossIdAndStartEnd" resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <include refid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select>
<select id="selectAvgDelayTime" resultType="java.lang.Double">
select avg(delay_time)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select>
<select id="selectAvgQueueLength" resultType="java.lang.Double">
select avg(queue_length)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select>
</mapper>
\ No newline at end of file
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