- 3表: tk_tickets(状态机+受理角色/人+agent锁)/tk_messages(客户可见/内部备注)/tk_transfers(append-only流水) - core.py: 8态13迁移状态机全乐观锁; 转派候选动态查owner角色+'0'机构用户(不硬编码); 默认受理角色params可配(ticket_default_role=owner.maintainer) - agent.py: 异步poller(bid_flow范式), RAG检索'0'机构KB+历史工单, llm_call(org_id=0) LLM裁决能否回答(严格JSON), 硬门禁reply<20字符转人工, 故障≠答不了(fail_rounds>=3转人工), stale回收10min; 追问回流(agent_processing+owner空)立即拾取不等stale - todos.py: 平台待办provider, 状态派生(客户待确认/角色池待认领/受理人待处理) - init.py: load_ticket注册env+provider+poller(PIPELINE_MODE=web不启动) - wwwroot: 客户我的工单页+建单表单, 运维工单管理页(队列切换), 详情弹窗(正文与操作同屏,按视角出按钮) - load_path.py: logined全部API(业务权限服务端按current_role动态校验)+管理页壳owner三角色 - init/data.json: 7组码表+owner.maintainer角色种子(app_audit先例)
30 lines
1.5 KiB
JSON
30 lines
1.5 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "tk_messages",
|
|
"title": "工单往来消息",
|
|
"primary": ["id"],
|
|
"catelog": "entity"
|
|
}
|
|
],
|
|
"fields": [
|
|
{"name": "id", "title": "主键ID", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "ticket_id", "title": "工单ID", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "sender_type", "title": "发送方类型", "type": "str", "length": 16, "nullable": "no"},
|
|
{"name": "sender_id", "title": "发送人ID", "type": "str", "length": 32},
|
|
{"name": "sender_role", "title": "发送时角色", "type": "str", "length": 64},
|
|
{"name": "content", "title": "消息正文", "type": "longtext"},
|
|
{"name": "attachments", "title": "附件JSON", "type": "text"},
|
|
{"name": "visibility", "title": "可见性", "type": "str", "length": 16, "nullable": "no", "default": "customer"},
|
|
{"name": "created_at", "title": "创建时间", "type": "timestamp", "nullable": "no"}
|
|
],
|
|
"indexes": [
|
|
{"name": "idx_tkm_ticket", "idxtype": "index", "idxfields": ["ticket_id", "created_at"]},
|
|
{"name": "idx_tkm_vis", "idxtype": "index", "idxfields": ["visibility"]}
|
|
],
|
|
"codes": [
|
|
{"field": "sender_type", "table": "appcodes_kv", "valuefield": "k", "textfield": "v", "cond": "parentid='tk_sender_type'"},
|
|
{"field": "visibility", "table": "appcodes_kv", "valuefield": "k", "textfield": "v", "cond": "parentid='tk_visibility'"}
|
|
]
|
|
}
|