Commit 93b8b0b6 authored by KeYong's avatar KeYong

更新告警信号入库逻辑

parent e45bd109
...@@ -18,4 +18,5 @@ public class SShanMessage { ...@@ -18,4 +18,5 @@ public class SShanMessage {
private String pointId; private String pointId;
private String time; private String time;
private String deviceId; private String deviceId;
private String eventstatus;
} }
...@@ -150,9 +150,9 @@ public class EquipmentIotMqttReceiveConfig { ...@@ -150,9 +150,9 @@ public class EquipmentIotMqttReceiveConfig {
mqttReceiveService.handlerMqttIncrementMessage(topic, msg); mqttReceiveService.handlerMqttIncrementMessage(topic, msg);
} else if (dataType.equals("event") && StringUtil.isNotEmpty(msg)) { } else if (dataType.equals("event") && StringUtil.isNotEmpty(msg)) {
mqttEventReceiveService.handlerMqttIncrementMessage(topic, msg); mqttEventReceiveService.handlerMqttIncrementMessage(topic, msg);
}else if (dataType.equals("transmit") && StringUtil.isNotEmpty(msg)){ }else if (dataType.equals("transmit") && StringUtil.isNotEmpty(msg)){ // 遥信遥测信号
mqttReceiveService.handlerMqttRomaMessage(topic,msg); mqttReceiveService.handlerMqttRomaMessage(topic,msg);
}else if (dataType.equals("shaoshan") && StringUtil.isNotEmpty(msg)){ }else if (dataType.equals("shaoshan") && StringUtil.isNotEmpty(msg)){ // 告警信号
mqttReceiveService.handlerMqttStationMessage(topic,msg); mqttReceiveService.handlerMqttStationMessage(topic,msg);
} }
} }
......
...@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection; import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import com.yeejoin.amos.component.rule.RuleTrigger; import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm;
...@@ -48,7 +47,6 @@ import org.springframework.util.CollectionUtils; ...@@ -48,7 +47,6 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -198,6 +196,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -198,6 +196,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private Resource systemStateIndex; private Resource systemStateIndex;
@Value("${dcs.send.message}") @Value("${dcs.send.message}")
private Boolean NRMsgSend; private Boolean NRMsgSend;
@Value("${message.alarm.char}")
private String specialChars;
public static List<EquipmentSpecificAlarmLog> upAlarmLogStatus(String iotCode, String equipmentSpecificIndexKey, public static List<EquipmentSpecificAlarmLog> upAlarmLogStatus(String iotCode, String equipmentSpecificIndexKey,
String traceId, IEquipmentSpecificAlarmLogService equipmentSpecificAlarmLogService, String traceId, IEquipmentSpecificAlarmLogService equipmentSpecificAlarmLogService,
...@@ -693,7 +693,14 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -693,7 +693,14 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
SShanStationMessage sShanStationMessage = JSON.parseObject(String.valueOf(message), SShanStationMessage.class); SShanStationMessage sShanStationMessage = JSON.parseObject(String.valueOf(message), SShanStationMessage.class);
Map<Object, Object> equipmentIndexKeyMap = redisUtils.hmget(RedisKey.EQUIP_INDEX_ADDRESS_KEY_STATION); Map<Object, Object> equipmentIndexKeyMap = redisUtils.hmget(RedisKey.EQUIP_INDEX_ADDRESS_KEY_STATION);
sShanStationMessage.getWarns().forEach(m -> { sShanStationMessage.getWarns().forEach(m -> {
String value = m.getEventTextL1().contains("出现") ? TRUE : FALSE; String value;
if (message.contains("eventtextL1")) {
// 此通道目前专供韶山告警消息value赋值,没必要用配置文件多字段进行逐个判断,所以暂时不修改
value = m.getEventTextL1().contains("出现") ? TRUE : FALSE;
} else {
value = String.valueOf(BeanUtil.judgePropertyContainsChar(m.getEventstatus(), specialChars));
}
if (equipmentIndexKeyMap.get(m.getPointId()) != null) { if (equipmentIndexKeyMap.get(m.getPointId()) != null) {
EquipmentSpecificIndex equipmentSpeIndex = equipmentSpecificIndexService.getEquipmentSpeIndexByAddress(null, m.getPointId(), null); EquipmentSpecificIndex equipmentSpeIndex = equipmentSpecificIndexService.getEquipmentSpeIndexByAddress(null, m.getPointId(), null);
if (equipmentSpeIndex == null) { if (equipmentSpeIndex == null) {
...@@ -933,6 +940,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -933,6 +940,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}); });
} }
/** /**
* 物联数据处理 * 物联数据处理
* *
......
...@@ -30,4 +30,16 @@ public class BeanUtil { ...@@ -30,4 +30,16 @@ public class BeanUtil {
public static void copyPropertiesIgnoreNull(Object src, Object target){ public static void copyPropertiesIgnoreNull(Object src, Object target){
BeanUtils.copyProperties(src, target, getNullPropertyNames(src)); BeanUtils.copyProperties(src, target, getNullPropertyNames(src));
} }
public static boolean judgePropertyContainsChar(String sourceStr, String specialStr) {
boolean bool = Boolean.FALSE;
String[] strings = specialStr.split(",");
for (String code : strings) {
if (sourceStr.contains(code)) {
bool = Boolean.TRUE;
break;
}
}
return bool;
}
} }
...@@ -150,4 +150,7 @@ spring.influx.database=iot_platform ...@@ -150,4 +150,7 @@ spring.influx.database=iot_platform
spring.influx.retention_policy=default spring.influx.retention_policy=default
spring.influx.retention_policy_time=30d spring.influx.retention_policy_time=30d
spring.influx.actions=10000 spring.influx.actions=10000
spring.influx.bufferLimit=20000 spring.influx.bufferLimit=20000
\ No newline at end of file
# message\u670D\u52A1\u8F6C\u53D1\u544A\u8B66\u4FE1\u53F7\u7279\u6B8A\u5224\u65AD\u5B57\u7B26\u96C6
message.alarm.char=\u51FA\u73B0
\ No newline at end of file
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