收银系统意图识别 JSON 格式规范(操作级)
生成时间:2026-05-18
版本:v3 操作级粒度 + 权限控制
零、权限字段说明
所有 JSON 操作必须携带以下权限字段:
{
"store_id": 314,
"user_id": 23,
"auth_allow": true
}
| 字段 | 说明 | 必须性 |
|---|---|---|
store_id |
门店ID,用于多租户隔离 | 必须 |
user_id |
用户ID,用于操作审计 | 必须 |
auth_allow |
是否有权限执行该操作 | 必须(由AI判断用户是否有权执行该action) |
AI判断规则:
- routine 操作:AI需根据用户身份判断是否允许执行
- agent 操作:AI需根据用户身份判断是否允许查询该数据
一、意图二分法
{
"intent": "routine" | "agent"
}
| intent | 含义 | 举例 |
|---|---|---|
routine |
常规操作(收银系统直接执行) | 下单、退货、折扣设置、商品增删改 |
agent |
智能体汇总(AI查询数据后汇总) | 对账单、销售分析、库存预测 |
二、常规操作(routine)
2.1 销售模块
// 销售开单
{ "intent": "routine", "action": "create_order", "params": {
"customer": "张三",
"items": [
{"sku": "欧普5W球泡", "qty": 3, "price": 15.5},
{"sku": "金杯2.5平电线", "qty": 1, "price": 88}
],
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 销售退货
{ "intent": "routine", "action": "return", "params": {
"customer": "李四",
"order_id": "SO20260518001",
"items": [{"sku": "欧普球泡", "qty": 1}],
"reason": "质量问题",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 订单查询
{ "intent": "routine", "action": "query_order", "params": {
"order_id": "SO20260518001",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 订单打印
{ "intent": "routine", "action": "print_order", "params": {
"order_id": "SO20260518001",
"type": "receipt",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 自动拆分设置
{ "intent": "routine", "action": "set_auto_split", "params": {
"rule": "by_store|by_category|by_payment",
"enabled": true,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
2.2 折扣促销模块
// 折扣设置
{ "intent": "routine", "action": "set_discount", "params": {
"type": "percent|fixed",
"value": 10,
"scope": "all|category|goods",
"goods_id": "OP001",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 促销活动
{ "intent": "routine", "action": "create_promo", "params": {
"name": "夏季促销",
"type": "满减|特价|秒杀|团购",
"rules": {...},
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 满减优惠
{ "intent": "routine", "action": "set_coupon", "params": {
"type": "满减",
"threshold": 100,
"discount": 10,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 限时特价
{ "intent": "routine", "action": "set_flash_sale", "params": {
"goods_id": "OP001",
"price": 9.9,
"start": "2026-05-18 00:00",
"end": "2026-05-20 23:59",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 秒杀活动
{ "intent": "routine", "action": "set_seckill", "params": {
"goods_id": "OP001",
"price": 8.8,
"stock": 100,
"time_slots": ["10:00", "14:00", "20:00"],
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 大转盘抽奖
{ "intent": "routine", "action": "set_lottery", "params": {
"name": "端午抽奖",
"prizes": [{"level": 1, "gift": "iphone"}, {"level": 2, "gift": "优惠券"}],
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 红包活动
{ "intent": "routine", "action": "set_redpacket", "params": {
"name": "满百红包",
"threshold": 100,
"amount": 5,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
2.3 会员模块
// 会员新增
{ "intent": "routine", "action": "add_member", "params": {
"name": "张三",
"phone": "13800138000",
"level": "normal|gold|vip",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 会员编辑
{ "intent": "routine", "action": "edit_member", "params": {
"member_id": "M001",
"name": "张三",
"phone": "13800138001",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 会员充值
{ "intent": "routine", "action": "recharge", "params": {
"member_id": "M001",
"amount": 500,
"gift": 50,
"pay_method": "cash|wechat|alipay",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 会员折扣
{ "intent": "routine", "action": "set_member_discount", "params": {
"member_id": "M001",
"discount": 0.85,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 会员积分
{ "intent": "routine", "action": "set_points", "params": {
"member_id": "M001",
"points": 1000,
"action": "add|deduct",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 次卡购买
{ "intent": "routine", "action": "buy_times_card", "params": {
"member_id": "M001",
"card_type": "洗车5次",
"price": 200,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 礼品卡发行
{ "intent": "routine", "action": "issue_gift_card", "params": {
"balance": 1000,
"count": 10,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 积分规则设置
{ "intent": "routine", "action": "set_points_rule", "params": {
"buy_points": 1,
"consume_money": 100,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 会员等级设置
{ "intent": "routine", "action": "set_member_level", "params": {
"level": "gold",
"discount": 0.9,
"points_multiplier": 2,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
2.4 商品模块
// 新增商品
{ "intent": "routine", "action": "add_product", "params": {
"name": "欧普5W球泡",
"sku": "OP-BQ-5W",
"category": "灯具/灯泡",
"price": 15.5,
"cost": 8.0,
"unit": "个",
"barcode": "6901234567890",
"supplier": "欧普照明",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 编辑商品
{ "intent": "routine", "action": "edit_product", "params": {
"product_id": "P001",
"name": "欧普5W球泡",
"price": 16.0,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 删除商品
{ "intent": "routine", "action": "delete_product", "params": {
"product_id": "P001",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 商品上下架
{ "intent": "routine", "action": "toggle_product", "params": {
"product_id": "P001",
"status": "on|off",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 商品分类
{ "intent": "routine", "action": "set_category", "params": {
"name": "灯具",
"parent": "照明",
"product_id": "P001",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 商品标签
{ "intent": "routine", "action": "set_product_tag", "params": {
"product_id": "P001",
"tags": ["热销", "新品", "利润款"],
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 商品规格
{ "intent": "routine", "action": "set_product_spec", "params": {
"product_id": "P001",
"specs": {"颜色": ["红", "蓝"], "功率": ["5W", "10W"]},
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 商品单位
{ "intent": "routine", "action": "set_product_unit", "params": {
"product_id": "P001",
"unit": "个",
"conversion": 1,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 批量改价
{ "intent": "routine", "action": "batch_price_update", "params": {
"category": "灯具",
"markup": 10,
"type": "percent|fixed",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 套餐管理
{ "intent": "routine", "action": "set_meal", "params": {
"name": "装修套餐A",
"items": [{"sku": "电线", "qty": 5}, {"sku": "开关", "qty": 10}],
"price": 599,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 商品批次
{ "intent": "routine", "action": "set_product_batch", "params": {
"product_id": "P001",
"batch": "20260501",
"production_date": "2026-05-01",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
2.5 采购模块
// 采购订单
{ "intent": "routine", "action": "create_purchase", "params": {
"supplier": "李四建材",
"items": [{"sku": "电线", "qty": 100, "price": 85}],
"expected_date": "2026-05-20",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 进货登记
{ "intent": "routine", "action": "stock_in", "params": {
"purchase_id": "PO001",
"warehouse": "A仓",
"items": [{"sku": "电线", "qty": 100}],
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 采购退货
{ "intent": "routine", "action": "purchase_return", "params": {
"purchase_id": "PO001",
"items": [{"sku": "电线", "qty": 5}],
"reason": "质量问题",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 供应商管理
{ "intent": "routine", "action": "manage_supplier", "params": {
"name": "李四建材",
"contact": "李四",
"phone": "13900001111",
"action": "add|edit|delete",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
2.6 库存模块
// 仓库管理
{ "intent": "routine", "action": "manage_warehouse", "params": {
"name": "A仓",
"code": "A01",
"action": "add|edit|delete",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 货位管理
{ "intent": "routine", "action": "manage_location", "params": {
"warehouse": "A01",
"location": "A01-01-01",
"action": "add|edit|delete",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 库存盘点
{ "intent": "routine", "action": "inventory_check", "params": {
"warehouse": "A01",
"items": [{"sku": "电线", "qty": 98, "actual": 100}],
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 报损单
{ "intent": "routine", "action": "loss_report", "params": {
"sku": "电线",
"qty": 2,
"reason": "损坏",
"warehouse": "A01",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 调拨
{ "intent": "routine", "action": "transfer", "params": {
"sku": "电线",
"qty": 10,
"from_warehouse": "A01",
"to_warehouse": "B01",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 库存查询
{ "intent": "routine", "action": "query_stock", "params": {
"sku": "电线",
"warehouse": "A01",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
2.7 财务模块
// 日结
{ "intent": "routine", "action": "daily_settle", "params": {
"date": "2026-05-18",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 收银日报
{ "intent": "routine", "action": "cashier_report", "params": {
"date": "2026-05-18",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 支付配置
{ "intent": "routine", "action": "set_payment", "params": {
"type": "wechat|alipay|cash",
"enabled": true,
"config": {...},
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 小票模板
{ "intent": "routine", "action": "set_receipt_template", "params": {
"template": "标准小票",
"content": {...},
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 收支统计
{ "intent": "routine", "action": "income_expense", "params": {
"start": "2026-05-01",
"end": "2026-05-18",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 加盟合同
{ "intent": "routine", "action": "manage_contract", "params": {
"franchisee": "张三",
"action": "add|edit|terminate",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
2.8 系统模块
// 门店设置
{ "intent": "routine", "action": "set_store", "params": {
"store_name": "月湖店",
"address": "长沙市开福区",
"tel": "0731-88888888",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 收银员管理
{ "intent": "routine", "action": "manage_cashier", "params": {
"name": "张三",
"action": "add|edit|delete|reset_pwd",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 收银员权限
{ "intent": "routine", "action": "set_cashier_perm", "params": {
"cashier_id": "C001",
"permissions": ["create_order", "return", "discount"],
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 角色权限
{ "intent": "routine", "action": "set_role_perm", "params": {
"role": "店长",
"permissions": ["all"],
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 打印设置
{ "intent": "routine", "action": "set_printer", "params": {
"name": "飞鹅打印机",
"type": "usb|network",
"enabled": true,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 微信配置
{ "intent": "routine", "action": "set_wechat_config", "params": {
"appid": "xxx",
"mchid": "xxx",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 配送设置
{ "intent": "routine", "action": "set_delivery", "params": {
"provider": "dada|uu|sf",
"enabled": true,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 操作日志
{ "intent": "routine", "action": "query_log", "params": {
"operator": "张三",
"date": "2026-05-18",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
2.9 配送模块
// 发配送
{ "intent": "routine", "action": "send_delivery", "params": {
"order_id": "SO001",
"provider": "dada",
"address": "长沙市xxx",
"contact": "张三",
"tel": "13800138000",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 取消配送
{ "intent": "routine", "action": "cancel_delivery", "params": {
"order_id": "SO001",
"provider": "dada",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 配送模板
{ "intent": "routine", "action": "set_delivery_template", "params": {
"name": "标准配送",
"fee": 10,
"free_threshold": 200,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
三、智能体汇总(agent)
3.1 对账单据
// 客户对账
{ "intent": "agent", "action": "statement_customer", "params": {
"customer": "张三",
"period": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 供应商对账
{ "intent": "agent", "action": "statement_supplier", "params": {
"supplier": "李四",
"period": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 月结对账
{ "intent": "agent", "action": "monthly_statement", "params": {
"type": "customer|supplier",
"party": "张三",
"month": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 应收款查询
{ "intent": "agent", "action": "query_receivable", "params": {
"customer": "张三",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 应付款查询
{ "intent": "agent", "action": "query_payable", "params": {
"supplier": "李四",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
3.2 经营分析
// 销售日报
{ "intent": "agent", "action": "analysis_sales_daily", "params": {
"date": "2026-05-18",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 销售月报
{ "intent": "agent", "action": "analysis_sales_monthly", "params": {
"month": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 今日利润分析
{ "intent": "agent", "action": "analysis_profit_rate", "params": {
"period": "today|2026-05-18",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 毛利率分析
{ "intent": "agent", "action": "analysis_gross_margin", "params": {
"start": "2026-05-01",
"end": "2026-05-18",
"category": "灯具",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 库存分析
{ "intent": "agent", "action": "analysis_stock", "params": {
"warehouse": "A01",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// KPI分析
{ "intent": "agent", "action": "analysis_kpi", "params": {
"month": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 爆款分析
{ "intent": "agent", "action": "analysis_top_seller", "params": {
"start": "2026-05-01",
"end": "2026-05-18",
"top": 10,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 出库单分析
{ "intent": "agent", "action": "analysis_delivery_order", "params": {
"date": "2026-05-18",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 滞销分析
{ "intent": "agent", "action": "analysis_slow_moving", "params": {
"days": 30,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 经营日报
{ "intent": "agent", "action": "daily_business_report", "params": {
"date": "2026-05-18",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 经营月报
{ "intent": "agent", "action": "monthly_business_report", "params": {
"month": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
3.3 预测补货
// 缺货预测
{ "intent": "agent", "action": "forecast_stockout", "params": {
"horizon_days": 7,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 安全库存
{ "intent": "agent", "action": "analysis_safe_stock", "params": {
"goods_id": "P001",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 智能补货建议
{ "intent": "agent", "action": "suggest_replenishment", "params": {
"goods_id": "P001",
"days": 7,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 库存预警
{ "intent": "agent", "action": "alert_stock", "params": {
"type": "low|overstock|expire",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
3.4 客户分析
// 客户ABC分类
{ "intent": "agent", "action": "classify_customer_abc", "params": {
"period": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 客户贡献排名
{ "intent": "agent", "action": "rank_customer", "params": {
"period": "2026-05",
"top": 20,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 客户流失预警
{ "intent": "agent", "action": "alert_customer_churn", "params": {
"inactive_days": 30,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 业务员提成
{ "intent": "agent", "action": "calculate_commission", "params": {
"salesman": "张三",
"month": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 客户画像
{ "intent": "agent", "action": "profile_customer", "params": {
"customer": "张三",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
3.5 供应商分析
// 供应商ABC分类
{ "intent": "agent", "action": "classify_supplier_abc", "params": {
"period": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 供应商评级
{ "intent": "agent", "action": "rate_supplier", "params": {
"supplier": "李四",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 供应商往来分析
{ "intent": "agent", "action": "analysis_supplier_trade", "params": {
"supplier": "李四",
"period": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
3.6 财务分析
// 利润分析
{ "intent": "agent", "action": "analysis_profit", "params": {
"start": "2026-05-01",
"end": "2026-05-18",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 健康度仪表盘
{ "intent": "agent", "action": "dashboard_health", "params": {
"store": "月湖店",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 月度财务报表
{ "intent": "agent", "action": "monthly_finance_report", "params": {
"month": "2026-05",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 账龄分析
{ "intent": "agent", "action": "analysis_aging", "params": {
"type": "receivable|payable",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
3.7 监控预警
// 库存预警
{ "intent": "agent", "action": "alert_inventory", "params": {
"type": "low_stock|overstock",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 账期预警
{ "intent": "agent", "action": "alert_payment_due", "params": {
"days": 30,
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 异常订单预警
{ "intent": "agent", "action": "alert_order_anomaly", "params": {
"store_id": 314, "user_id": 23, "auth_allow": true
}}
// 报告推送
{ "intent": "agent", "action": "push_report", "params": {
"report_type": "daily|weekly",
"channel": "企业微信",
"store_id": 314, "user_id": 23, "auth_allow": true
}}
四、示例映射表
| 用户输入 | JSON | |
|---|---|---|
| 折扣设置 | {"intent":"routine","action":"set_discount","params":{...,"store_id":314,"user_id":23,"auth_allow":true}} |
|
| 自动拆分设置 | {"intent":"routine","action":"set_auto_split","params":{"enabled":true,"store_id":314,"user_id":23,"auth_allow":true}} |
|
| 帮张三下单欧普5W球泡3个,金杯2.5平电线1卷 | {"intent":"routine","action":"create_order","params":{"customer":"张三","items":[{"sku":"欧普5W球泡","qty":3},{"sku":"金杯2.5平电线","qty":1}],"store_id":314,"user_id":23,"auth_allow":true}} |
|
| 给李四退货 | {"intent":"routine","action":"return","params":{"customer":"李四","store_id":314,"user_id":23,"auth_allow":true}} |
|
| 新增商品 欧普球泡 编码OP001 价格15.5 | {"intent":"routine","action":"add_product","params":{"name":"欧普球泡","sku":"OP001","price":15.5,"store_id":314,"user_id":23,"auth_allow":true}} |
|
| 编辑商品OP001价格改为16元 | {"intent":"routine","action":"edit_product","params":{"product_id":"OP001","price":16,"store_id":314,"user_id":23,"auth_allow":true}} |
|
| 整理这个月张三的对账单 | {"intent":"agent","action":"statement_customer","params":{"customer":"张三","period":"2026-05","store_id":314,"user_id":23,"auth_allow":true}} |
|
| 整理李四供应商的对账单 | {"intent":"agent","action":"statement_supplier","params":{"supplier":"李四","period":"2026-05","store_id":314,"user_id":23,"auth_allow":true}} |
|
| 分析今天出库单情况 | {"intent":"agent","action":"analysis_delivery_order","params":{"date":"2026-05-18","store_id":314,"user_id":23,"auth_allow":true}} |
|
| 分析今日利润情况 | {"intent":"agent","action":"analysis_profit_rate","params":{"period":"today","store_id":314,"user_id":23,"auth_allow":true}} |
|
| 查一下今天销售情况 | {"intent":"agent","action":"analysis_sales_daily","params":{"date":"2026-05-18","store_id":314,"user_id":23,"auth_allow":true}} |
|
| 哪些商品快缺货了 | {"intent":"agent","action":"forecast_stockout","params":{"horizon_days":7,"store_id":314,"user_id":23,"auth_allow":true}} |
|
| 帮我算算张三的提成 | {"intent":"agent","action":"calculate_commission","params":{"salesman":"张三","month":"2026-05","store_id":314,"user_id":23,"auth_allow":true}} |
|
| 会员张三充值500元 | {"intent":"routine","action":"recharge","params":{"member_id":"张三","amount":500,"store_id":314,"user_id":23,"auth_allow":true}} |
|
| 设置全场8折 | {"intent":"routine","action":"set_discount","params":{"type":"percent","value":20,"store_id":314,"user_id":23,"auth_allow":true}} |
|
| 打印机设置 | {"intent":"routine","action":"set_printer","params":{"store_id":314,"user_id":23,"auth_allow":true}} |
五、Qwen3-4B 系统提示词
你是收银系统意图识别助手。用户输入一句话后,判断是 routine(常规操作)还是 agent(智能体汇总),输出JSON。
【权限字段】所有JSON必须包含以下字段:
- store_id: 门店ID(当前用户所属门店)
- user_id: 用户ID(当前操作用户)
- auth_allow: 是否允许执行(AI根据用户身份判断,true=允许,false=拒绝)
【判断规则】
- routine 操作:AI根据用户角色和权限判断是否允许执行该操作
- agent 操作:AI根据用户角色判断是否允许查询该数据
- 如果用户无权执行,auth_allow=false,并返回简要原因
【routine】直接在收银系统执行的增删改查操作:
- 销售:create_order, return, query_order, print_order, set_auto_split
- 折扣:set_discount, create_promo, set_coupon, set_flash_sale, set_seckill, set_lottery, set_redpacket
- 会员:add_member, edit_member, recharge, set_member_discount, set_points, buy_times_card, issue_gift_card
- 商品:add_product, edit_product, delete_product, toggle_product, set_category, set_product_tag, set_product_spec
- 采购:create_purchase, stock_in, purchase_return, manage_supplier
- 库存:manage_warehouse, manage_location, inventory_check, loss_report, transfer, query_stock
- 财务:daily_settle, cashier_report, set_payment, set_receipt_template, income_expense
- 系统:set_store, manage_cashier, set_cashier_perm, set_role_perm, set_printer, set_wechat_config
- 配送:send_delivery, cancel_delivery, set_delivery_template
【agent】需要AI查询数据后汇总的分析操作:
- 对账:statement_customer, statement_supplier, monthly_statement, query_receivable, query_payable
- 分析:analysis_sales_daily, analysis_sales_monthly, analysis_profit_rate, analysis_gross_margin, analysis_stock, analysis_kpi, analysis_top_seller, analysis_delivery_order, analysis_slow_moving, daily_business_report
- 预测:forecast_stockout, analysis_safe_stock, suggest_replenishment, alert_stock
- 客户:classify_customer_abc, rank_customer, alert_customer_churn, calculate_commission, profile_customer
- 供应商:classify_supplier_abc, rate_supplier, analysis_supplier_trade
- 财务:analysis_profit, dashboard_health, monthly_finance_report, analysis_aging
- 预警:alert_inventory, alert_payment_due, alert_order_anomaly, push_report
只输出JSON,不要其他内容。
六、操作ID速查表
routine 操作ID
| action | 说明 |
|---|---|
create_order |
销售开单 |
return |
销售退货 |
query_order |
订单查询 |
print_order |
订单打印 |
set_auto_split |
自动拆分设置 |
set_discount |
折扣设置 |
create_promo |
促销活动 |
set_coupon |
满减优惠 |
set_flash_sale |
限时特价 |
set_seckill |
秒杀活动 |
set_lottery |
大转盘抽奖 |
set_redpacket |
红包活动 |
add_member |
会员新增 |
edit_member |
会员编辑 |
recharge |
会员充值 |
set_member_discount |
会员折扣 |
set_points |
会员积分 |
buy_times_card |
次卡购买 |
issue_gift_card |
礼品卡发行 |
set_points_rule |
积分规则 |
set_member_level |
会员等级 |
add_product |
新增商品 |
edit_product |
编辑商品 |
delete_product |
删除商品 |
toggle_product |
商品上下架 |
set_category |
商品分类 |
set_product_tag |
商品标签 |
set_product_spec |
商品规格 |
set_product_unit |
商品单位 |
batch_price_update |
批量改价 |
set_meal |
套餐管理 |
set_product_batch |
商品批次 |
create_purchase |
采购订单 |
stock_in |
进货登记 |
purchase_return |
采购退货 |
manage_supplier |
供应商管理 |
manage_warehouse |
仓库管理 |
manage_location |
货位管理 |
inventory_check |
库存盘点 |
loss_report |
报损单 |
transfer |
调拨 |
query_stock |
库存查询 |
daily_settle |
日结 |
cashier_report |
收银日报 |
set_payment |
支付配置 |
set_receipt_template |
小票模板 |
income_expense |
收支统计 |
manage_contract |
加盟合同 |
set_store |
门店设置 |
manage_cashier |
收银员管理 |
set_cashier_perm |
收银员权限 |
set_role_perm |
角色权限 |
set_printer |
打印设置 |
set_wechat_config |
微信配置 |
set_delivery |
配送设置 |
query_log |
操作日志 |
send_delivery |
发配送 |
cancel_delivery |
取消配送 |
set_delivery_template |
配送模板 |
agent 操作ID
| action | 说明 |
|---|---|
statement_customer |
客户对账 |
statement_supplier |
供应商对账 |
monthly_statement |
月结对账 |
query_receivable |
应收款查询 |
query_payable |
应付款查询 |
analysis_sales_daily |
销售日报 |
analysis_sales_monthly |
销售月报 |
analysis_profit_rate |
利润分析 |
analysis_gross_margin |
毛利率分析 |
analysis_stock |
库存分析 |
analysis_kpi |
KPI分析 |
analysis_top_seller |
爆款分析 |
analysis_delivery_order |
出库单分析 |
analysis_slow_moving |
滞销分析 |
daily_business_report |
经营日报 |
monthly_business_report |
经营月报 |
forecast_stockout |
缺货预测 |
analysis_safe_stock |
安全库存 |
suggest_replenishment |
智能补货 |
alert_stock |
库存预警 |
classify_customer_abc |
客户ABC分类 |
rank_customer |
客户贡献排名 |
alert_customer_churn |
流失预警 |
calculate_commission |
提成计算 |
profile_customer |
客户画像 |
classify_supplier_abc |
供应商ABC分类 |
rate_supplier |
供应商评级 |
analysis_supplier_trade |
供应商往来 |
analysis_profit |
利润分析 |
dashboard_health |
健康度仪表盘 |
monthly_finance_report |
月度财务报表 |
analysis_aging |
账龄分析 |
alert_inventory |
库存预警 |
alert_payment_due |
账期预警 |
alert_order_anomaly |
异常订单预警 |
push_report |
报告推送 |