fix(iot,ops): 修复退出检测停滞、TTS多租户重复播报,精简语音通知
1. 蓝牙信号缺失补偿:设备属性上报不含 bluetoothDevices 时注入 null, 避免 RSSI 滑动窗口因无数据停滞导致退出检测延迟 2. TTS 多租户去重:TtsQueueMessage 携带 tenantId,processSingleQueue 过滤非当前租户消息,解决 @TenantJob 导致同一播报被不同租户重复下发 3. 循环播报日志精简:仅在 broadcastLoop 启动时记录一次 TTS_SENT, 后续重复播报不再写入 ops_business_event_log 4. 移除离岗 TTS 警告和入队语音播报,减少不必要的设备干扰 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,13 @@ public class CleanRuleProcessorManager {
|
||||
// 属性上报:直接遍历 key-value
|
||||
data.forEach((identifier, value) ->
|
||||
processDataSafely(deviceId, identifier, value));
|
||||
|
||||
// 4. 蓝牙信号缺失补偿:当设备上报了属性但不含 bluetoothDevices 时,
|
||||
// 主动注入一次 null 调用,使 BeaconDetectionRuleProcessor 能写入 -999(信号缺失),
|
||||
// 避免退出检测窗口因无数据而停滞
|
||||
if (!data.containsKey("bluetoothDevices")) {
|
||||
beaconDetectionRuleProcessor.processPropertyChange(deviceId, "bluetoothDevices", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -226,12 +226,7 @@ public class BeaconDetectionRuleProcessor {
|
||||
// 首次丢失
|
||||
signalLossRedisDAO.recordFirstLoss(deviceId, areaId, System.currentTimeMillis());
|
||||
|
||||
// 2. 发送警告
|
||||
publishTtsEvent(deviceId, "你已离开当前区域," +
|
||||
(exitConfig.getLossTimeoutMinutes() > 0 ? exitConfig.getLossTimeoutMinutes() + "分钟内工单将自动结算"
|
||||
: "工单将自动结算"));
|
||||
|
||||
// 3. 发布审<E5B883><E5AEA1><EFBFBD>日志
|
||||
// 2. 发布审计日志
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("firstLossTime", System.currentTimeMillis());
|
||||
data.put("rssi", window.isEmpty() ? -999 : window.get(window.size() - 1));
|
||||
|
||||
Reference in New Issue
Block a user