Commit f28ed374 authored by 高东东's avatar 高东东

修改动态预案

parent 9d09c034
...@@ -673,9 +673,6 @@ public class ContingencyAction implements CustomerAction { ...@@ -673,9 +673,6 @@ public class ContingencyAction implements CustomerAction {
content.put("stepCode", stepCode); content.put("stepCode", stepCode);
content.put("buttonCode", buttonCode); content.put("buttonCode", buttonCode);
result.add(tempmap1);
DeviceRo ro = (DeviceRo)paramObj; DeviceRo ro = (DeviceRo)paramObj;
Map<String, Object> equipemtnPoints = pointCache.get(ro.getEquipmentId()); Map<String, Object> equipemtnPoints = pointCache.get(ro.getEquipmentId());
if (ObjectUtils.isEmpty(equipemtnPoints)) { if (ObjectUtils.isEmpty(equipemtnPoints)) {
...@@ -684,8 +681,8 @@ public class ContingencyAction implements CustomerAction { ...@@ -684,8 +681,8 @@ public class ContingencyAction implements CustomerAction {
equipemtnPoints.put(stepCode+"-"+buttonCode, content); equipemtnPoints.put(stepCode+"-"+buttonCode, content);
tempmap1.put("type", "buttonCache"); tempmap1.put("type", "buttonCache");
tempmap1.put("content", equipemtnPoints.values()); tempmap1.put("content", equipemtnPoints.values());
result.add(tempmap1);
this.sendcmd("message", null, result); this.sendcmd("message", ro, result);
} }
@RuleMethod(methodLabel = "清除步骤执行", project = "青海换流站消防预案") @RuleMethod(methodLabel = "清除步骤执行", project = "青海换流站消防预案")
...@@ -712,11 +709,9 @@ public class ContingencyAction implements CustomerAction { ...@@ -712,11 +709,9 @@ public class ContingencyAction implements CustomerAction {
} else { } else {
tempmap1.put("content", new ArrayList()); tempmap1.put("content", new ArrayList());
} }
tempmap1.put("content", equipemtnPoints.values());
result.add(tempmap1); result.add(tempmap1);
this.sendcmd("message", paramObj, result); this.sendcmd("message", ro, result);
} }
@RuleMethod(methodLabel = "同步自动执行步骤", project = "青海换流站消防预案") @RuleMethod(methodLabel = "同步自动执行步骤", project = "青海换流站消防预案")
...@@ -734,6 +729,25 @@ public class ContingencyAction implements CustomerAction { ...@@ -734,6 +729,25 @@ public class ContingencyAction implements CustomerAction {
this.sendcmd("message", paramObj, result); this.sendcmd("message", paramObj, result);
} }
public void sendcmd(String msgType, DeviceRo deviceRo, SafteyPlanResult result) {
Constructor<?> constructor;
try {
constructor = Class.forName(
PACKAGEURL + result.getClass().getSimpleName() + "Message")
.getConstructor(ActionResult.class);
AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result);
if ("mqtt".equals(pushType.toLowerCase())) {
ToipResponse toipResponse = action.buildResponse(msgType, deviceRo, result.toJson());
String topic = String.format("/%s/%s/%s", serviceName, "yinan","plan");
log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr()));
webMqttComponent.publish(topic, toipResponse.toJsonStr());
} else if ("websocket".equals(pushType.toLowerCase())){
action.execute(msgType, deviceRo);
}
} catch (Exception e) {
e.printStackTrace();
}
}
private void stopSnapshop(ContingencyRo contingencyRo) { private void stopSnapshop(ContingencyRo contingencyRo) {
if (RuleRunigSnapshotServiceImpl.getReplayBatchNo() != null && !RuleRunigSnapshotServiceImpl.getReplayBatchNo().equals(contingencyRo.getBatchNo())) if (RuleRunigSnapshotServiceImpl.getReplayBatchNo() != null && !RuleRunigSnapshotServiceImpl.getReplayBatchNo().equals(contingencyRo.getBatchNo()))
......
...@@ -71,6 +71,8 @@ public class ContingencyRo implements Serializable { ...@@ -71,6 +71,8 @@ public class ContingencyRo implements Serializable {
private String buttonState; private String buttonState;
@Label("步骤状态") @Label("步骤状态")
private String stepState;//步骤操作状态 private String stepState;//步骤操作状态
@Label("重点设备编码")
private String equipmentCode;
private Date createDate = new Date(); private Date createDate = new Date();
......
...@@ -538,6 +538,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -538,6 +538,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
contingencyRo.setFireTruckRoute(equipment.getFireTruckRoute()); contingencyRo.setFireTruckRoute(equipment.getFireTruckRoute());
contingencyRo.setRunstep(false); contingencyRo.setRunstep(false);
contingencyRo.setEquipmentPosition3d(equipment.getPosition3d()); contingencyRo.setEquipmentPosition3d(equipment.getPosition3d());
contingencyRo.setEquipmentCode(equipment.getCode());
Map cameraInfo = impAndFireEquipMapper.queryForCamera(String.valueOf(equipment.getId())); Map cameraInfo = impAndFireEquipMapper.queryForCamera(String.valueOf(equipment.getId()));
......
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