Commit b859189e authored by zhoushiguang's avatar zhoushiguang

路口异常状态增加方向

parent 0b7b8298
package net.wanji.opt.entity;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
......@@ -278,20 +278,24 @@ public class EventServiceImpl implements EventService {
if (Objects.nonNull(dir)) {
List<Integer> dirJsonArray = JSONArray.parseArray(dir, Integer.class);
dirJsonArray = dirJsonArray.stream().distinct().collect(Collectors.toList());
//dirJsonArray = dirJsonArray.stream().distinct().collect(Collectors.toList());
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(info.getCurrentAlgo() + "发生方向:");
if (Objects.nonNull(turn)) {
//有方向、有转向
List<Integer> turnJsonArray = JSONArray.parseArray(turn, Integer.class);
turnJsonArray = turnJsonArray.stream().distinct().collect(Collectors.toList());
//turnJsonArray = turnJsonArray.stream().distinct().collect(Collectors.toList());
for (int i = 0; i < dirJsonArray.size(); i++) {
String dirName = BaseEnum.SignalDirectionEnum.getNameByCode(Integer.valueOf(dirJsonArray.get(i))) + "进口";
String turnName = BaseEnum.TurnTypeEnum.getNameByCode(turnJsonArray.get(i));
String desc = info.getCurrentAlgo() + " 发生方向:" + dirName + turnName;
String desc = dirName + turnName;
if (stringBuilder.indexOf(desc)>0){
continue;
}
if (i != dirJsonArray.size()) {
stringBuilder.append(desc);
stringBuilder.append(";");
stringBuilder.append("");
} else {
stringBuilder.append(desc);
}
......@@ -300,9 +304,12 @@ public class EventServiceImpl implements EventService {
//只有方向
for (int i = 0; i < dirJsonArray.size(); i++) {
String dirName = BaseEnum.SignalDirectionEnum.getNameByCode(Integer.valueOf(dirJsonArray.get(i))) + "进口";
if (stringBuilder.indexOf(dirName)>0){
continue;
}
if (i != dirJsonArray.size()) {
stringBuilder.append(dirName);
stringBuilder.append(";");
stringBuilder.append("");
} else {
stringBuilder.append(dirName);
}
......
......@@ -119,7 +119,7 @@
<!-- 查询路口未结束的报警状态 -->
<select id="findNotFinishAlarmInfo" parameterType="String" resultMap="eventAlarm">
select
DISTINCT
DISTINCT a.type as event_type,
case when a.type=701 then 5 when a.type=702 then 1 when a.type=703 then 3 when a.type=707 then 2 else ifnull(a.type,0) end as status,
c.id as cross_id,
c.name as cross_name ,
......@@ -127,7 +127,8 @@
SUBSTRING(c.location FROM 7 FOR 20) as wkt,
ifnull(a.alarm_status,-1) alarm_status,
a.opt_status,
dir
dir,
turn
from t_base_cross_info c
left join (select * from t_event_info where dt = DATE_FORMAT(NOW(),'%Y%m%d') and type in (701,702,703,707) and alarm_status in (0,1,2)) a on a.cross_id = c.id
left join (select a.event_type, a.label from t_config_event_category a where a.category = 4) b on a.type = b.event_type
......
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