feat(device): 新增设备定位查询接口并修复定位数据存储问题
- 新增 GET /{sn}/location 接口,支持网页端查询设备最新定位信息
- 新增 DeviceLocationVO 视图对象用于返回定位数据
- 在 LocationService 中实现 getLatestBySn 方法
- 修复 map_error 字段类型错误:从 INT 改为 VARCHAR(255)
- 修复移动端上报定位时 lastSuccessfulTime 缺失问题,由服务端统一写入
This commit is contained in:
9
sql/sys_sn_location_fix_map_error.sql
Normal file
9
sql/sys_sn_location_fix_map_error.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
-- 修复 sys_sn_location.map_error 列类型
|
||||
-- 问题:代码中 map_error 为 String(存 '-' 表示成功,或真实错误信息),
|
||||
-- 但数据库列当前为 INT,导致写入 '-' 时报错:
|
||||
-- "Incorrect integer value: '-' for column 'map_error'"
|
||||
-- 解决:将 map_error 改为 VARCHAR,使其可同时保存成功标记与失败原因。
|
||||
|
||||
ALTER TABLE sys_sn_location
|
||||
MODIFY COLUMN map_error VARCHAR(255) NULL DEFAULT NULL
|
||||
COMMENT '定位失败原因,成功时为 -';
|
||||
Reference in New Issue
Block a user