Commit Graph

151 Commits

Author SHA1 Message Date
lzh
fc1bc609e6 test(ops): 修复测试代码中 isNull() 参数匹配问题
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
使用 any(Long.class) 替代 isNull() 以正确匹配 Long 类型参数

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 02:45:05 +08:00
lzh
83c9fb98d7 test(ops): 修复测试代码中的参数验证问题
- 修复 broadcast 方法验证,使用 isNull() 匹配 orderId 参数

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 02:43:02 +08:00
lzh
3c3443aef0 test(ops): 修复测试代码以适配方法签名变更
- 修复 sendPriorityUpgradeNotification 方法调用,添加 orderId 参数
- 修复 broadcast 方法调用,添加 ttsFlag 参数

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 02:42:04 +08:00
lzh
c6610e97f0 fix(ops): 修复 TtsQueueConsumer 中 Set/List 类型不匹配问题
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
修复了 redisTemplate.keys() 返回 Set<String> 但代码声明为 List<String> 的类型不匹配问题

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 02:26:47 +08:00
lzh
0a0f6be68e 修复 TtsQueueConsumer 缺少 Resource 注解导入
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-01 02:17:18 +08:00
lzh
2afc173e18 修复 ops_business_event_log 表中日志缺少 targetType 和 targetId 的问题
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-01 02:05:41 +08:00
lzh
41c4f57f05 新增 TTS 队列相关文件 2026-02-01 02:05:08 +08:00
lzh
fecaa28bc7 feat(ops): 优化工单查询语音播报内容
- 播报当前工单作业区域(替代工单标题)
- 播报剩余待办工单数量
- 简化播报文案,更人性化

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 01:49:35 +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
5d8c4045d4 refactor(ops): 简化AreaDevice与BadgeDevice服务实现
- AreaDeviceService: 移���设备索引缓存逻辑(由IoT模块管理)
- AreaDeviceServiceImpl: 简化实现,直接查询数据库
- BadgeDeviceStatusService: 更新接口方法签名
- BadgeDeviceStatusServiceImpl: 修复语法错误,简化实现
- BadgeDeviceStatusEventListener: 适配事件处理逻辑
- CleanOrderEventListener: 更新事件处理

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:57:38 +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
b73ef4f39f fix(ops): 迁移updateStatus修复到Enhanced实现
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
REMOVED 状态改为同步更新 Redis,避免自动派单查询到已完成任务

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:05:26 +08:00
lzh
009fab543f refactor(ops): 删除重复的OrderQueueServiceImpl实现类
保留 OrderQueueServiceEnhanced 作为唯一实现,避免Bean冲突

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:53:41 +08:00
lzh
f9742137c5 fix(ops): 修复工单队列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
- Redis Sorted Set 改用 queueId 作为 member,详细信息存储在 Hash
- REMOVED 状态同步更新 Redis,避免自动派单查询到已完成任务
- 新增 getWaitingTasksByUserIdFromDb() 强制从 MySQL 读取最新数据
- 修复队列状态枚举值统一为大写

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:28:27 +08:00
lzh
5c31f5eb71 fix(ops): 修复改为分步构建责任链-id生成
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-31 00:54:13 +08:00
lzh
b95674b9e0 fix(ops): 修复改为分步构建责任链-不构建队列bug
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-31 00:08:43 +08:00
lzh
4d34951799 fix(ops): 修复工单队列一致性与设备状态覆盖问题
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 14:50:38 +08:00
lzh
28b9a32cb6 feat(ops): 事件日志增强与空闲设备待办检查
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
- 实现空闲设备待办工单检查定时任务

- 修复事件日志 orderId 关联 (使用 targetId)

- 增强语音播报和工单事件的日志完整性
2026-01-30 12:03:24 +08:00
lzh
80278f64f6 fix(ops): 修改新工单语音 2026-01-30 10:52:53 +08:00
lzh
f818641b1a fix(ops): 更新工单完成语音播报模板
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:46:36 +08:00
lzh
abd5933877 fix(ops): 入队和派单时设置assigneeDeviceId,修复查询工单功能 2026-01-30 09:45:36 +08:00
lzh
fe92b4cafb fix(ops): 工单完成添加语音播报和assigneeId传递 2026-01-30 09:45:16 +08:00
lzh
1bdcfa1cc0 fix(ops): 启动时初始化BEACON类型配置缓存,解决SignalLoss定时任务获取配置失败问题
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 01:25:14 +08:00
lzh
260d4b8220 fix(ops): 修复区域路径拼接重复问题
在构建区域完整路径时,跳过当前区域ID,避免parentPath中
包含当前区域时导致名称重复拼接

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
2026-01-30 00:17:38 +08:00
lzh
fee974912e feat(ops): 添加工单到岗语音播报
1. VoiceBuilder 新增 buildOrderArrived() 方法
2. 到岗时播报"已到达作业区域,请开始清洁作业"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
2026-01-29 23:36:56 +08:00
lzh
d97125fdf6 feat(ops): 优化工单播报语音内容,自动生成区域完整路径
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. 语音播报模板改为"工单来啦,请前往XXX进行清洁"
2. 工单创建时自动根据areaId从ops_bus_area构建完整路径
3. 使用parentPath批量查询上级区域,避免N+1问题

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
2026-01-29 23:13:50 +08:00
lzh
3ec7590e12 fix(ops): 修复派单时未更新工单 assigneeId 的问题
工单派发(PENDING -> DISPATCHED)时,更新工单表的 assigneeId 字段,
确保 BadgeDeviceStatusEventListener 能正确获取执行人设备ID并更新 Redis 缓存。

Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
2026-01-29 23:04:43 +08:00
lzh
9d2bbabf1c feat(ops): 添加事件发布和设备状态监听器日志便于排查
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. OrderEventPublisherImpl 状态变更事件发布日志改为 info 级别
2. BadgeDeviceStatusEventListener 状态变更日志改为 info 级别
3. 优化日志格式,输出 orderType 便于排查事件接收问题

Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
2026-01-29 22:17:03 +08:00
lzh
20ea25cf55 fix(ops): 修复事件重复发布问题并清理遗留代码
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. 移除 OrderStateMachine 中重复的事件发布逻辑
   - OrderStateMachine 不再发布 OrderStateChangedEvent
   - 事件发布统一由 EventPublishHandler 处理

2. 删除 enqueueAndDispatch 遗留方法
   - 该方法已无用,被 DispatchEngine 策略模式替代
   - 删除接口声明、实现类和测试用例

3. 清理无调用的备用接口方法
   - enqueueOrderOnly、dispatchToCleaner、confirmOrder、
     startWorkingOnBeacon、autoCompleteOnSignalLost、
     playVoiceForNewOrder、playVoiceForQueuedOrder、
     playVoiceForNextTask、upgradePriorityToP0、
     calculateActualDuration
   - 保留接口但标记 @Deprecated

问题修复:
- 工单派发时 TTS 语音播报不再重复触发
- 调度逻辑统一走 DispatchEngine 策略模式

Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
2026-01-29 21:38:50 +08:00
lzh
ab1cc2bc62 fix(ops): 事件监听从TransactionalEventListener改为EventListener
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 19:32:43 +08:00
lzh
d8fd0aa389 fix(ops): 修复直接派单场景事件发布问题并统一日志规范
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. 修复 QueueSyncHandler 在直接派单场景下提前返回的问题
2. 修复 EventPublishHandler 日志级别便于排查
3. 统一 LogType.eventType 为大写下划线格式

Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
2026-01-29 19:01:27 +08:00
lzh
f44f422ba8 fix(ops): 修复设备上线时未更新区域索引缓存的问题
问题:设备上线时 updateBadgeOnlineStatus() 只更新了 currentAreaId 字段,
未调用 addToAreaIndex() 更新 ops:area:badges:{areaId} 缓存,
导致设备上线后区域设备查询返回空。

修复:当 areaId 不为空时,同时调用 addToAreaIndex() 更新区域设备索引缓存。

Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
2026-01-29 18:38:10 +08:00
lzh
569ca2c0da fix(ops): 修复区域设备索引缓存问题并优化查询性能
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. 修复 listAvailableBadges() 读穿透 bug
   - 改用 areaDeviceService.getDeviceIdsByArea() 获取设备列表
   - 缓存未命中时自动从数据库重建

2. 优化 N+1 查询问题
   - listBadgesByArea() 和 listAvailableBadges() 使用 batchGetBadgeStatus() 批量查询

3. 简化 BadgeDeviceStatusServiceImpl
   - 移除重复的 AREA_BADGES_KEY_PREFIX 常量
   - 区域索引操作委托给 AreaDeviceService 处理

4. 增强缓存可靠性
   - getDeviceIdsByArea() 支持读穿透缓存
   - 缓存 TTL 从 30 分钟延长到 24 小时

Co-Authored-By: Claude (MiniMax-M2.1) <noreply@anthropic.com>
2026-01-29 18:32:34 +08:00
lzh
68e432ead7 fix(ops): BadgeDeviceStatusInitializer修复无租户上下文的启动阶段可以全量同步
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 16:53:27 +08:00
lzh
44c7d7b9f5 refactor(ops): simplify badge status management by removing redundant heartbeat logic
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 13:04:19 +08:00
lzh
da19b87377 fix(ops): strictly control heartbeat logic to prevent ghost online status 2026-01-29 11:55:51 +08:00
lzh
1e5842756e config(ops): enable feign client for IotDeviceStatusQueryApi 2026-01-29 11:50:49 +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
afa5837160 fix(ops): 修复区域设备索引初始化查询条件
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
问题:selectListByAreaIdAndRelationType(null, "BADGE") 生成 WHERE area_id = NULL
导致查询结果为空,索引无法初始化

修复:areaId 为 null 时不添加该查询条件,查询所有 BADGE 类型设备

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 00:04:53 +08:00
lzh
ff858fc3b8 fix(ops): 修复区域设备 API 路径不匹配问题
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
问题:Feign 客户端调用 /rpc-api/ops/area-device 但 Controller 映射为 /ops-api/area-device

修复:
- Controller @RequestMapping 改为使用 ApiConstants.PREFIX
- 路径统一为:/rpc-api/ops/area-device

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 23:32:47 +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
10eeb774a6 fix(ops): 修复其他id生成问题
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-28 18:12:23 +08:00
lzh
280562bc27 fix(ops): 修复工单业务日志id生成问题-去除这个引入
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-28 18:01:53 +08:00
lzh
d7c2a0800b fix(ops): 修复工单业务日志id生成问题 2026-01-28 18:01:03 +08:00
lzh
9ac1678031 fix(ops): 修复工单id生成问题
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-28 17:09:43 +08:00
lzh
862cbc3931 fix(test): 修正测试SQL中orderPriority为数字类型
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
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:53:12 +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
767449dec4 feat(ops): 新增 trigger_data 字段存储触发详情
- OpsOrderDO: 新增 triggerData 字段(JSON 字符串)
- 存储触发时的详细信息:
  - 客流阈值:actualCount, baseValue, threshold, exceededCount
  - 蓝牙信标:rssi, beaconMac
  - 信号丢失:durationMs, timeoutSeconds
- CleanOrderServiceImpl: 序列化 triggerData 到 JSON 存储

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-27 12:04:19 +08:00
lzh
d9ba73a4bc test: Add CleanOrderScenarioIT and finalize test coverage
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-25 22:33:16 +08:00
lzh
a3909a0482 test: Adapt tests to master branch refactoring (handlers and dispatch logic) 2026-01-25 18:41:00 +08:00