From 62b8779535a27825f8ec76324cec8f9a75b5661f Mon Sep 17 00:00:00 2001 From: Ironsp <1522278303@qq.com> Date: Tue, 15 Sep 2026 10:02:12 +0800 Subject: [PATCH] =?UTF-8?q?feat=20RTK=E8=BD=A8=E8=BF=B9=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/index.ts | 2 +- src/service/rtkTrack.ts | 6 +++++- src/service/seed.ts | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/service/index.ts b/src/service/index.ts index 785fd27..6bf56c3 100644 --- a/src/service/index.ts +++ b/src/service/index.ts @@ -30,7 +30,7 @@ const tableSqls = [ const expectedColumns: Record = { project: ['id', 'project_name', 'stake_range', 'total_area', 'start_time', 'end_time', 'total_duration', 'total_compaction_area', 'total_pass_count', 'qualified_rate', 'progress', 'uncompacted_area', 'status', 'created_at', 'updated_at'], work_record: ['id', 'project_id', 'start_time', 'end_time', 'duration', 'compaction_area', 'pass_count', 'exception_count', 'created_at'], - rtk_track: ['id', 'work_record_id', 'latitude', 'longitude', 'speed', 'heading', 'steel_wheel_temp', 'compaction_value', 'created_at'], + rtk_track: ['id', 'work_record_id', 'latitude', 'longitude', 'speed', 'heading', 'steel_wheel_temp', 'compaction_value', 'pass_count', 'qualified_rate', 'created_at'], warning_record: ['id', 'project_id', 'device_name', 'exception_type', 'exception_level', 'occurred_at', 'site_description', 'disposal_record', 'disposal_type', 'is_read', 'created_at'], history_report: ['id', 'project_id', 'report_name', 'device_id', 'construction_area', 'start_time', 'end_time', 'duration', 'compaction_area', 'pass_count', 'qualified_rate', 'avg_speed', 'avg_paving_temp', 'avg_compaction', 'exception_count', 'created_at'], } diff --git a/src/service/rtkTrack.ts b/src/service/rtkTrack.ts index 42f257f..71e5b4b 100644 --- a/src/service/rtkTrack.ts +++ b/src/service/rtkTrack.ts @@ -11,12 +11,14 @@ export const rtkTrackTableSql = `CREATE TABLE IF NOT EXISTS rtk_track ( heading REAL, steel_wheel_temp REAL, compaction_value REAL, + pass_count INTEGER DEFAULT 0, + qualified_rate REAL DEFAULT 0, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (work_record_id) REFERENCES work_record(id) )` export interface RtkTrack { - id?: number // 主键,自增 + readonly id?: number // 主键,自增 work_record_id: number // 所属作业记录 ID,关联 work_record.id latitude?: number // 纬度 longitude?: number // 经度 @@ -24,6 +26,8 @@ export interface RtkTrack { heading?: number // 航向角度(度) steel_wheel_temp?: number // 钢轮温度 compaction_value?: number // 压实度 + pass_count?: number // 压实遍数,默认 0 + qualified_rate?: number // 压实合格率,默认 0 created_at?: string // 创建时间,默认当前时间 } diff --git a/src/service/seed.ts b/src/service/seed.ts index 0619b77..d3e493d 100644 --- a/src/service/seed.ts +++ b/src/service/seed.ts @@ -72,7 +72,7 @@ async function seedWorkRecord() { /** * 插入 RTK 轨迹假数据(3条) - * 字段:work_record_id / latitude / longitude / speed / heading / steel_wheel_temp / compaction_value + * 字段:work_record_id / latitude / longitude / speed / heading / steel_wheel_temp / compaction_value / pass_count / qualified_rate */ async function seedRtkTrack() { const data = [ @@ -84,6 +84,8 @@ async function seedRtkTrack() { heading: 90.0, steel_wheel_temp: 65.2, compaction_value: 92.3, + pass_count: 3, + qualified_rate: 92.3, }, { work_record_id: 1, @@ -93,6 +95,8 @@ async function seedRtkTrack() { heading: 92.5, steel_wheel_temp: 66.0, compaction_value: 93.1, + pass_count: 4, + qualified_rate: 93.1, }, { work_record_id: 2, @@ -102,6 +106,8 @@ async function seedRtkTrack() { heading: 180.0, steel_wheel_temp: 68.5, compaction_value: 95.0, + pass_count: 5, + qualified_rate: 95.0, }, ]