Commit dd90c153 authored by Zheng Yi Fan's avatar Zheng Yi Fan

Merge remote-tracking branch 'origin/master'

parents 5ef3e0a2 675afb1b
......@@ -160,7 +160,9 @@ public class TrendControllerV2 {
log.error("态势监测-事件告警-实时列表:", e);
JsonViewObject.newInstance().success(list);
}
List<OptMonitoringVO> collect = list.stream().filter(vo -> !StringUtils.equalsIgnoreCase("700", vo.getType())).collect(Collectors.toList());
List<OptMonitoringVO> collect = list.stream().
filter(vo -> !StringUtils.equalsIgnoreCase("700", vo.getType())
&& !StringUtils.equalsIgnoreCase("708", vo.getType())).collect(Collectors.toList());
return JsonViewObject.newInstance().success(collect);
}
......
......@@ -36,12 +36,14 @@ public class AnalysisProblemAreaDayController {
@GetMapping(value = "/overview")
@ApiImplicitParams({
@ApiImplicitParam(name = "areaId", value = "区域ID", required = true, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "timeType", value = "事件类型 1:近一个月 2:近一周", required = true, dataType = "int", defaultValue = "1"),
@ApiImplicitParam(name = "timeType", value = "事件类型 1:近一个月 2:近一周", required = false, dataType = "int", defaultValue = ""),
@ApiImplicitParam(name = "startTime", value = "开始时间", required = false, dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", required = false, dataType = "String"),
})
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = AreaProblemOverview.class),
})
public JsonViewObject areaProblemOverview(String timeType,String areaId) {
public JsonViewObject areaProblemOverview(String timeType,String areaId, String startTime, String endTime) {
return JsonViewObject.newInstance().success(null);
}
......@@ -51,7 +53,9 @@ public class AnalysisProblemAreaDayController {
@GetMapping(value = "/trend")
@ApiImplicitParams({
@ApiImplicitParam(name = "areaId", value = "区域ID", required = true, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "timeType", value = "事件类型 1:近一个月 2:近一周", required = true, dataType = "int", defaultValue = "1"),
@ApiImplicitParam(name = "timeType", value = "事件类型 1:近一个月 2:近一周", required = false, dataType = "int", defaultValue = ""),
@ApiImplicitParam(name = "startTime", value = "开始时间", required = false, dataType = "String", defaultValue = ""),
@ApiImplicitParam(name = "endTime", value = "结束时间", required = false, dataType = "String", defaultValue = ""),
})
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = AreaProblemTrendAnalysisResult.class),
......@@ -67,7 +71,9 @@ public class AnalysisProblemAreaDayController {
@ApiImplicitParams({
@ApiImplicitParam(name = "eventType", value = "事件代码 701:路口空放 702:路口失衡,703:路口溢出 707:路口拥堵", required = true, dataType = "String", defaultValue = ""),
@ApiImplicitParam(name = "areaId", value = "区域ID", required = true, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "timeType", value = "事件类型 1:近一个月 2:近一周", required = true, dataType = "int", defaultValue = "1"),
@ApiImplicitParam(name = "timeType", value = "事件类型 1:近一个月 2:近一周", required = false, dataType = "int", defaultValue = ""),
@ApiImplicitParam(name = "startTime", value = "开始时间", required = false, dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", required = false, dataType = "String"),
})
@GetMapping(value = "/cross-problem-number")
......@@ -84,7 +90,9 @@ public class AnalysisProblemAreaDayController {
@ApiImplicitParams({
@ApiImplicitParam(name = "eventType", value = "事件代码 705:干线缓行 706:干线拥堵 ", required = true, dataType = "String", defaultValue = ""),
@ApiImplicitParam(name = "areaId", value = "区域ID", required = true, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "timeType", value = "事件类型 1:近一个月 2:近一周", required = true, dataType = "int", defaultValue = "1"),
@ApiImplicitParam(name = "timeType", value = "事件类型 1:近一个月 2:近一周", required = false, dataType = "int", defaultValue = ""),
@ApiImplicitParam(name = "startTime", value = "开始时间", required = false, dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", required = false, dataType = "String"),
})
@GetMapping(value = "/green-problem-number")
@ApiResponses({
......
......@@ -361,15 +361,19 @@ public class TrendServiceV2Impl implements TrendServiceV2 {
private String getOptGreenResult(String id, StringBuilder sb) {
String result = "";
List<GreenLastOptResultDTO> greenLastOptResultDTOS = strategyGreenOptHistMapper.selectLastGreenOptResultList();
for (GreenLastOptResultDTO dto : greenLastOptResultDTOS) {
if (StringUtils.endsWithIgnoreCase(id, String.valueOf(dto.getGreenId()))) {
Integer controlMethod = dto.getControlMethod();
if (0 >= controlMethod) {
sb.append("动态绿波").append("-").append("均衡调控").append("-").append("神思策略");
} else {
sb.append("均衡调控").append("-").append("专家方案");
if (!CollectionUtils.isEmpty(greenLastOptResultDTOS)) {
for (GreenLastOptResultDTO dto : greenLastOptResultDTOS) {
if (StringUtils.endsWithIgnoreCase(id, String.valueOf(dto.getGreenId()))) {
Integer controlMethod = dto.getControlMethod();
if (controlMethod >= 0) {
sb.append("动态绿波").append("-").append("均衡调控").append("-").append("神思策略");
} else {
sb.append("均衡调控").append("-").append("专家方案");
}
}
}
} else {
sb.append("动态绿波-专家方案");
}
result = sb.toString();
return result;
......
......@@ -40,10 +40,14 @@ public class TrunkLineImpl implements TrunkLineService {
vo.setCrossID(e.getCrossID());
vo.setName(e.getName());
vo.setWkt(e.getWkt());
if (e.getDirection() != null) {
String temp = e.getDirection().substring(1, e.getDirection().length() - 1);
temp = temp.replace("\"", "");
String[] temp1 = temp.split(",");
Map<String, Integer> directionMap = new HashMap<>();
for (String s : e.getDirection()) {
for (String s : temp1) {
directionMap.put(s, directionMap.getOrDefault(s, 0) + 1);
}
......
......@@ -9,6 +9,7 @@ public class TrunkLineCrossProblemEntity {
private Integer inDir;
private Integer outDir;
private Integer status;
private String[] direction;
private String direction;
private String startTime;
private String wkt;
}
......@@ -23,6 +23,7 @@ public class TrunkLineCrossProblemVO {
private String dir_1_name;
@ApiModelProperty(value = "方向2")
private String dir_2_name;
@ApiModelProperty(value = "路口坐标")
private String wkt;
}
......@@ -62,15 +62,18 @@
<select id="getCrossRealTimeAlarms" parameterType="String" resultMap="CrossRealTimeAlarmsResultMap">
select
a.type ,
MAX(a.start_time) as startTime ,
a.start_time startTime ,
SUBSTR(a.dir, 2, length(a.dir)-2) as dir
from
t_event_info a
where 1=1
and a.start_time = (select MAX(start_time) from t_event_info
where cross_id = #{crossID}
<if test="time != null and time != ''">
and start_time <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s')
</if>
)
and a.cross_id = #{crossID}
<if test="time != null and time != ''">
and a.start_time <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s')
</if>
union
select
'' as type,
......
......@@ -74,30 +74,17 @@
) b
</select>
<select id="getTrunkLineCrossProblem" parameterType="map" resultType="net.wanji.opt.synthesis.pojo.TrunkLineCrossProblemEntity">
select
a.cross_id,
b.name,
a.`status`,
a.direction ,
MAX(a.start_time) as start_time
from
t_cross_data_hist a
left join t_base_cross_info b on
a.cross_id = b.id
where
select a.cross_id,b.name,SUBSTR(b.location , 7 , LENGTH(b.location) - 7) as wkt,a.status,a.direction , a.start_time
from t_cross_data_hist a
left join t_base_cross_info b on a.cross_id = b.id
where a.cross_id in (select cross_id from t_greenwave_cross where green_id = #{greenID})
<if test="time == null or time == '' ">
and DATE_FORMAT(a.start_time, '%Y-%m-%d %H:%i:00')= DATE_FORMAT(FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(DATE_SUB(now(),INTERVAL 5 MINUTE)) / 300 ) * 300), '%Y-%m-%d %H:%i:00')
</if>
<if test="time != null and time != '' ">
and DATE_FORMAT(a.start_time, '%Y-%m-%d %H:%i:00')= DATE_FORMAT(FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(#{time}) / 300 ) * 300), '%Y-%m-%d %H:%i:00')
</if>
a.cross_id in (
select
cross_id
from
t_greenwave_cross
where
green_id = #{greenID})
<if test="time != null and time != ''">
and DATE_FORMAT(a.start_time, '%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s')
</if>
group by
a.cross_id
</select>
<select id="getIODir" parameterType="map" resultType="net.wanji.opt.synthesis.pojo.TrunkLineCrossProblemEntity">
select
......
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