From e76d04f5264dde1fb2d253a6c07389a32f265c98 Mon Sep 17 00:00:00 2001 From: XuJiacheng Date: Fri, 27 Feb 2026 08:56:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(processor):=20=E6=A3=80=E6=9F=A5=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3hotel=5Fid=E8=B6=85=E5=87=BAint2=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当hotel_id超出int2范围(-32768到32767)时,将其设置为0,避免数据库插入错误 --- bls-rcu-action-backend/src/processor/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bls-rcu-action-backend/src/processor/index.js b/bls-rcu-action-backend/src/processor/index.js index 65dae1f..8e0b4a7 100644 --- a/bls-rcu-action-backend/src/processor/index.js +++ b/bls-rcu-action-backend/src/processor/index.js @@ -210,10 +210,12 @@ export const buildRowsFromPayload = (rawPayload) => { const writeTsMs = Date.now(); // Base fields common to all rows (excluding unique ID) + // Check if hotel_id is within int2 range (-32768 to 32767), set to 0 if out of range + const validHotelId = (hotelId >= -32768 && hotelId <= 32767) ? hotelId : 0; const commonFields = { ts_ms: tsMs, write_ts_ms: writeTsMs, - hotel_id: hotelId, + hotel_id: validHotelId, room_id: roomId, device_id: deviceId, direction: normalizedDirection,