feat: 两步卡片状态机 + 安保工单对接 + 先到先得结单

- 新增 work_order_client.py:SHA256签名的工单API客户端(创建/自动结单)
- 企微卡片改为两步交互:确认接单→[已处理完成/标记误报]→终态
- 告警通知后自动创建工单,orderId存入alarm_event_ext
- 边缘端resolve支持先到先得:终态不可被覆盖
- 边缘端resolve后异步触发工单自动结单+卡片终态更新
- 新增WorkOrderConfig配置项

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-12 16:34:54 +08:00
parent d2085f73be
commit 6cbf89a38b
8 changed files with 521 additions and 57 deletions

View File

@@ -65,6 +65,11 @@ async def lifespan(app: FastAPI):
agent = get_agent_dispatcher()
agent.init(settings.agent)
# 初始化工单客户端
from app.services.work_order_client import get_work_order_client
wo_client = get_work_order_client()
wo_client.init(settings.work_order)
logger.info("AI 告警平台启动完成")
yield