Commit Graph

71 Commits

Author SHA1 Message Date
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
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
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
abd5933877 fix(ops): 入队和派单时设置assigneeDeviceId,修复查询工单功能 2026-01-30 09:45:36 +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
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
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
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
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
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
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
a8d3fc84d2 refactor(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
- CleanOrderService: 将所有 cleanerId 参数改为 deviceId
- CleanOrderAutoCreateReqDTO: 新增 triggerData 字段
- EventPublishHandler: 添加 assigneeId/urgentOrderId 到 payload
- OrderQueueService: 修正注释说明 userId 实际为 deviceId
- EventDomain: 新增 AUDIT 域
- 更新测试用例适配接口变更

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:23:37 +08:00
lzh
7cf8e5ed2f fix(ops): fix DispatchEngine instantiation error in test config
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-24 19:20:43 +08:00
lzh
fc28afd1c9 feat(ops): 补充工单状态变更业务日志
- pauseOrder: 记录工单暂停日志
- resumeOrder: 记录工单恢复日志
- interruptOrder: 记录P0插队打断日志
- cancelOrder: 记录工单取消日志
- completeOrder: 记录手动完成日志

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 17:48:27 +08:00
lzh
a36ed90c3f feat(ops): 扩展调度上下文支持设备ID字段
新增 assigneeDeviceId 字段,用于同时记录人和设备的场景。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:47:13 +08:00
lzh
457fc556e2 refactor(ops): 移除保洁工单清理日志相关代码
- 删除 OpsOrderCleanLogDO 实体类
- 删除 OpsOrderCleanLogMapper Mapper接口
- 统一使用新的业务日志框架

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:44:07 +08:00
lzh
5063fc8dd1 refactor(ops): 移除旧的publisher模式
- 删除 BusinessLogPublisher 接口
- 删除 DefaultBusinessLogPublisher 实现
- 改用 recorder 模式替代 publisher 模式

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:43:54 +08:00
lzh
a49994cc57 refactor(ops): 重构业务日志注解和切面
- 更新 BusinessLog 注解以支持新的事件日志模型
- 更新 BusinessLogAspect 切面使用 EventLogRecorder

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:43:39 +08:00
lzh
a82b59ac46 feat(ops): 新增业务日志枚举类
- 新增 EventDomain:事件领域枚举
- 新增 EventLevel:事件级别枚举

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:43:32 +08:00
lzh
c88dc3fc10 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
- 包名从 handler 改为 listener
- 使用 TransactionalEventListener 替代 EventListener
- 线程池名修正为 ops-task-executor
- 状态从 ASSIGNED 改为 PENDING
- 清理测试文件中的重复代码

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:05:39 +08:00
lzh
8590f3c044 test: 完善 OrderStateMachine 和 OpsOrderService 测试用例 2026-01-21 09:30:29 +08:00
lzh
22fad4ad31 test: add cleaning flow tests for OpsOrderService 2026-01-20 18:07:05 +08:00
lzh
c2bf98be5a test: add unit tests for OpsOrderService 2026-01-20 18:04:40 +08:00
lzh
e96773daf7 test: add unit tests for OrderStateMachine 2026-01-20 18:02:35 +08:00
lzh
6d4c2c60cf refactor(ops): 移除 ops-core 中的 BadgeDeviceStatusService
将 BadgeDeviceStatusService 从 ops-core 模块迁移至 environment 模块:
- 删除 ops-biz/core/badge/BadgeDeviceStatusService.java
- 删除 ops-biz/core/badge/BadgeDeviceStatusServiceImpl.java

该服务属于保洁业务特定逻辑,应放置在 environment-biz 模块中。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 16:16:06 +08:00
lzh
eedef70581 feat(ops): add confirm event DTO and update audit DTO 2026-01-19 14:41:05 +08:00
lzh
a71a29f548 fix(ops): implement missing updateBadgeArea method 2026-01-19 14:41:00 +08:00
lzh
c448daed03 fix(ops): 修复编译错误refactor-order-operations 2026-01-19 13:38:53 +08:00
lzh
568d37a0be feat(ops): refactor-order-operations 2026-01-19 13:32:23 +08:00
lzh
82966dc61b feat(ops): add-iot-clean-order-integration阶段三-业务执行与审计 2026-01-17 17:20:35 +08:00
lzh
683b99be21 fix: 删除同名OpsOrderQueueMapper
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-15 16:37:34 +08:00
lzh
4a8c4d744c feat(ops): 增强工单队列服务并新增 RPC 配置 2026-01-15 16:14:32 +08:00
lzh
6be3e5b0e5 chore: 【ops】基础工单单元测试 2026-01-09 17:42:24 +08:00
lzh
75a9df9f9f chore: 【ops】异步任务配置 2026-01-09 17:41:37 +08:00
lzh
9dd2dd35f1 chore: 【ops】实体调整 2026-01-09 17:39:14 +08:00
lzh
ea3c7829e9 chore: 【ops】工单业务日志注解 2026-01-09 17:38:29 +08:00
lzh
5974c767d5 chore: 【ops】工单基础操作修改 2026-01-09 17:38:01 +08:00
lzh
23830961c8 chore: 【ops】保洁相关Mapper迁移 2026-01-09 16:50:51 +08:00