提交增加运维管理
This commit is contained in:
@@ -8,6 +8,7 @@ import com.xinda.common.core.redis.RedisCache;
|
||||
import com.xinda.common.core.redis.RedisKeyBuilder;
|
||||
import com.xinda.common.core.thingsModel.SceneThingsModelItem;
|
||||
import com.xinda.common.core.thingsModel.ThingsModelSimpleItem;
|
||||
import com.xinda.common.enums.TopicType;
|
||||
import com.xinda.common.exception.ServiceException;
|
||||
import com.xinda.common.utils.DateUtils;
|
||||
import com.xinda.common.utils.StringUtils;
|
||||
@@ -66,6 +67,8 @@ public class SceneContext {
|
||||
*/
|
||||
private List<SceneThingsModelItem> sceneThingsModelItems;
|
||||
|
||||
// private List<AlertLog> sceneAlertLogList;
|
||||
|
||||
|
||||
private static IFunctionInvoke functionInvoke = SpringUtils.getBean(IFunctionInvoke.class);
|
||||
|
||||
@@ -485,6 +488,7 @@ public class SceneContext {
|
||||
}
|
||||
AlertLog alertLog = getAlertLog(alertSceneSendVO, device, sceneThingsModelItem);
|
||||
alertLogList.add(alertLog);
|
||||
// sceneAlertLogList.add(alertLog);
|
||||
}
|
||||
}
|
||||
// 保存告警日志
|
||||
@@ -694,4 +698,7 @@ public class SceneContext {
|
||||
return true;
|
||||
}
|
||||
|
||||
// public Collection<? extends AlertLog> getAlertLogList() {
|
||||
// return sceneAlertLogList;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.xinda.mq.service;
|
||||
|
||||
import com.xinda.iot.domain.AlertLog;
|
||||
import com.xinda.mq.model.ReportDataBo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -50,10 +51,11 @@ public class RuleEngineHandler implements IRuleEngine {
|
||||
* @param bo 上报数据模型bo
|
||||
* @see ReportDataBo
|
||||
*/
|
||||
public void ruleMatch(ReportDataBo bo) {
|
||||
public void ruleMatch(ReportDataBo bo) {
|
||||
// List<AlertLog> alertLogList = new ArrayList<>();
|
||||
try {
|
||||
// 场景联动处理
|
||||
this.sceneProcess(bo);
|
||||
this.sceneProcess(bo);
|
||||
} catch (Exception e) {
|
||||
log.error("接收数据,解析数据时异常 message={}", e, e.getMessage());
|
||||
}
|
||||
@@ -62,7 +64,7 @@ public class RuleEngineHandler implements IRuleEngine {
|
||||
/**
|
||||
* 场景规则处理
|
||||
*/
|
||||
public void sceneProcess(ReportDataBo bo) throws ExecutionException, InterruptedException {
|
||||
public void sceneProcess(ReportDataBo bo) throws ExecutionException, InterruptedException {
|
||||
// 查询设备关联的场景
|
||||
SceneDevice sceneDeviceParam = new SceneDevice();
|
||||
sceneDeviceParam.setProductId(bo.getProductId());
|
||||
|
||||
Reference in New Issue
Block a user