|
|
@ -184,7 +184,7 @@ public class BatchDeviceMessageProcessor { |
|
|
processFenceAlarm(handVo, context); |
|
|
processFenceAlarm(handVo, context); |
|
|
|
|
|
|
|
|
// 9. 保存处理后的数据日志
|
|
|
// 9. 保存处理后的数据日志
|
|
|
context.processedLogs.add(createTdengineDataVo(handVo)); |
|
|
|
|
|
|
|
|
context.processedLogs.add(createTdengineDataVo(handVo,tenantId)); |
|
|
|
|
|
|
|
|
// 10. 记录需要更新到 Redis 的数据
|
|
|
// 10. 记录需要更新到 Redis 的数据
|
|
|
context.redisUpdates.put(sn, handVo); |
|
|
context.redisUpdates.put(sn, handVo); |
|
|
@ -546,7 +546,7 @@ public class BatchDeviceMessageProcessor { |
|
|
Integer newLevel = alarmRule.getAlarmLevel(); |
|
|
Integer newLevel = alarmRule.getAlarmLevel(); |
|
|
|
|
|
|
|
|
// 首次报警
|
|
|
// 首次报警
|
|
|
if (!isCurrentlyAlarming) { |
|
|
|
|
|
|
|
|
if (!isCurrentlyAlarming && newLevel != null) { |
|
|
handVo.setFirstValue(handVo.getValue()); |
|
|
handVo.setFirstValue(handVo.getValue()); |
|
|
handVo.setTAlarmStart(now); |
|
|
handVo.setTAlarmStart(now); |
|
|
handVo.setMaxValue(handVo.getValue()); |
|
|
handVo.setMaxValue(handVo.getValue()); |
|
|
@ -642,6 +642,8 @@ public class BatchDeviceMessageProcessor { |
|
|
newAlarm.setTenantId(handVo.getTenantId()); |
|
|
newAlarm.setTenantId(handVo.getTenantId()); |
|
|
newAlarm.setCreator("system"); |
|
|
newAlarm.setCreator("system"); |
|
|
newAlarm.setCreateTime(now); |
|
|
newAlarm.setCreateTime(now); |
|
|
|
|
|
newAlarm.setDeptId(handVo.getDeptId()); |
|
|
|
|
|
newAlarm.setAlarmLevel(HandAlarmType.ALARM.getType()); |
|
|
|
|
|
|
|
|
context.gasAlarmsToCreate.add(newAlarm); |
|
|
context.gasAlarmsToCreate.add(newAlarm); |
|
|
handVo.setBatteryStatus(EnableStatus.ENABLED.value()); |
|
|
handVo.setBatteryStatus(EnableStatus.ENABLED.value()); |
|
|
@ -911,9 +913,9 @@ public class BatchDeviceMessageProcessor { |
|
|
/** |
|
|
/** |
|
|
* 创建处理后的日志对象 |
|
|
* 创建处理后的日志对象 |
|
|
*/ |
|
|
*/ |
|
|
private TdengineDataVo createTdengineDataVo(HandDataVo handVo) { |
|
|
|
|
|
|
|
|
private TdengineDataVo createTdengineDataVo(HandDataVo handVo, Long tenantId) { |
|
|
TdengineDataVo vo = BeanUtils.toBean(handVo, TdengineDataVo.class); |
|
|
TdengineDataVo vo = BeanUtils.toBean(handVo, TdengineDataVo.class); |
|
|
vo.setTenantId(handVo.getTenantId()); |
|
|
|
|
|
|
|
|
vo.setTenantId(tenantId); |
|
|
vo.setTs(new Timestamp(System.currentTimeMillis())); |
|
|
vo.setTs(new Timestamp(System.currentTimeMillis())); |
|
|
return vo; |
|
|
return vo; |
|
|
} |
|
|
} |
|
|
|