fix(scheduled):修正粉尘传感器报警逻辑中的字段匹配错误

- 将过滤条件从 DEVICE_SENSOR_ID 更改为 PLC_ID以正确匹配传感器数据
- 确保报警记录能准确反映当前传感器状态- 避免因字段不匹配导致的误报或漏报情况
dev
wangyan 2025-11-17 17:27:28 +08:00
parent 334a18c467
commit 9658b6dc50
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ public class DustSensorAlarmScheduled {
List<PageData> alarmRecords = new ArrayList<>(); List<PageData> alarmRecords = new ArrayList<>();
allSensors.forEach(sensor -> { allSensors.forEach(sensor -> {
PageData currentData = latestDataMap.stream() PageData currentData = latestDataMap.stream()
.filter(item -> item.get("DEVICE_SENSOR_ID").equals(sensor.get("DEVICE_SENSOR_ID"))) .filter(item -> item.get("PLC_ID").equals(sensor.get("DEVICE_SENSOR_ID")))
.findFirst() .findFirst()
.orElse(null); .orElse(null);
if (currentData == null) { if (currentData == null) {