Browse Source

#fdp告警日志打印

zhongwei
yang_shj 8 months ago
parent
commit
90828f3832
  1. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java

@ -5,6 +5,7 @@ import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import com.hnac.hzims.alarm.source.service.FdpAlarmService; import com.hnac.hzims.alarm.source.service.FdpAlarmService;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService; import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
import com.hnac.hzinfo.subscribe.SubscribeCallBack; import com.hnac.hzinfo.subscribe.SubscribeCallBack;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -18,6 +19,7 @@ import java.util.Map;
*/ */
@Service @Service
@Slf4j
public class FdpMqttConsumer implements SubscribeCallBack { public class FdpMqttConsumer implements SubscribeCallBack {
@Autowired @Autowired
private FdpAlarmService fdpAlarmService; private FdpAlarmService fdpAlarmService;
@ -25,7 +27,7 @@ public class FdpMqttConsumer implements SubscribeCallBack {
private AlarmSaveService alarmSaveService; private AlarmSaveService alarmSaveService;
@Override @Override
public void onMessage(Map<String, Object> data) { public void onMessage(Map<String, Object> data) {
System.out.println("监听到消息"+data.toString()); log.error("监听Fdp消息 : {}" ,data.toString());
String s = JSONObject.toJSONString(data); String s = JSONObject.toJSONString(data);
//消费代码 //消费代码

Loading…
Cancel
Save