From a149215819a5cc03e96e1157ca0ad33a72b1531d Mon Sep 17 00:00:00 2001 From: zlm Date: Wed, 10 Jun 2026 09:29:15 +0800 Subject: [PATCH] fix: station lookup by position (OFFSET) instead of StationIndex --- project/src/services/collection.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/project/src/services/collection.ts b/project/src/services/collection.ts index 3abb167..7559648 100644 --- a/project/src/services/collection.ts +++ b/project/src/services/collection.ts @@ -24,11 +24,13 @@ export function handleDataCollection( SELECT s.Id, s.PointId, mp.PointName FROM Stations s 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 if (!station) { - logger.warn(TAG, `PLC#${plc.id} 工序索引 ${stationIndex} 未找到对应配置`) + logger.warn(TAG, `PLC#${plc.id} 工序偏移 ${stationIndex} 未找到对应配置`) return }