|
|
@@ -61,6 +61,8 @@ public class RuleEngineUtil {
|
|
|
Set<String> deviceActionTypes = new HashSet(2);
|
|
|
String ruleEngineName = this.ruleEngineService.getName(ruleEngineId);
|
|
|
|
|
|
+ RuleEngineLog ruleEngineLog = new RuleEngineLog();
|
|
|
+
|
|
|
for(RuleEngineAction ruleEngineAction : actionList) {
|
|
|
if (ActionTypeEnum.DEVICE_CONTROL.getType().equals(ruleEngineAction.getType())) {
|
|
|
DeviceControlAction deviceControlAction = (DeviceControlAction)ruleEngineAction;
|
|
|
@@ -71,6 +73,7 @@ public class RuleEngineUtil {
|
|
|
this.performSingleDeviceControl(deviceControlAction, controlAction, now);
|
|
|
baseLog.setDetail(controlAction);
|
|
|
baseLogs.add(baseLog);
|
|
|
+ ruleEngineLog.setTenantId(deviceControlAction.getDevices().get(0).getTenantId());
|
|
|
} else if (ActionTypeEnum.ALARM_EVENT.getType().equals(ruleEngineAction.getType())) {
|
|
|
this.generateAlarmEvent(ruleEngineId, ruleEngineName, projectId, spaceId, Collections.singletonList(ruleEngineAction));
|
|
|
deviceActionTypes.add("alarmEvent");
|
|
|
@@ -78,9 +81,8 @@ public class RuleEngineUtil {
|
|
|
baseLog.setType(ActionTypeEnum.ALARM_EVENT.getType());
|
|
|
baseLog.setDetail(getAlarmActionLog(now, (AlarmEventAction)ruleEngineAction));
|
|
|
baseLogs.add(baseLog);
|
|
|
+ ruleEngineLog.setTenantId(((AlarmEventAction) ruleEngineAction).getDevices().get(0).getTenantId());
|
|
|
}
|
|
|
-
|
|
|
- RuleEngineLog ruleEngineLog = new RuleEngineLog();
|
|
|
ruleEngineLog.setDetail(JsonUtil.toJson(ruleEngineDetail));
|
|
|
ruleEngineLog.setRuleEngineId(ruleEngineId);
|
|
|
ruleEngineLog.setRuleEngineName(ruleEngineName);
|
|
|
@@ -92,7 +94,6 @@ public class RuleEngineUtil {
|
|
|
ruleEngineLog.setCreateTime(now);
|
|
|
ruleEngineLog.setCreatedBy("admin");
|
|
|
ruleEngineLog.setUpdatedBy("admin");
|
|
|
- ruleEngineLog.setTenantId(1);
|
|
|
if(!SecurityUtils.getUsername().isEmpty()) {
|
|
|
ruleEngineLog.setCreatedBy(SecurityUtils.getUsername());
|
|
|
ruleEngineLog.setUpdatedBy(SecurityUtils.getUsername());
|