Commit 227f6697 authored by chenhao's avatar chenhao

添加警情预案的消息推送

parent c96555c1
......@@ -5,8 +5,6 @@ import static org.hamcrest.CoreMatchers.nullValue;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -130,6 +128,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
private long time;
@Value("${mqtt.topic.command.power.deployment}")
private String topic1;
@Value("${mqtt.topic.command.knowledgebase.alert.match}")
private String topicMatch;
@Autowired
private OrgUsrServiceImpl iOrgUsrService;
......@@ -971,6 +972,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@SuppressWarnings("unchecked")
public Object toCompletePoliceSituationMatch(Long id) throws Exception{
Object result=null;;
AlertCalledFormDto dto = (AlertCalledFormDto) selectAlertCalledByIdNoRedis(id);
AlertCalled alertCalled = dto.getAlertCalled();
List<FormValue> list = dto.getDynamicFormAlert();
......@@ -984,9 +986,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
break;
}
}
return getIdsList1( alertCalled.getAlertTypeCode() ,AlertStageEnums.救援预案警情类型.getValue() + "," + condition1,
result= getIdsList1( alertCalled.getAlertTypeCode() ,AlertStageEnums.救援预案警情类型.getValue() + "," + condition1,
AlertStageEnums.责任单位.getValue() + "," + condition2,
AlertStageEnums.重点部位名称.getValue() + "," + condition3);
//
} else if (alertCalled.getAlertTypeCode().equals(AlertStageEnums.HKJY.getCode())) {
String condition1 = alertCalled.getAlertType();// 航空器救援
String condition2 = "";
......@@ -995,12 +1000,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
condition2 = condition1 + i.getValue();
}
}
return getIdsList1(alertCalled.getAlertTypeCode(),AlertStageEnums.救援预案警情类型.getValue() + "," + condition1,
result= getIdsList1(alertCalled.getAlertTypeCode(),AlertStageEnums.救援预案警情类型.getValue() + "," + condition1,
AlertStageEnums.航空器救援子类.getValue() + "," + condition2, null);
} else {
String condition1 = alertCalled.getAlertType();
return getIdsList1(alertCalled.getAlertTypeCode(),AlertStageEnums.救援预案警情类型.getValue() + "," + condition1, null, null);
result= getIdsList1(alertCalled.getAlertTypeCode(),AlertStageEnums.救援预案警情类型.getValue() + "," + condition1, null, null);
}
emqKeeper.getMqttClient().publish(topicMatch, result.toString().getBytes(), RuleConfig.DEFAULT_QOS, true);
return result;
}
// private List<Map<String, Object>> getIdsList(String condition1, String condition2, String condition3) {
......
......@@ -65,7 +65,8 @@ mqtt.topic.command.power.deployment=power
mqtt.topic.alert.iot=iot-system-alarm
mqtt.topic.alert.iot.web=iot-system-alarm-web
#警情预案匹配的消息topic名称
mqtt.topic.command.knowledgebase.alert.match=knowledgebaseAlertMatch
security.systemctl.name=AMOS-API-SYSTEMCTL
......
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