Commit Graph

103 Commits

Author SHA1 Message Date
lzh
7d1012bba7 fix(iot,ops): 修复退出检测停滞、TTS多租户重复播报,精简语音通知
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
1. 蓝牙信号缺失补偿:设备属性上报不含 bluetoothDevices 时注入 null,
   避免 RSSI 滑动窗口因无数据停滞导致退出检测延迟
2. TTS 多租户去重:TtsQueueMessage 携带 tenantId,processSingleQueue
   过滤非当前租户消息,解决 @TenantJob 导致同一播报被不同租户重复下发
3. 循环播报日志精简:仅在 broadcastLoop 启动时记录一次 TTS_SENT,
   后续重复播报不再写入 ops_business_event_log
4. 移除离岗 TTS 警告和入队语音播报,减少不必要的设备干扰

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 13:09:56 +08:00
lzh
b4de9d0df8 feat(config): 修改测试环境地址 2026-02-26 17:16:24 +08:00
lzh
5ee039b0bf feat(ops,iot): 工单语音播报循环机制 + 统一按键逻辑
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
核心改动:
- 新增循环播报机制:DISPATCHED 状态持续播报"工单来啦"直到按键确认
- 统一按键逻辑:confirmKeyId 和 queryKeyId 都路由到同一处理逻辑,
  根据工单状态智能判断行为(确认/查询/无工单提示)
- ARRIVED/COMPLETED 状态静默不播报,CANCELLED 保留取消播报
- 修复 P0:确认去重后按键不再静默,改为发查询事件给反馈
- 修复 P0:PAUSED 状态(P0打断)时停止被打断工单的循环播报
- 修复 P1:handleCompleted 补全 deviceId 兜底逻辑
- 修复 P1:stopLoop 只移除循环消息,保留非循环消息

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:13:03 +08:00
lzh
3e54094c3d fix(iot): 修复客流阈值触发时 IoT 模块未将区域配置回写至 Redis 缓存的问题
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-02-24 18:01:39 +08:00
lzh
a68ce9a28a fix(xxl-job): 配置executor IP和端口解决跨服务器回调失败
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
XXL-Job Admin部署在Infra服务器,executor运行在Prod服务器的Docker容器中,
容器内部IP不可达,需指定宿主机IP和独立端口供Admin回调。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:03:39 +08:00
lzh
bec46c2919 fix(rocketmq): 修正ACL配置位置到producer/consumer节点下
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
rocketmq-spring-boot-starter的access-key/secret-key需配置在
producer和consumer节点下而非rocketmq根节点,同时为所有
@RocketMQMessageListener注解添加accessKey/secretKey属性。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 16:19:42 +08:00
lzh
748b09d355 fix(rocketmq): 添加腾讯云TDMQ ACL认证配置解决连接失败
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
修复RocketMQ发送消息报"No accessKey is configured"错误,
统一各模块环境变量名为ROCKETMQ_NAMESRV_ADDR。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:50:44 +08:00
lzh
91de356a67 fix(iot-gateway): 修正RPC环境变量名为VIEWSH_IOT_GATEWAY_RPC_URL
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
Spring Boot relaxed binding将viewsh.iot.gateway.rpc.url映射为
VIEWSH_IOT_GATEWAY_RPC_URL,而非VIEWSH_GATEWAY_RPC_URL。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:17:06 +08:00
lzh
e15ebfd3d4 fix(iot-gateway): 修正RPC环境变量名不匹配导致连接失败
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
docker-compose中VIEWSH_IOT_GATEWAY_RPC_URL与yaml期望的VIEWSH_GATEWAY_RPC_URL不一致,
导致iot-gateway回退到默认值127.0.0.1:48091,容器间无法通信。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:39:37 +08:00
lzh
26e909cce9 fix(deploy): 迁移Nacos/TDengine/XXL-Job至Infra服务器(172.17.16.7)
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
将基础设施服务地址从Prod服务器(172.17.16.14)统一迁移至Infra服务器(172.17.16.7):
- Nacos: 172.17.16.14:8848 → 172.17.16.7:8848
- TDengine: 172.17.16.14:6041 → 172.17.16.7:6041
- XXL-Job: 172.17.16.14:19090 → 172.17.16.7:19090

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:22:02 +08:00
lzh
547da7cfd2 refactor(deploy): 迁移CI/CD至双服务器架构
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
- Jenkinsfile: Registry改为Infra内网172.17.16.7:5000,部署目标改为Prod内网172.17.16.14
- docker-compose: 镜像源改为172.17.16.7:5000,MySQL改为172.17.16.8,Redis改为172.17.16.13,RocketMQ改为腾讯云TDMQ
- 所有模块application-prod.yaml: 统一更新MySQL/Redis/RocketMQ默认连接地址
- deploy.sh: Registry地址同步更新

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 10:41:54 +08:00
lzh
631612951c fix(iot): 修复客流统计持久化无数据和租户隔离问题
1. 解耦统计采集与工单触发:将 incrementDaily() 提前到配置检查之前,
   即使设备未配置工单触发规则,统计数据也能正常写入 Redis
2. 修复租户隔离:Redis Hash 中写入 tenantId,持久化任务读取后在
   正确的租户上下文中执行 upsert 和区域查询
3. 修复清理任务:使用 TenantUtils.executeIgnore() 避免 XXL-Job
   线程无租户上下文导致 NPE

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 13:18:48 +08:00
lzh
1147ae4503 fix(iot-gateway): 修改3d11正确ProductKey
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-02-10 10:14:54 +08:00
lzh
41ffffe431 fix(iot): 修复 3D11 编解码器上报时间和数据过滤
- reportTime 改用 time 字段(设备上传时间)而非 endTime
- 新增 24 小时数据过滤,超时数据舍弃并返回 null
- 数据舍弃时仍返回成功响应,避免设备反复重试

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 13:52:18 +08:00
lzh
cc6b11f4e9 feat(iot): 对接 3D11 单目客流计数器
在 IoT Gateway 的 Vert.x Router 上注册 /api/camera/* 专用路由,
桥接 3D11 摄像头的心跳和数据上报到现有消息总线和编解码体系。

- 新建 Camera3D11 DTO(心跳请求、数据上报请求、统一响应)
- 新建 IotCamera3D11Codec 编解码器(TYPE=CAMERA_3D11)
- 新建 IotCameraUpstreamHandler 处理心跳和数据上报
- productKey 通过 application.yaml 配置,未配置时不注册路由
- 心跳上报间隔设为 1 分钟

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 00:23:44 +08:00
lzh
5edbc9f287 fix(ops): 修复工牌关机重启后工单状态不一致漏洞
问题场景:
1. 工牌有执行中工单(ARRIVED)后关机
2. 工牌重启,Redis状态丢失/过期,设备变为IDLE
3. 系统推送新工单
4. 信标检测仍在用旧工单配置,导致状态混乱

修复方案:
1. 派发新工单前检查并清理/取消旧工单残留
2. 设备离线时自动取消未完成的工单
3. 信标检测器增加工单切换检测,清理旧检测状态

涉及文件:
- BadgeDeviceStatusEventListener: 增加旧工单清理和离线事件监听
- BadgeDeviceStatusServiceImpl: 设备离线时发布事件
- BeaconDetectionRuleProcessor: 工单切换检测

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 22:59:06 +08:00
lzh
13571faa59 refactor(iot,ops): 重构客流计数器重置为按区域删除阈值 key
- ResetTrafficCounterReqDTO: 废弃 newBaseValue 字段
- IotDeviceControlApiImpl: 重置逻辑改为通过区域关联查询后删除阈值 key
- CleanOrderEventListener: 简化异步重置调用,移除 triggerData 依赖

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:37:23 +08:00
lzh
46024fd043 refactor(iot): 重构客流计数器为增量累加模式,支持 people_out
- 删除旧 TrafficCounterBaseRedisDAO(基准值模式),新增 TrafficCounterRedisDAO
  支持阈值计数器(达标后重置)和当日累积统计(用于报表)
- TrafficThresholdRuleProcessor 改为增量原子累加,消除基准值校准逻辑
- CleanRuleProcessorManager 路由增加 people_out 支持
- TrafficCounterBaseResetJob 改为每日清除阈值计数器,持久化职责移交 Ops 模块
- 使用 SCAN 替代 KEYS 避免阻塞 Redis

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:34:03 +08:00
lzh
955c825e2c feat(ops,iot): 保洁前端 API 层和区域管理新增
新增保洁业务前端 API 接口层(工牌、工单、仪表盘)和运营区域管理完整功能,包含 Service/Controller/Test 三层结构。

主要功能:

1. IoT 设备查询 API(RPC 接口)
   - IotDeviceQueryApi: 提供设备简化信息查询
   - IotDeviceSimpleRespDTO: 设备简化 DTO

2. 保洁工牌管理
   - CleanBadgeService/Impl: 工牌通知、优先级调整、手动完成
   - BadgeNotifyReqDTO/UpgradePriorityReqDTO/ManualCompleteOrderReqDTO

3. 保洁工单管理
   - CleanWorkOrderService/Impl: 工单时间线查询

4. 保洁仪表盘
   - CleanDashboardService/Impl: 快速统计(待处理/进行中/已完成/在线工牌数)
   - QuickStatsRespDTO: 快速统计 DTO

5. 运营区域管理(Ops Biz)
   - OpsBusAreaService/Impl: 区域 CRUD(支持树形结构、分页查询)
   - AreaDeviceRelationService/Impl: 区域设备关联管理(绑定/解绑/批量更新)
   - OpsBusAreaMapper/AreaDeviceRelationMapper: 扩展 MyBatis 批量方法
   - 7 个 VO 类:CreateReqVO/UpdateReqVO/PageReqVO/RespVO/BindReqVO/RelationRespVO/DeviceUpdateReqVO

6. 前端 Controller(Ops Server)
   - OpsBusAreaController: 区域管理 REST API(11 个接口)
   - AreaDeviceRelationController: 设备关联 REST API(8 个接口)
   - CleanBadgeController: 工牌管理 REST API(5 个接口)
   - CleanDashboardController: 仪表盘 REST API(1 个接口)
   - CleanDeviceController: 设备管理 REST API(2 个接口)
   - CleanWorkOrderController: 工单管理 REST API(2 个接口)

7. 测试覆盖
   - OpsBusAreaServiceTest: 区域服务测试(284 行)
   - AreaDeviceRelationServiceTest: 设备关联测试(240 行)
   - OpsBusAreaControllerTest: 区域 Controller 测试(186 行)
   - AreaDeviceRelationControllerTest: 设备关联 Controller 测试(182 行)

8. API 层扩展
   - ErrorCodeConstants: 错误码常量(区域、设备关联)
   - NotifyTypeEnum: 通知类型枚举(语音、文本、震动)
   - 4 个 Badge/Order DTO: BadgeStatusRespDTO/BadgeRealtimeStatusRespDTO/OrderTimelineRespDTO

9. RPC 配置
   - RpcConfiguration: 注入 IotDeviceQueryApi

影响模块:Ops API、Ops Biz、Ops Server、Ops Environment Biz、IoT API、IoT Server

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 22:42:45 +08:00
lzh
b4fad17254 feat(iot): 设备事件增加 nickname 字段
在 BaseDeviceEvent 中新增 nickname 字段,用于存储设备的用户可读显示名称(如"张三的工牌"),
IotDeviceServiceImpl 在发送设备状态变更事件时自动填充该字段。

变更范围:
- BaseDeviceEvent: 新增 nickname 字段
- IotDeviceServiceImpl: 事件发送时携带 nickname

影响模块:IoT Core、IoT Server

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 22:26:37 +08:00
lzh
46096a6e6b fix(iot,ops): 确保信标相关审计事件包含orderId以支持工单关联查询
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
修改内容:
1. BeaconDetectionRuleProcessor.publishAuditEvent 添加 orderId 参数
   - BEACON_ARRIVE_CONFIRMED 事件包含当前工单ID
   - BEACON_LEAVE_WARNING_SENT 事件从设备状态获取工单ID
   - TTS_REQUEST 事件不包含工单ID(非工单特定)

2. SignalLossRuleProcessor.publishAuditEvent 添加 orderId 参数
   - BEACON_COMPLETE_REQUESTED 事件包含当前工单ID
   - COMPLETE_SUPPRESSED_INVALID 事件从设备状态获取工单ID

3. CleanOrderAuditEventHandler 使用 EventLogRecord.builder()
   - 显式设置 targetId 和 targetType 字段
   - 确保 targetType="order" 当 orderId 存在时

影响范围:
- ops_business_event_log 表新增记录将正确包含 targetId 和 targetType
- 支持按工单ID查询所有相关审计日志
- 解决信标到岗/离岗/完成事件缺失工单关联的问题

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:26:06 +08:00
lzh
d2f2e06c58 test: 更新测试数据以适配配置模型变更
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
- SignalLossRuleProcessorTest: 更新测试用例
- area_device_relation_full_config.sql: 移除buttonEvent配置
- badge_device_dispatch_test_data.sql: 更新测试数据

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:57:52 +08:00
lzh
3839da2966 refactor(iot): 适配规则处理器使用新的配置查询方法
- ButtonEventRuleProcessor: 改为从设备 config 读取按键配置
- TrafficThresholdRuleProcessor: 使用 getConfigWrapperByDeviceId 方法
- BeaconDetectionRuleProcessor: 使用 getConfigByAreaIdAndRelationType 方法
- SignalLossRuleProcessor: 使用 getConfigByAreaIdAndRelationType 方法
- CleanRuleProcessorManager: 更新处理流程
- 添加性能优化 TODO 注释

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:57:23 +08:00
lzh
89e68eceb2 refactor(iot): 重构配置模型与实现双层缓存优化
- 将 buttonEvent 配置从区域级移至设备级(iot_device.config)
- 添加 getConfigWrapperByDeviceId 方法支持一对一设备查询
- 实现设备索引缓存 + 区域配置缓存的双层缓存设计
- 添加设备类型常量 DEVICE_RELATION_TYPES
- 完善 JavaDoc 注释说明配置层级划分

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:57:03 +08:00
lzh
dbf96e521a fix(beacon): 修复RSSI滑动窗口检测逻辑 - 窗口大小改用max(enter/exit.windowSize) - 进入/退出检测分别使用各自的windowSize子窗口 - 到岗确认时清理RSSI窗口避免历史脏数据
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-30 10:24:20 +08:00
lzh
895fcc2712 fix(iot): 定时任务设置租户上下文,确保RocketMQ消息正确携带租户信息
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-30 09:09:08 +08:00
lzh
6ff40b61d7 fix(beacon): 修复信标检测重复触发到岗事件bug - determineState优先检查本地arrivedTime判断状态 - 离岗警告阶段保持IN_AREA状态不清除arrivedTime - arrivedTime仅在工单完成时由SignalLossRuleProcessor清除 2026-01-30 00:50:01 +08:00
lzh
13c9b6564f fix(iot): 修复事件上报处理逻辑,支持 button_event 事件
1. CleanRuleProcessorManager 新增 processEventData() 方法
   - 区分处理属性上报和事件上报
   - 事件上报从 identifier 字段提取事件类型

2. ButtonEventRuleProcessor.parseButtonId() 支持事件上报格式
   - 属性上报:value 直接是按键ID
   - 事件上报:value 是 Map,包含 keyId 和 keyState 字段

Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
2026-01-29 21:28:43 +08:00
lzh
5142b38d12 refactor(ops): optimize badge device status management and add sync job
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-29 11:35:11 +08:00
lzh
7f53debc43 fix(iot): 添加 AreaDeviceApi 到 Feign 客户端配置
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
修复问题:
- 启动时 Bean 创建失败:iotCleanRuleMessageHandler 注入依赖失败
- 原因:@EnableFeignClients 未包含 AreaDeviceApi

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 23:14:58 +08:00
lzh
d87d4dd914 refactor(ops,iot): 重构区域设备关联模块并添加Redis缓存
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
主要变更:
1. 将 ops_area_device_relation 表所有权移至 Ops 模块
   - 新增 OpsAreaDeviceRelationDO、Mapper、Service、Controller
   - 新增 AreaDeviceApi Feign 接口供其他模块调用
   - ���除 IoT 模块中的旧 DO 和 Mapper

2. 实现 Redis JSON 缓存(IoT 可读)
   - 统一缓存 Key: ops:area:device:{deviceId}
   - 统一缓存 Key: ops:area:{areaId}:type:{relationType}
   - TTL: 30分钟,空值缓存: 1分钟

3. IoT 模块通过 Feign 调用 Ops
   - 优先读 Redis 缓存,未命中时调用 Ops API
   - 缓存由 Ops 模块统一管理

4. 删除 IoT 模块废弃文件
   - OpsAreaDeviceRelationDO.java
   - OpsAreaDeviceRelationMapper.java

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 22:35:41 +08:00
lzh
5cc5cd5238 fix(iot): 统一CleanOrderCreateEvent.priority类型为Integer
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:50:35 +08:00
lzh
3c92bfc02c fix: 统一工单优先级类型为Integer
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
修改:
- TrafficThresholdConfig.orderPriority: String -> Integer
- CleanOrderCreateEventDTO.priority: String -> Integer
- CleanOrderCreateEventHandler: 移除Integer.parseInt调用

与数据库tinyint类型保持一致

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:12:24 +08:00
lzh
eae021c464 fix(iot): 修复保洁规则处理器租户上下文丢失问题
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
使用 TenantUtils.execute 包装消息处理逻辑,确保 Redis Stream
异步线程中正确传递租户上下文,避免数据库查询时报错
"TenantContextHolder 不存在租户编号"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 17:01:57 +08:00
lzh
b5972b03a8 fix(iot): 修改客流计数器上传数据解析时间作为reportTime
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-27 15:22:48 +08:00
lzh
35c120d883 fix(iot): 修改客流计数器应答升级链接
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
2026-01-26 16:35:50 +08:00
lzh
a3909a0482 test: Adapt tests to master branch refactoring (handlers and dispatch logic) 2026-01-25 18:41:00 +08:00
lzh
130048d958 Merge remote-tracking branch 'origin/master' into test/cleaning-coverage 2026-01-25 18:29:47 +08:00
lzh
373f379b01 refactor(iot): 移除Redis DAO,使用统一服务接口
- 删除 DeviceCurrentOrderRedisDAO
- 各 RuleProcessor 直接调用 BadgeDeviceStatusService
- 简化调用链,移除中间层

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:23:15 +08:00
lzh
8782a530fe feat(ops): 统一语音播报模板管理
- 新建 CleanNotificationConstants 类,集中管理所有播报模板
- VoiceTemplate: 定义各种场景的播报模板常量
- VoiceBuilder: 提供构建器方法,支持参数化和标题截断
- NotifyParamsBuilder: 站内信参数构建辅助方法
- 更新 CleanOrderAuditEventHandler 查询播报为显示当前工单而非位置

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:21:04 +08:00
lzh
577fd25f8e refactor(iot): 清理保洁配置服务中的冗余缓存设计
删除未使用的方法和缓存 key:
- getConfigByDeviceId() 方法:未被任何地方调用
- CONFIG_DEVICE_KEY_PATTERN:仅用于已删除的方法
- CONFIG_AREA_KEY_PATTERN:定义了但从未使用
- formatDeviceKey() 和 formatAreaKey():对应方法已删除

简化后的设计只保留两个缓存 key:
- CONFIG_WRAPPER_KEY_PATTERN:按 deviceId 缓存完整配置
- CONFIG_AREA_TYPE_KEY_PATTERN:按 areaId + relationType 缓存

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:49:29 +08:00
lzh
54b5e7ec77 config(iot): 修改网关 RPC 地址端口
48080 → 48091

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:38:44 +08:00
lzh
0ee7611a7d feat(iot): 优化保洁工单配置缓存服务
- 新增空值缓存机制,防止缓存穿透
- 新增区域+类型配置查询缓存
- 统一缓存 TTL 为 5 分钟,空值缓存 60 秒
- 新增缓存失效方法 evictAreaCache

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:38:36 +08:00
lzh
0a5fe13e68 refactor(iot): 移除属性保存中的同步规则处理
规则处理已迁移到独立消息订阅者 IotCleanRuleMessageHandler
通过订阅同一消息总线的 Topic 异步处理,不再阻塞属性保存主流程

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:38:28 +08:00
lzh
2a2cfb9030 fix(iot): 修复 TrafficThresholdRuleProcessor 编译错误
- 将 StringRedisTemplate 声明移至类顶部字段区域
- 修复变量使用顺序导致的编译错误

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:38:20 +08:00
lzh
22d7a31194 feat(iot): 新增保洁规则消息订阅者,实现规则处理异步解耦
新增 IotCleanRuleMessageHandler 订阅设备消息总线,与属性保存主流程解耦
新增 CleanRuleProcessorManager 统一管理保洁规则处理器

优化点:
- 独立消费组,不阻塞属性保存主流程
- 与场景规则引擎架构一致,便于维护
- 支持 PROPERTY_POST 和 EVENT_POST 两种消息类型

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:38:12 +08:00
lzh
382e4d6ae2 test: Fix master branch test configs and add comprehensive tests for Badge Device Dispatch and Signal Loss logic 2026-01-23 14:29:46 +08:00
lzh
bb1ee0be1d Merge branch 'master' of http://124.221.55.225:3000/XW-AIOT/aiot-platform-cloud into test/cleaning-coverage 2026-01-23 13:57:49 +08:00
lzh
ebbefe7980 Merge branch 'test/cleaning-coverage' 2026-01-23 13:49:00 +08:00
lzh
fffada3761 feat(iot): 调整信标和信号丢失处理器以支持配置拆分
配置已按设备类型拆分(BADGE/BEACON/TRAFFIC_COUNTER 各自存储),
工牌设备需要从区域的 BEACON 设备获取信标配置。

- BeaconDetectionRuleProcessor: 从区域 BEACON 设备获取 beaconPresence 配置
- SignalLossRuleProcessor: 从区域 BEACON 设备获取信标配置用于超时检测

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:47:04 +08:00