fix: station lookup by position (OFFSET) instead of StationIndex

This commit is contained in:
zlm committed 2026-06-10 09:29:15 +08:00
1 parent 81e85944d5
commit a149215819
1 file changed
+4 -2
+4 -2
View File
@@ -24,11 +24,13 @@ export function handleDataCollection(
SELECT s.Id, s.PointId, mp.PointName SELECT s.Id, s.PointId, mp.PointName
FROM Stations s FROM Stations s
JOIN MeasurementPoints mp ON mp.Id = s.PointId JOIN MeasurementPoints mp ON mp.Id = s.PointId
WHERE s.PLCId = ? AND s.StationIndex = ? WHERE s.PLCId = ?
ORDER BY s.Id
LIMIT 1 OFFSET ?
`).get(plc.id, stationIndex) as { Id: number; PointId: number; PointName: string } | undefined `).get(plc.id, stationIndex) as { Id: number; PointId: number; PointName: string } | undefined
if (!station) { if (!station) {
logger.warn(TAG, `PLC#${plc.id} 工序索引 ${stationIndex} 未找到对应配置`) logger.warn(TAG, `PLC#${plc.id} 工序偏移 ${stationIndex} 未找到对应配置`)
return return
} }