Commit 7e56a7ab authored by maoying's avatar maoying

修改消息地址配置

parent 23b48e7f
...@@ -38,7 +38,6 @@ import com.yeejoin.amos.fas.business.action.model.ContingencyEvent; ...@@ -38,7 +38,6 @@ import com.yeejoin.amos.fas.business.action.model.ContingencyEvent;
import com.yeejoin.amos.fas.business.action.model.ContingencyRo; import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import com.yeejoin.amos.fas.business.action.model.DeviceRo; import com.yeejoin.amos.fas.business.action.model.DeviceRo;
import com.yeejoin.amos.fas.business.action.model.SetpEnum; import com.yeejoin.amos.fas.business.action.model.SetpEnum;
import com.yeejoin.amos.fas.business.action.mq.StationEnum;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.result.ActionResult; import com.yeejoin.amos.fas.business.action.result.ActionResult;
import com.yeejoin.amos.fas.business.action.result.SafteyPlanResult; import com.yeejoin.amos.fas.business.action.result.SafteyPlanResult;
...@@ -76,6 +75,9 @@ public class ContingencyAction implements CustomerAction { ...@@ -76,6 +75,9 @@ public class ContingencyAction implements CustomerAction {
@Value("${spring.application.name}") @Value("${spring.application.name}")
private String serviceName; private String serviceName;
@Value("${station.name}")
private String stationName;
@Autowired @Autowired
private IContingencyInstance iContingencyInstance; private IContingencyInstance iContingencyInstance;
...@@ -182,7 +184,7 @@ public class ContingencyAction implements CustomerAction { ...@@ -182,7 +184,7 @@ public class ContingencyAction implements CustomerAction {
AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result); AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result);
if ("mqtt".equals(pushType.toLowerCase())) { if ("mqtt".equals(pushType.toLowerCase())) {
ToipResponse toipResponse = action.buildResponse(msgType, contingency, result.toJson()); ToipResponse toipResponse = action.buildResponse(msgType, contingency, result.toJson());
String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"plan"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"plan");
log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr())); log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr()));
webMqttComponent.publish(topic, toipResponse.toJsonStr()); webMqttComponent.publish(topic, toipResponse.toJsonStr());
...@@ -745,7 +747,7 @@ public class ContingencyAction implements CustomerAction { ...@@ -745,7 +747,7 @@ public class ContingencyAction implements CustomerAction {
AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result); AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result);
if ("mqtt".equals(pushType.toLowerCase())) { if ("mqtt".equals(pushType.toLowerCase())) {
ToipResponse toipResponse = action.buildResponse(msgType, deviceRo, result.toJson()); ToipResponse toipResponse = action.buildResponse(msgType, deviceRo, result.toJson());
String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"plan"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"plan");
log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr())); log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr()));
webMqttComponent.publish(topic, toipResponse.toJsonStr()); webMqttComponent.publish(topic, toipResponse.toJsonStr());
......
...@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component; ...@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component;
import com.yeejoin.amos.component.rule.MethodParam; import com.yeejoin.amos.component.rule.MethodParam;
import com.yeejoin.amos.component.rule.RuleActionBean; import com.yeejoin.amos.component.rule.RuleActionBean;
import com.yeejoin.amos.component.rule.RuleMethod; import com.yeejoin.amos.component.rule.RuleMethod;
import com.yeejoin.amos.fas.business.action.mq.StationEnum;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.result.ActionResult; import com.yeejoin.amos.fas.business.action.result.ActionResult;
import com.yeejoin.amos.fas.business.action.result.BubbleTipResult; import com.yeejoin.amos.fas.business.action.result.BubbleTipResult;
...@@ -42,6 +41,9 @@ public class RiskSituationAction implements CustomerAction ...@@ -42,6 +41,9 @@ public class RiskSituationAction implements CustomerAction
@Value("${spring.application.name}") @Value("${spring.application.name}")
private String serviceName; private String serviceName;
@Value("${station.name}")
private String stationName;
@RuleMethod(methodLabel = "气泡提示", project = "换流站消防专项预案") @RuleMethod(methodLabel = "气泡提示", project = "换流站消防专项预案")
public void sendBubbleTip(@MethodParam(paramLabel = "bizobj对象") Object bizobj, public void sendBubbleTip(@MethodParam(paramLabel = "bizobj对象") Object bizobj,
@MethodParam(paramLabel = "是否显示名称") Boolean showInfo, @MethodParam(paramLabel = "是否显示名称") Boolean showInfo,
...@@ -70,7 +72,7 @@ public class RiskSituationAction implements CustomerAction ...@@ -70,7 +72,7 @@ public class RiskSituationAction implements CustomerAction
String msgType = "bubbleTip"; String msgType = "bubbleTip";
if ("mqtt".equals(pushType.toLowerCase())) { if ("mqtt".equals(pushType.toLowerCase())) {
ToipResponse toipResponse = action.buildResponse(msgType, bizobj, result); ToipResponse toipResponse = action.buildResponse(msgType, bizobj, result);
String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"rule"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"rule");
webMqttComponent.publish(topic, toipResponse.toJsonStr()); webMqttComponent.publish(topic, toipResponse.toJsonStr());
} else { } else {
Object obj = action.execute(msgType, bizobj); Object obj = action.execute(msgType, bizobj);
......
...@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.yeejoin.amos.fas.business.action.el.ELEvaluationContext; import com.yeejoin.amos.fas.business.action.el.ELEvaluationContext;
import com.yeejoin.amos.fas.business.action.mq.StationEnum;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.result.ActionResult; import com.yeejoin.amos.fas.business.action.result.ActionResult;
import com.yeejoin.amos.fas.business.action.result.TipResult; import com.yeejoin.amos.fas.business.action.result.TipResult;
...@@ -43,6 +42,10 @@ public class SimpleTipAction implements CustomerAction ...@@ -43,6 +42,10 @@ public class SimpleTipAction implements CustomerAction
@Value("${spring.application.name}") @Value("${spring.application.name}")
private String serviceName; private String serviceName;
@Value("${station.name}")
private String stationName;
//@ExposeAction("消息提示") //@ExposeAction("消息提示")
public void sendMessageTip(Object bizobj, String title, String content, String type) public void sendMessageTip(Object bizobj, String title, String content, String type)
{ {
...@@ -68,7 +71,7 @@ public class SimpleTipAction implements CustomerAction ...@@ -68,7 +71,7 @@ public class SimpleTipAction implements CustomerAction
String msgType = "message"; String msgType = "message";
if ("mqtt".equals(pushType.toLowerCase())) { if ("mqtt".equals(pushType.toLowerCase())) {
ToipResponse toipResponse = action.buildResponse(msgType, bizobj, result); ToipResponse toipResponse = action.buildResponse(msgType, bizobj, result);
String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"rule"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"rule");
webMqttComponent.publish(topic, toipResponse.toJsonStr()); webMqttComponent.publish(topic, toipResponse.toJsonStr());
} else { } else {
action.execute(msgType, bizobj); action.execute(msgType, bizobj);
......
package com.yeejoin.amos.fas.business.action.mq;
public enum StationEnum {
YINAN("yinan", "沂南站");
String code;
String desc;
private StationEnum(String code, String desc) {
this.desc = desc;
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
...@@ -25,7 +25,6 @@ import com.yeejoin.amos.fas.business.action.ContingencyAction; ...@@ -25,7 +25,6 @@ import com.yeejoin.amos.fas.business.action.ContingencyAction;
import com.yeejoin.amos.fas.business.action.model.ContingencyEvent; import com.yeejoin.amos.fas.business.action.model.ContingencyEvent;
import com.yeejoin.amos.fas.business.action.model.ContingencyRo; import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import com.yeejoin.amos.fas.business.action.model.SetpEnum; import com.yeejoin.amos.fas.business.action.model.SetpEnum;
import com.yeejoin.amos.fas.business.action.mq.StationEnum;
import com.yeejoin.amos.fas.business.action.util.ContingencyLogPublisher; import com.yeejoin.amos.fas.business.action.util.ContingencyLogPublisher;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper; import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper; import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper;
...@@ -66,6 +65,10 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla ...@@ -66,6 +65,10 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
@Autowired @Autowired
private IContingencyInstance iContingencyInstance; private IContingencyInstance iContingencyInstance;
@Value("${station.name}")
private String stationName;
private static Map<String, String> stepMap = new HashMap<>(); private static Map<String, String> stepMap = new HashMap<>();
...@@ -213,7 +216,7 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla ...@@ -213,7 +216,7 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
json.put("msgType", "message"); json.put("msgType", "message");
json.put("msgContext", msgContext); json.put("msgContext", msgContext);
event.setMsgBody(json.toJSONString()); event.setMsgBody(json.toJSONString());
String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"plan"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"plan");
event.setTopic(topic); event.setTopic(topic);
event.setMsgType("clickEvent"); event.setMsgType("clickEvent");
event.setContingency(batchNo); event.setContingency(batchNo);
......
package com.yeejoin.amos.fas.business.service.impl; package com.yeejoin.amos.fas.business.service.impl;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.ArrayUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -10,12 +33,15 @@ import com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo; ...@@ -10,12 +33,15 @@ import com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo;
import com.yeejoin.amos.fas.business.action.model.SetpEnum; import com.yeejoin.amos.fas.business.action.model.SetpEnum;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe; import com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe;
import com.yeejoin.amos.fas.business.bo.JpushMsgBo; import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper;
import com.yeejoin.amos.fas.business.bo.MsgParamBo; import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.*; import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaEquipmentPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaPointInputitemMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao; import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao;
import com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao; import com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao; import com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService; import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.param.AlarmParam; import com.yeejoin.amos.fas.business.param.AlarmParam;
...@@ -25,28 +51,21 @@ import com.yeejoin.amos.fas.business.service.intfc.IView3dService; ...@@ -25,28 +51,21 @@ import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.business.util.JexlUtil; import com.yeejoin.amos.fas.business.util.JexlUtil;
import com.yeejoin.amos.fas.business.util.RpnUtils; import com.yeejoin.amos.fas.business.util.RpnUtils;
import com.yeejoin.amos.fas.business.util.StringUtil; import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.business.vo.*; import com.yeejoin.amos.fas.business.vo.EquipmentSpecificForRiskVo;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.business.vo.Toke;
import com.yeejoin.amos.fas.business.vo.TopicEntityVo;
import com.yeejoin.amos.fas.client.invoke.RsDataQueue; import com.yeejoin.amos.fas.client.invoke.RsDataQueue;
import com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum; import com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum;
import com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum; import com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum;
import com.yeejoin.amos.fas.dao.entity.*; import com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData;
import org.apache.commons.lang3.ArrayUtils; import com.yeejoin.amos.fas.dao.entity.Equipment;
import org.slf4j.Logger; import com.yeejoin.amos.fas.dao.entity.EvaluationModel;
import org.slf4j.LoggerFactory; import com.yeejoin.amos.fas.dao.entity.Fmea;
import org.springframework.beans.BeanUtils; import com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint;
import org.springframework.beans.factory.annotation.Autowired; import com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem;
import org.springframework.beans.factory.annotation.Value; import com.yeejoin.amos.fas.dao.entity.PreplanPicture;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* @author keyong * @author keyong
...@@ -118,7 +137,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -118,7 +137,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Autowired @Autowired
private FmeaMapper fmeaMapper; private FmeaMapper fmeaMapper;
@Value("${station.name}")
private String stationName;
@Value("${spring.application.name}") @Value("${spring.application.name}")
private String serviceName; private String serviceName;
...@@ -166,18 +187,13 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -166,18 +187,13 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
} else { // 向三维推送实时值修改 } else { // 向三维推送实时值修改
log.info("(监测)Message type is: " + equipmentSpecificIndex.getType()); log.info("(监测)Message type is: " + equipmentSpecificIndex.getType());
Map<String, Object> content = new HashMap<>(); Map<String, Object> content = new HashMap<>();
// content.put("id", fireEquipmentData.getId());
// content.put("label", fireEquipmentData.getEqPointName());
// content.put("changeDate", fireEquipmentData.getCreateDate());
// content.put("orgCode", fireEquipment.getOrgCode());
// content.put("status", deviceData.getSoe());
content.put("id", "id"); content.put("id", "id");
content.put("label", "eqPointName"); content.put("label", "eqPointName");
content.put("changeDate", new Date()); content.put("changeDate", new Date());
content.put("orgCode", "orgCode"); content.put("orgCode", "orgCode");
content.put("status", deviceData.getSoe()); content.put("status", deviceData.getSoe());
iDataRefreshService.sendRefreshDataWithArea(View3dRefreshAreaEum.monitor_data.getCode(), content); iDataRefreshService.sendRefreshDataWithArea(View3dRefreshAreaEum.monitor_data.getCode(), content);
String title = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/monitorData"); String title = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/monitorData");
webMqttComponent.publish(title, JSON.toJSONString(view3dService.getEquipStatusList(equipmentSpecific.getOrgCode()))); webMqttComponent.publish(title, JSON.toJSONString(view3dService.getEquipStatusList(equipmentSpecific.getOrgCode())));
} }
......
...@@ -242,6 +242,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -242,6 +242,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired @Autowired
protected HttpServletRequest request; protected HttpServletRequest request;
@Value("${station.name}")
private String stationName;
public static String cacheKeyForCanBeRunning() { public static String cacheKeyForCanBeRunning() {
...@@ -803,19 +806,19 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -803,19 +806,19 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
// 今日安全 // 今日安全
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(new Date()); String dateString = formatter.format(new Date());
String topicOne = String.format("/%s/%s/%s/%s", serviceName, "yinan","data/refresh","todaySafetyIndex"); String topicOne = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","todaySafetyIndex");
webMqttComponent.publish(topicOne, JSON.toJSONString(view3dService.getSafetyIndexInfoByDate(orgCode, dateString))); webMqttComponent.publish(topicOne, JSON.toJSONString(view3dService.getSafetyIndexInfoByDate(orgCode, dateString)));
// 巡检异常 // 巡检异常
String topicTwo = String.format("/%s/%s/%s/%s", serviceName, "yinan","data/refresh","fireSafety"); String topicTwo = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","fireSafety");
webMqttComponent.publish(topicTwo, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("check", orgCode))); webMqttComponent.publish(topicTwo, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("check", orgCode)));
// 一周安全趋势 // 一周安全趋势
String topicThree = String.format("/%s/%s/%s/%s", serviceName, "yinan","data/refresh","weekSafetyIndex"); String topicThree = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","weekSafetyIndex");
webMqttComponent.publish(topicThree, JSON.toJSONString(view3dService.getSafetyIndexWeek(orgCode))); webMqttComponent.publish(topicThree, JSON.toJSONString(view3dService.getSafetyIndexWeek(orgCode)));
// 今日巡检 // 今日巡检
String topicFour = String.format("/%s/%s/%s/%s", serviceName, "yinan","data/refresh","todayCheckStatus"); String topicFour = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","todayCheckStatus");
webMqttComponent.publish(topicThree, JSON.toJSONString(view3dService.getStatisticsCheck(orgCode))); webMqttComponent.publish(topicThree, JSON.toJSONString(view3dService.getStatisticsCheck(orgCode)));
} }
...@@ -1043,7 +1046,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1043,7 +1046,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
// 推送设备状态信息 // 推送设备状态信息
Alarm alarm = iAlarmDao.findByStatusTrueAndFireEquipmentPointCode(param.getPointCode()); Alarm alarm = iAlarmDao.findByStatusTrueAndFireEquipmentPointCode(param.getPointCode());
String topic = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/monitorData"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/monitorData");
webMqttComponent.publish(topic, JSON.toJSONString(view3dService.getEquipStatusList(alarm.getOrgCode()))); webMqttComponent.publish(topic, JSON.toJSONString(view3dService.getEquipStatusList(alarm.getOrgCode())));
} catch (Exception e) { } catch (Exception e) {
log.error("推送前端数据失败-->"+JSON.toJSONString(param)); log.error("推送前端数据失败-->"+JSON.toJSONString(param));
...@@ -1148,7 +1151,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1148,7 +1151,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 推送告警数据 * 推送告警数据
* 影响区域:消防安全=>火灾告警 * 影响区域:消防安全=>火灾告警
*/ */
String topic = String.format("/%s/%s/%s/%s", serviceName, "yinan","data/refresh","fireSafety"); String topic = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","fireSafety");
webMqttComponent.publish(topic, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", fireEquipmentPoint.getOrgCode()))); webMqttComponent.publish(topic, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", fireEquipmentPoint.getOrgCode())));
} }
...@@ -1180,11 +1183,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1180,11 +1183,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 推送设备状态 * 推送设备状态
* 影响区域:设备状态 * 影响区域:设备状态
*/ */
String topic = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/monitorData"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/monitorData");
webMqttComponent.publish(topic, JSON.toJSONString(view3dService.getEquipStatusList(fireEquipment.getOrgCode()))); webMqttComponent.publish(topic, JSON.toJSONString(view3dService.getEquipStatusList(fireEquipment.getOrgCode())));
} }
} }
// String topic = String.format("/%s/%s/%s", serviceName, "yinan","telesignaling");S // String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"telesignaling");S
// webMqttComponent.publish(topic, JSON.toJSONString(deviceData)); // webMqttComponent.publish(topic, JSON.toJSONString(deviceData));
List<AlarmParam> list = new ArrayList<>(); List<AlarmParam> list = new ArrayList<>();
...@@ -1294,7 +1297,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1294,7 +1297,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
try { try {
redisTemplate.opsForHash().put("Analogue", data.getPointCode(), data); redisTemplate.opsForHash().put("Analogue", data.getPointCode(), data);
// remoteWebSocketServer.sendMessage("plan", JSON.toJSONString(data)); // remoteWebSocketServer.sendMessage("plan", JSON.toJSONString(data));
String topic = String.format("/%s/%s/%s", serviceName, "yinan","analogue"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"analogue");
webMqttComponent.publish(topic, JSON.toJSONString(data)); webMqttComponent.publish(topic, JSON.toJSONString(data));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -1480,7 +1483,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1480,7 +1483,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fmeaMapper.updateRpn(fmea); fmeaMapper.updateRpn(fmea);
//2.计算上级风险值(风险点及父节点) //2.计算上级风险值(风险点及父节点)
this.notifyRiskSource(newLevel.getOrgCode(), fmeaId, fmea.getRiskSourceId(), nofityType, jpushMsgBo); this.notifyRiskSource(newLevel.getOrgCode(), fmeaId, fmea.getRiskSourceId(), nofityType, jpushMsgBo);
String topic = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/incidenceSeverityMatrix"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/incidenceSeverityMatrix");
webMqttComponent.publish(topic, JSON.toJSONString(queryForMatrix())); webMqttComponent.publish(topic, JSON.toJSONString(queryForMatrix()));
} }
} }
...@@ -1585,7 +1588,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1585,7 +1588,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} }
//1.3.更新fmea的rpn、风险等级及newOid //1.3.更新fmea的rpn、风险等级及newOid
fmeaMapper.updateRpn(fmea); fmeaMapper.updateRpn(fmea);
String topic = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/incidenceSeverityMatrix"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/incidenceSeverityMatrix");
webMqttComponent.publish(topic, JSON.toJSONString(queryForMatrix())); webMqttComponent.publish(topic, JSON.toJSONString(queryForMatrix()));
//2.计算风险点rpn、rpni、riskLevelId //2.计算风险点rpn、rpni、riskLevelId
this.notifyRiskSource(newLevel.getOrgCode(), fmeaId, fmea.getRiskSourceId(), notifyType, jpushMsgBo); this.notifyRiskSource(newLevel.getOrgCode(), fmeaId, fmea.getRiskSourceId(), notifyType, jpushMsgBo);
...@@ -1690,13 +1693,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1690,13 +1693,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} }
} }
try { try {
String topic = String.format("/%s/%s/%s", serviceName, "shaoxing","data/refresh/situationMap"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/situationMap");
webMqttComponent.publish(topic, JSON.toJSONString(queryRiskAreaRpn())); webMqttComponent.publish(topic, JSON.toJSONString(queryRiskAreaRpn()));
topic = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/riskDegreeHistogram"); topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/riskDegreeHistogram");
webMqttComponent.publish(topic, JSON.toJSONString(queryRPNReport())); webMqttComponent.publish(topic, JSON.toJSONString(queryRPNReport()));
topic = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/riskDegreePie"); topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/riskDegreePie");
webMqttComponent.publish(topic, JSON.toJSONString(queryForRiseUp())); webMqttComponent.publish(topic, JSON.toJSONString(queryForRiseUp()));
topic = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/incidenceSeverityMatrix"); topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/incidenceSeverityMatrix");
webMqttComponent.publish(topic, JSON.toJSONString(queryForMatrix())); webMqttComponent.publish(topic, JSON.toJSONString(queryForMatrix()));
// 今日安全 // 今日安全
...@@ -1705,17 +1708,17 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1705,17 +1708,17 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if(StringUtils.isEmpty(orgCode)){ if(StringUtils.isEmpty(orgCode)){
orgCode = riskSource.getOrgCode(); orgCode = riskSource.getOrgCode();
} }
String topicOne = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/todaySafetyIndex"); String topicOne = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/todaySafetyIndex");
webMqttComponent.publish(topicOne, JSON.toJSONString(view3dService.getSafetyIndexInfoByDate(orgCode, dateString))); webMqttComponent.publish(topicOne, JSON.toJSONString(view3dService.getSafetyIndexInfoByDate(orgCode, dateString)));
// 消防安全 // 消防安全
String topicTow = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/fireSafety"); String topicTow = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/fireSafety");
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("risk", orgCode))); webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("risk", orgCode)));
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("check", orgCode))); webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("check", orgCode)));
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", orgCode))); webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", orgCode)));
// 一周安全趋势 // 一周安全趋势
String topicThree = String.format("/%s/%s/%s/%s", serviceName, "yinan","data/refresh","weekSafetyIndex"); String topicThree = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","weekSafetyIndex");
webMqttComponent.publish(topicThree, JSON.toJSONString(view3dService.getSafetyIndexWeek(orgCode))); webMqttComponent.publish(topicThree, JSON.toJSONString(view3dService.getSafetyIndexWeek(orgCode)));
} catch (Exception e) { } catch (Exception e) {
...@@ -1748,13 +1751,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1748,13 +1751,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
try{ try{
String topic = String.format("/%s/%s/%s", serviceName, "shaoxing","data/refresh/situationMap"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/situationMap");
webMqttComponent.publish(topic, JSON.toJSONString(queryRiskAreaRpn())); webMqttComponent.publish(topic, JSON.toJSONString(queryRiskAreaRpn()));
topic = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/riskDegreeHistogram"); topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/riskDegreeHistogram");
webMqttComponent.publish(topic, JSON.toJSONString(queryRPNReport())); webMqttComponent.publish(topic, JSON.toJSONString(queryRPNReport()));
topic = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/riskDegreePie"); topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/riskDegreePie");
webMqttComponent.publish(topic, JSON.toJSONString(queryForRiseUp())); webMqttComponent.publish(topic, JSON.toJSONString(queryForRiseUp()));
topic = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/incidenceSeverityMatrix"); topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/incidenceSeverityMatrix");
webMqttComponent.publish(topic, JSON.toJSONString(queryForMatrix())); webMqttComponent.publish(topic, JSON.toJSONString(queryForMatrix()));
// 今日安全 // 今日安全
...@@ -1764,17 +1767,17 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1764,17 +1767,17 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if(StringUtils.isEmpty(orgCode)){ if(StringUtils.isEmpty(orgCode)){
orgCode = riskSource.getOrgCode(); orgCode = riskSource.getOrgCode();
} }
String topicOne = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/todaySafetyIndex"); String topicOne = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/todaySafetyIndex");
webMqttComponent.publish(topicOne, JSON.toJSONString(view3dService.getSafetyIndexInfoByDate(orgCode, dateString))); webMqttComponent.publish(topicOne, JSON.toJSONString(view3dService.getSafetyIndexInfoByDate(orgCode, dateString)));
// 消防安全 // 消防安全
String topicTow = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/fireSafety"); String topicTow = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/fireSafety");
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("risk", orgCode))); webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("risk", orgCode)));
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("check", orgCode))); webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("check", orgCode)));
webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", orgCode))); webMqttComponent.publish(topicTow, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", orgCode)));
// 一周安全趋势 // 一周安全趋势
String topicThree = String.format("/%s/%s/%s/%s", serviceName, "yinan","data/refresh","weekSafetyIndex"); String topicThree = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","weekSafetyIndex");
webMqttComponent.publish(topicThree, JSON.toJSONString(view3dService.getSafetyIndexWeek(orgCode))); webMqttComponent.publish(topicThree, JSON.toJSONString(view3dService.getSafetyIndexWeek(orgCode)));
}catch (Exception e) { }catch (Exception e) {
...@@ -1931,13 +1934,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1931,13 +1934,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
public void batchSaveRegionUe4(List<BindRegionBo> regionBoList) { public void batchSaveRegionUe4(List<BindRegionBo> regionBoList) {
riskSourceMapper.batchSaveRegionUe4(regionBoList); riskSourceMapper.batchSaveRegionUe4(regionBoList);
try { try {
String topic = String.format("/%s/%s/%s", serviceName, "shaoxing","data/refresh/situationMap"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/situationMap");
webMqttComponent.publish(topic, JSON.toJSONString(queryRiskAreaRpn())); webMqttComponent.publish(topic, JSON.toJSONString(queryRiskAreaRpn()));
topic = String.format("/%s/%s/%s", serviceName, "shaoxing","data/refresh/riskDegreeHistogram"); topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/riskDegreeHistogram");
webMqttComponent.publish(topic, JSON.toJSONString(queryRPNReport())); webMqttComponent.publish(topic, JSON.toJSONString(queryRPNReport()));
topic = String.format("/%s/%s/%s", serviceName, "shaoxing","data/refresh/riskDegreePie"); topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/riskDegreePie");
webMqttComponent.publish(topic, JSON.toJSONString(queryForRiseUp())); webMqttComponent.publish(topic, JSON.toJSONString(queryForRiseUp()));
topic = String.format("/%s/%s/%s", serviceName, "shaoxing","data/refresh/incidenceSeverityMatrix"); topic = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/incidenceSeverityMatrix");
webMqttComponent.publish(topic, JSON.toJSONString(queryForMatrix())); webMqttComponent.publish(topic, JSON.toJSONString(queryForMatrix()));
} catch (Exception e) { } catch (Exception e) {
log.error("数据获取失败", e); log.error("数据获取失败", e);
......
...@@ -71,4 +71,8 @@ amos.feign.gennerator.use-gateway=true ...@@ -71,4 +71,8 @@ amos.feign.gennerator.use-gateway=true
autoSys.push.type=mqtt autoSys.push.type=mqtt
#����� #�����
file.downLoad.url=http://172.16.10.175:8888/ file.downLoad.url=http://39.98.246.31:8888/
#站端名称使用全拼
station.name = yinan
...@@ -61,4 +61,6 @@ param.safetyIndexChange.cron = 0 0 2 * * ? ...@@ -61,4 +61,6 @@ param.safetyIndexChange.cron = 0 0 2 * * ?
param.weather.url = http://wthrcdn.etouch.cn/weather_mini?citykey= param.weather.url = http://wthrcdn.etouch.cn/weather_mini?citykey=
#站端名称使用全拼
station.name = yinan
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