|
@@ -25,6 +25,7 @@ import com.persagy.utils.StringUtil;
|
|
import com.persagy.utils.ValidateUtils;
|
|
import com.persagy.utils.ValidateUtils;
|
|
import com.persagy.utils.condition.ConditionUtils;
|
|
import com.persagy.utils.condition.ConditionUtils;
|
|
import com.rabbitmq.client.Channel;
|
|
import com.rabbitmq.client.Channel;
|
|
|
|
+import lombok.SneakyThrows;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.quartz.JobDataMap;
|
|
import org.quartz.JobDataMap;
|
|
@@ -101,6 +102,7 @@ public class AlarmHandleServiceImpl {
|
|
*/
|
|
*/
|
|
@RabbitHandler
|
|
@RabbitHandler
|
|
@RabbitListener(queues = "alarm-data-queue")
|
|
@RabbitListener(queues = "alarm-data-queue")
|
|
|
|
+ @SneakyThrows
|
|
public void handleIotMsg(Message message, Channel channel) {
|
|
public void handleIotMsg(Message message, Channel channel) {
|
|
try {
|
|
try {
|
|
JSONArray msgJsonArray = JSON.parseArray(new String(message.getBody()));
|
|
JSONArray msgJsonArray = JSON.parseArray(new String(message.getBody()));
|
|
@@ -164,6 +166,7 @@ public class AlarmHandleServiceImpl {
|
|
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
|
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("mq 接收处理发数数据发生错误", e);
|
|
log.error("mq 接收处理发数数据发生错误", e);
|
|
|
|
+ channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -205,6 +208,10 @@ public class AlarmHandleServiceImpl {
|
|
// AlarmCondition alarmCondition = alarmInfoCache.getAlarmCondition(conditionId);
|
|
// AlarmCondition alarmCondition = alarmInfoCache.getAlarmCondition(conditionId);
|
|
AlarmCondition alarmCondition = alarmRedisCache.getAlarmCondition(conditionId);
|
|
AlarmCondition alarmCondition = alarmRedisCache.getAlarmCondition(conditionId);
|
|
|
|
|
|
|
|
+ if (alarmCondition == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
// 解析触发和恢复条件
|
|
// 解析触发和恢复条件
|
|
String trigger = alarmCondition.getTriggerBackend();
|
|
String trigger = alarmCondition.getTriggerBackend();
|
|
Expression triggerExp = AviatorEvaluator.compile(trigger, true);
|
|
Expression triggerExp = AviatorEvaluator.compile(trigger, true);
|