diff --git a/pom.xml b/pom.xml
index d837a31..4ad3ccf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
com.imyeyu.timiserverapi
TimiServerAPI
- 1.0.55
+ 1.0.56
jar
TimiServerAPI
imyeyu.com API
diff --git a/src/ai/dsl/main_agent.yml b/src/ai/dsl/main_agent.yml
new file mode 100644
index 0000000..1ffab25
--- /dev/null
+++ b/src/ai/dsl/main_agent.yml
@@ -0,0 +1,1483 @@
+app:
+ description: 店长专用门店经营助手。按问题类型路由到知识库、GAO MCP Agent 或只读拒绝分支。
+ icon: 🏪
+ icon_background: '#E8F5E9'
+ icon_type: emoji
+ mode: advanced-chat
+ name: AI 小糕(开发)
+ use_icon_as_answer_icon: false
+dependencies:
+- current_identifier: null
+ type: marketplace
+ value:
+ marketplace_plugin_unique_identifier: langgenius/deepseek:0.0.24@9e12eef09973667f0eaf4f082af883167e1de88740b22e71e71488d020c3778a
+ version: null
+- current_identifier: null
+ type: marketplace
+ value:
+ marketplace_plugin_unique_identifier: langgenius/tongyi:0.2.21@d467c6df6876dc5e70ad0b10c14631656ebbc904347eadf48e95b4fca7eda001
+ version: null
+kind: app
+version: 0.7.0
+workflow:
+ conversation_variables: []
+ environment_variables: []
+ features:
+ file_upload:
+ allowed_file_extensions:
+ - .JPG
+ - .JPEG
+ - .PNG
+ - .GIF
+ - .WEBP
+ - .SVG
+ allowed_file_types:
+ - image
+ allowed_file_upload_methods:
+ - local_file
+ - remote_url
+ enabled: false
+ fileUploadConfig:
+ attachment_image_file_size_limit: 2
+ audio_file_size_limit: 50
+ batch_count_limit: 5
+ file_size_limit: 15
+ file_upload_limit: 20
+ image_file_batch_limit: 10
+ image_file_size_limit: 10
+ single_chunk_attachment_limit: 10
+ video_file_size_limit: 100
+ workflow_file_upload_limit: 10
+ image:
+ enabled: false
+ number_limits: 3
+ transfer_methods:
+ - local_file
+ - remote_url
+ number_limits: 3
+ opening_statement: 你好,我是门店经营助手。可以查询今日经营、本月销售、库存预警、重点客户和积分套餐情况。
+ retriever_resource:
+ enabled: false
+ sensitive_word_avoidance:
+ enabled: false
+ speech_to_text:
+ enabled: false
+ suggested_questions: []
+ suggested_questions_after_answer:
+ enabled: true
+ text_to_speech:
+ enabled: false
+ language: ''
+ voice: ''
+ graph:
+ edges:
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: question-classifier
+ targetType: knowledge-retrieval
+ id: classifier-knowledge
+ source: classifier
+ sourceHandle: rule
+ target: knowledge
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: question-classifier
+ targetType: parameter-extractor
+ id: classifier-params-hybrid
+ source: classifier
+ sourceHandle: hybrid
+ target: params_hybrid
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: question-classifier
+ targetType: parameter-extractor
+ id: classifier-params-realtime
+ source: classifier
+ sourceHandle: realtime
+ target: params_realtime
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: question-classifier
+ targetType: llm
+ id: classifier-refuse
+ source: classifier
+ sourceHandle: refuse
+ target: refuse
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: agent
+ targetType: answer
+ id: hybrid-answer-output
+ source: hybrid_agent
+ sourceHandle: source
+ target: answer_hybrid
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: knowledge-retrieval
+ targetType: agent
+ id: hybrid-knowledge-agent
+ source: hybrid_knowledge
+ sourceHandle: source
+ target: hybrid_agent
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: knowledge-retrieval
+ targetType: llm
+ id: knowledge-rule-answer
+ source: knowledge
+ sourceHandle: source
+ target: rule_answer
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: parameter-extractor
+ targetType: knowledge-retrieval
+ id: params-hybrid-knowledge
+ source: params_hybrid
+ sourceHandle: source
+ target: hybrid_knowledge
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: parameter-extractor
+ targetType: agent
+ id: params-realtime-agent
+ source: params_realtime
+ sourceHandle: source
+ target: realtime_agent
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: agent
+ targetType: answer
+ id: realtime-answer-output
+ source: realtime_agent
+ sourceHandle: source
+ target: answer_realtime
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: llm
+ targetType: answer
+ id: refuse-answer-output
+ source: refuse
+ sourceHandle: source
+ target: answer_refuse
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: llm
+ targetType: answer
+ id: rule-answer-output
+ source: rule_answer
+ sourceHandle: source
+ target: answer_rule
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ - data:
+ isInIteration: false
+ isInLoop: false
+ iteration_id: null
+ loop_id: null
+ sourceType: start
+ targetType: question-classifier
+ id: start-classifier
+ source: start
+ sourceHandle: source
+ target: classifier
+ targetHandle: target
+ type: custom
+ zIndex: 0
+ nodes:
+ - data:
+ answer: '{{#hybrid_agent.text#}}'
+ desc: 混合规则与实时数据回答
+ selected: false
+ title: 混合回复
+ type: answer
+ variables: []
+ height: 130
+ id: answer_hybrid
+ position:
+ x: 1640
+ y: 610
+ positionAbsolute:
+ x: 1640
+ y: 610
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ answer: '{{#realtime_agent.text#}}'
+ desc: 实时业务数据回答
+ selected: false
+ title: 实时回复
+ type: answer
+ variables: []
+ height: 130
+ id: answer_realtime
+ position:
+ x: 1320
+ y: 330
+ positionAbsolute:
+ x: 1320
+ y: 330
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ answer: '{{#refuse.text#}}'
+ desc: 只读限制说明
+ selected: false
+ title: 拒绝回复
+ type: answer
+ variables: []
+ height: 130
+ id: answer_refuse
+ position:
+ x: 1000
+ y: 900
+ positionAbsolute:
+ x: 1000
+ y: 900
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ answer: '{{#rule_answer.text#}}'
+ desc: 规则与口径回答
+ selected: false
+ title: 规则回复
+ type: answer
+ variables: []
+ height: 130
+ id: answer_rule
+ position:
+ x: 1320
+ y: 80
+ positionAbsolute:
+ x: 1320
+ y: 80
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ classes:
+ - id: rule
+ label: CLASS 1
+ name: 规则与口径:询问制度、SOP、状态含义、指标定义、套餐或积分规则,不需要当前业务数据
+ - id: realtime
+ label: CLASS 2
+ name: 实时业务查询:询问当前门店的客户、订单、资金、产品、库存、积分、事件、日记或报表数据
+ - id: hybrid
+ label: CLASS 3
+ name: 混合问题:同时需要业务规则或指标口径,以及当前门店实时数据和经营分析
+ - id: refuse
+ label: CLASS 4
+ name: 拒绝:写操作、跨门店查询、无关闲聊、要求绕过权限或模型无法完成的请求
+ desc: 按问题的数据来源与权限属性路由,分类器不回答业务问题
+ instruction: 只按类别定义分类。询问任何实时金额、数量、客户、订单、库存、积分、事件或门店经营结果时,必须归入“实时业务查询”或“混合问题”。
+ instructions: ''
+ model:
+ completion_params:
+ temperature: 0
+ mode: chat
+ name: deepseek-flash
+ provider: langgenius/deepseek/deepseek
+ query_variable_selector:
+ - sys
+ - query
+ selected: false
+ title: 问题分类
+ topics: []
+ type: question-classifier
+ height: 306
+ id: classifier
+ position:
+ x: 340
+ y: 320
+ positionAbsolute:
+ x: 340
+ y: 320
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ agent_parameters:
+ instruction:
+ type: constant
+ value: "你是当前店长的门店混合查询 Agent。\n【知识库片段】\n {{#context#}}\n【/知识库片段】\n当前门店:{{#start.storeName#}};当前日期:{{#start.today#}}。\n\
+ 先使用知识库结果解释规则和统计口径,再调用最少必要的 GAO 只读 MCP 工具获取实时数据;最多 3 次工具调用。\n不能调用写操作、不能跨店、不能编造数据。回答必须列出时间范围、统计口径、数据生成时间,并区分数据事实和经营建议。\n\
+ 已提取参数:timePreset={{#params_hybrid.timePreset#}},startDate={{#params_hybrid.startDate#}},endDate={{#params_hybrid.endDate#}},customerKeyword={{#params_hybrid.customerKeyword#}},productKeyword={{#params_hybrid.productKeyword#}},topN={{#params_hybrid.topN#}}。\n"
+ model:
+ type: constant
+ value:
+ completion_params:
+ temperature: 0.2
+ mode: chat
+ model: deepseek-flash
+ model_type: llm
+ name: qwen2.5:latest
+ provider: langgenius/deepseek/deepseek
+ type: model-selector
+ query:
+ type: constant
+ value: '{{#sys.query#}}/'
+ tools:
+ type: constant
+ value:
+ - enabled: true
+ extra:
+ description: 查询当前门店销售订单、履约和资金摘要,严格只读
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店销售订单、履约和资金摘要,严格只读
+ tool_label: order_query
+ tool_name: order_query
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店产品、SKU 和库存余额,严格只读
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店产品、SKU 和库存余额,严格只读
+ tool_label: product_inventory_query
+ tool_name: product_inventory_query
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店登记事件记录及事件统计,严格只读
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店登记事件记录及事件统计,严格只读
+ tool_label: event_query
+ tool_name: event_query
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店单个客户的套餐、积分、消费和事件档案
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店单个客户的套餐、积分、消费和事件档案
+ tool_label: customer_profile
+ tool_name: customer_profile
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店销售趋势、应收、客户复购和产品排行
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店销售趋势、应收、客户复购和产品排行
+ tool_label: business_report
+ tool_name: business_report
+ type: mcp
+ - enabled: true
+ extra:
+ description: 按客户姓名或编码查询当前门店客户摘要
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 按客户姓名或编码查询当前门店客户摘要
+ tool_label: customer_search
+ tool_name: customer_search
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店指定周期的营业日、销售、应收和库存健康总览
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店指定周期的营业日、销售、应收和库存健康总览
+ tool_label: store_overview
+ tool_name: store_overview
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店积分账户、积分流水、规则和兑换摘要,严格只读
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店积分账户、积分流水、规则和兑换摘要,严格只读
+ tool_label: point_query
+ tool_name: point_query
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店日记和营业日信息,严格只读
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店日记和营业日信息,严格只读
+ tool_label: store_diary_query
+ tool_name: store_diary_query
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询门店经营助手使用的固定指标名称和计算口径
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询门店经营助手使用的固定指标名称和计算口径
+ tool_label: metric_definition
+ tool_name: metric_definition
+ type: mcp
+ agent_strategy_label: FunctionCalling
+ agent_strategy_name: function_calling
+ agent_strategy_provider_name: langgenius/agent/agent
+ desc: 导入后绑定 GAO MCP 的 10 个只读工具,并把混合问题知识库结果加到 Agent 上下文
+ meta:
+ minimum_dify_version: 1.7.0
+ version: 0.0.2
+ output_schema: {}
+ plugin_unique_identifier: langgenius/agent:0.0.47@b14b5a5259094510a272e5b7facd09aa63352511c13fabcde36a4cac57d1da94
+ selected: false
+ title: 混合查询 MCP Agent
+ tool_node_version: '2'
+ type: agent
+ height: 140
+ id: hybrid_agent
+ position:
+ x: 1320
+ y: 610
+ positionAbsolute:
+ x: 1320
+ y: 610
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ dataset_ids:
+ - EaJw5gBfWOkJO60gvKoybO2gxGDcnPymkRNCeTUqce05D6wh7Q9BtsnzL1OElHlk
+ desc: 导入后绑定 GAO 业务知识库,为混合问题提供指标口径和规则依据
+ metadata_filtering_mode: disabled
+ multiple_retrieval_config:
+ reranking_enable: false
+ reranking_mode: weighted_score
+ reranking_model: null
+ score_threshold: 0.35
+ top_k: 4
+ weights:
+ keyword_setting:
+ keyword_weight: 0.3
+ vector_setting:
+ embedding_model_name: text-embedding-v4
+ embedding_provider_name: langgenius/tongyi/tongyi
+ vector_weight: 0.7
+ weight_type: customized
+ query_attachment_selector: []
+ query_variable_selector:
+ - sys
+ - query
+ retrieval_mode: multiple
+ selected: false
+ title: 混合问题知识检索
+ type: knowledge-retrieval
+ vision:
+ enabled: false
+ height: 96
+ id: hybrid_knowledge
+ position:
+ x: 1000
+ y: 610
+ positionAbsolute:
+ x: 1000
+ y: 610
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ dataset_ids:
+ - EaJw5gBfWOkJO60gvKoybO2gxGDcnPymkRNCeTUqce05D6wh7Q9BtsnzL1OElHlk
+ desc: 导入后绑定 GAO 业务知识库,只检索制度、规则和指标口径
+ metadata_filtering_mode: disabled
+ multiple_retrieval_config:
+ reranking_enable: false
+ reranking_mode: weighted_score
+ reranking_model: null
+ score_threshold: 0.35
+ top_k: 4
+ weights:
+ keyword_setting:
+ keyword_weight: 0.3
+ vector_setting:
+ embedding_model_name: text-embedding-v4
+ embedding_provider_name: langgenius/tongyi/tongyi
+ vector_weight: 0.7
+ weight_type: customized
+ query_attachment_selector: []
+ query_variable_selector:
+ - sys
+ - query
+ retrieval_mode: multiple
+ selected: false
+ title: 规则知识检索
+ type: knowledge-retrieval
+ vision:
+ enabled: false
+ height: 96
+ id: knowledge
+ position:
+ x: 680
+ y: 80
+ positionAbsolute:
+ x: 680
+ y: 80
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ desc: 混合问题复用同一套参数,只额外取得规则与口径依据
+ instruction: 从用户问题中提取查询条件。日期没有明确范围时,明细查询使用 TODAY,趋势或经营分析使用 MONTH_TO_DATE。不要提取、生成或修改门店
+ ID。
+ model:
+ completion_params:
+ temperature: 0
+ mode: chat
+ name: deepseek-flash
+ provider: langgenius/deepseek/deepseek
+ parameters:
+ - description: TODAY、MONTH_TO_DATE、CUSTOM 或空
+ name: timePreset
+ required: false
+ type: string
+ - description: 自定义开始日期 yyyy-MM-dd
+ name: startDate
+ required: false
+ type: string
+ - description: 自定义结束日期 yyyy-MM-dd
+ name: endDate
+ required: false
+ type: string
+ - description: 客户关键词
+ name: customerKeyword
+ required: false
+ type: string
+ - description: 产品或 SKU 关键词
+ name: productKeyword
+ required: false
+ type: string
+ - description: 排行数量,最大 20
+ name: topN
+ required: false
+ type: number
+ query:
+ - sys
+ - query
+ reasoning_mode: prompt
+ selected: false
+ title: 混合查询参数提取
+ type: parameter-extractor
+ vision:
+ enabled: false
+ height: 132
+ id: params_hybrid
+ position:
+ x: 680
+ y: 610
+ positionAbsolute:
+ x: 680
+ y: 610
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ desc: 提取实时查询的通用筛选条件,空值表示使用 MCP 工具默认值
+ instruction: 从用户问题中提取查询条件。日期没有明确范围时,明细查询使用 TODAY,趋势或经营分析使用 MONTH_TO_DATE。不要提取、生成或修改门店
+ ID。
+ model:
+ completion_params:
+ temperature: 0
+ mode: chat
+ name: deepseek-flash
+ provider: langgenius/deepseek/deepseek
+ parameters:
+ - description: TODAY、MONTH_TO_DATE、CUSTOM 或空
+ name: timePreset
+ required: false
+ type: string
+ - description: 自定义开始日期 yyyy-MM-dd
+ name: startDate
+ required: false
+ type: string
+ - description: 自定义结束日期 yyyy-MM-dd
+ name: endDate
+ required: false
+ type: string
+ - description: 客户姓名、编码或其他查询关键词
+ name: customerKeyword
+ required: false
+ type: string
+ - description: 产品或 SKU 关键词
+ name: productKeyword
+ required: false
+ type: string
+ - description: 订单号
+ name: orderNo
+ required: false
+ type: string
+ - description: 事件名称或关键词
+ name: eventKeyword
+ required: false
+ type: string
+ - description: 排行数量,最大 20
+ name: topN
+ required: false
+ type: number
+ query:
+ - sys
+ - query
+ reasoning_mode: prompt
+ selected: false
+ title: 实时查询参数提取
+ type: parameter-extractor
+ vision:
+ enabled: false
+ height: 132
+ id: params_realtime
+ position:
+ x: 680
+ y: 300
+ positionAbsolute:
+ x: 680
+ y: 300
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ agent_parameters:
+ instruction:
+ type: constant
+ value: '你是当前店长的门店实时数据查询 Agent。
+
+ 当前门店:{{#start.storeName#}};当前日期:{{#start.today#}}。
+
+ 只能使用已绑定的 GAO 只读 MCP 工具;一次最多调用 5 个工具。
+
+ 先根据问题和已提取参数选择最小必要工具。不能调用写操作,不得编造没有工具结果的数据。
+
+ 回答必须包含时间范围、统计口径、数据生成时间;区分数据事实和经营建议。
+
+ 已提取参数:timePreset={{#params_realtime.timePreset#}},startDate={{#params_realtime.startDate#}},endDate={{#params_realtime.endDate#}},customerKeyword={{#params_realtime.customerKeyword#}},productKeyword={{#params_realtime.productKeyword#}},orderNo={{#params_realtime.orderNo#}},eventKeyword={{#params_realtime.eventKeyword#}},topN={{#params_realtime.topN#}}。
+
+ '
+ model:
+ type: constant
+ value:
+ completion_params:
+ temperature: 0.2
+ mode: chat
+ model: deepseek-flash
+ model_type: llm
+ name: qwen2.5:latest
+ provider: langgenius/deepseek/deepseek
+ type: model-selector
+ query:
+ type: constant
+ value: '{{#sys.query#}}'
+ tools:
+ type: constant
+ value:
+ - enabled: true
+ extra:
+ description: 查询当前门店销售订单、履约和资金摘要,严格只读
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店销售订单、履约和资金摘要,严格只读
+ tool_label: order_query
+ tool_name: order_query
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店产品、SKU 和库存余额,严格只读
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店产品、SKU 和库存余额,严格只读
+ tool_label: product_inventory_query
+ tool_name: product_inventory_query
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店登记事件记录及事件统计,严格只读
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店登记事件记录及事件统计,严格只读
+ tool_label: event_query
+ tool_name: event_query
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店单个客户的套餐、积分、消费和事件档案
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店单个客户的套餐、积分、消费和事件档案
+ tool_label: customer_profile
+ tool_name: customer_profile
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店销售趋势、应收、客户复购和产品排行
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店销售趋势、应收、客户复购和产品排行
+ tool_label: business_report
+ tool_name: business_report
+ type: mcp
+ - enabled: true
+ extra:
+ description: 按客户姓名或编码查询当前门店客户摘要
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 按客户姓名或编码查询当前门店客户摘要
+ tool_label: customer_search
+ tool_name: customer_search
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店指定周期的营业日、销售、应收和库存健康总览
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店指定周期的营业日、销售、应收和库存健康总览
+ tool_label: store_overview
+ tool_name: store_overview
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店积分账户、积分流水、规则和兑换摘要,严格只读
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店积分账户、积分流水、规则和兑换摘要,严格只读
+ tool_label: point_query
+ tool_name: point_query
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询当前门店日记和营业日信息,严格只读
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询当前门店日记和营业日信息,严格只读
+ tool_label: store_diary_query
+ tool_name: store_diary_query
+ type: mcp
+ - enabled: true
+ extra:
+ description: 查询门店经营助手使用的固定指标名称和计算口径
+ parameters:
+ aiSessionId:
+ auto: 0
+ value:
+ type: mixed
+ value: '{{#start.aiSessionId#}}'
+ cursor:
+ auto: 1
+ value: null
+ filters:
+ auto: 1
+ value: null
+ pageSize:
+ auto: 1
+ value: null
+ query:
+ auto: 1
+ value: null
+ timeRange:
+ auto: 1
+ value: null
+ plugin_id: ''
+ provider_name: gao-mcp-server-dev
+ provider_show_name: GAO MCP 服务(开发)
+ settings: {}
+ tool_description: 查询门店经营助手使用的固定指标名称和计算口径
+ tool_label: metric_definition
+ tool_name: metric_definition
+ type: mcp
+ agent_strategy_label: FunctionCalling
+ agent_strategy_name: function_calling
+ agent_strategy_provider_name: langgenius/agent/agent
+ desc: 导入后绑定 GAO MCP 的 10 个只读工具
+ meta:
+ minimum_dify_version: 1.7.0
+ version: 0.0.2
+ output_schema: {}
+ plugin_unique_identifier: langgenius/agent:0.0.47@b14b5a5259094510a272e5b7facd09aa63352511c13fabcde36a4cac57d1da94
+ selected: false
+ title: 实时 MCP 查询 Agent
+ tool_node_version: '2'
+ type: agent
+ height: 108
+ id: realtime_agent
+ position:
+ x: 1000
+ y: 330
+ positionAbsolute:
+ x: 1000
+ y: 330
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ context:
+ enabled: false
+ variable_selector: []
+ desc: 拒绝写操作、跨店、越权和无关请求
+ memory:
+ role_prefix:
+ assistant: 助手
+ user: 店长
+ window:
+ enabled: true
+ size: 10
+ model:
+ completion_params:
+ temperature: 0
+ mode: chat
+ name: deepseek-flash
+ provider: langgenius/deepseek/deepseek
+ prompt_template:
+ - id: refuse-system
+ role: system
+ text: 你是门店经营助手。仅支持当前店长所属门店的只读查询与经营分析。明确拒绝创建、修改、核销、退款、库存调整、积分调整、跨门店查询、绕过权限和无关请求;简短说明可支持的查询范围。
+ - id: refuse-user
+ role: user
+ text: '{{#sys.query#}}'
+ selected: false
+ title: 只读拒绝
+ type: llm
+ variables: []
+ vision:
+ enabled: false
+ height: 116
+ id: refuse
+ position:
+ x: 680
+ y: 900
+ positionAbsolute:
+ x: 680
+ y: 900
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ context:
+ enabled: true
+ variable_selector:
+ - knowledge
+ - result
+ desc: 只使用知识库片段回答规则与口径
+ memory:
+ role_prefix:
+ assistant: 助手
+ user: 店长
+ window:
+ enabled: true
+ size: 10
+ model:
+ completion_params:
+ temperature: 0.2
+ mode: chat
+ name: deepseek-flash
+ provider: langgenius/deepseek/deepseek
+ prompt_template:
+ - id: rule-system
+ role: system
+ text: "你是门店经营助手。\n\n【知识库片段】\n {{#context#}}\n【/知识库片段】\n\n仅依据知识库片段回答用户问题。\n\
+ 如果片段只包含部分步骤,直接回答片段明确给出的步骤,不要因为信息不完整就说不知道。\n只有知识库片段完全没有相关内容时,才说明未找到对应规则。\n\
+ 不得编造知识库没有提供的步骤或实时数据。\n当前日期:{{#start.today#}}"
+ - id: rule-user
+ role: user
+ text: '{{#sys.query#}}'
+ selected: false
+ title: 规则回答
+ type: llm
+ variables: []
+ vision:
+ enabled: false
+ height: 116
+ id: rule_answer
+ position:
+ x: 1000
+ y: 80
+ positionAbsolute:
+ x: 1000
+ y: 80
+ selected: true
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ - data:
+ desc: 后端传入已验证的会话上下文,aiSessionId 仅供 MCP 请求头注入,禁止进入模型上下文
+ selected: false
+ title: 开始
+ type: start
+ variables:
+ - label: AI 会话 ID
+ max_length: 128
+ options: []
+ required: true
+ type: text-input
+ variable: aiSessionId
+ - label: 门店名称
+ max_length: 128
+ options: []
+ required: true
+ type: text-input
+ variable: storeName
+ - label: 当前日期
+ max_length: 10
+ options: []
+ required: true
+ type: text-input
+ variable: today
+ height: 221
+ id: start
+ position:
+ x: 40
+ y: 360
+ positionAbsolute:
+ x: 40
+ y: 360
+ selected: false
+ sourcePosition: right
+ targetPosition: left
+ type: custom
+ width: 242
+ zIndex: 0
+ viewport:
+ x: -4.292682679471227
+ y: 3.141444007269058
+ zoom: 0.9094299399062398
+ rag_pipeline_variables: []
diff --git a/src/main/java/com/imyeyu/api/modules/gao/vo/GaoOrderFulfillmentPage.java b/src/main/java/com/imyeyu/api/modules/gao/vo/GaoOrderFulfillmentPage.java
index 8638b99..8982128 100644
--- a/src/main/java/com/imyeyu/api/modules/gao/vo/GaoOrderFulfillmentPage.java
+++ b/src/main/java/com/imyeyu/api/modules/gao/vo/GaoOrderFulfillmentPage.java
@@ -5,6 +5,8 @@ import com.imyeyu.java.bean.BasePage;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import java.util.List;
+
/// GAO 统一履约分页查询请求
///
/// @author Codex
@@ -22,6 +24,9 @@ public class GaoOrderFulfillmentPage extends BasePage {
/// 客户 ID
private String customerId;
+ /// SKU ID 列表,任一 SKU 命中即匹配
+ private List skuIdList;
+
/// 履约状态
private GaoOrderFulfillment.Status status;
diff --git a/src/main/resources/mapper/timi-server/gao/GaoOrderFulfillmentMapper.xml b/src/main/resources/mapper/timi-server/gao/GaoOrderFulfillmentMapper.xml
index 7f22b1f..8395e76 100644
--- a/src/main/resources/mapper/timi-server/gao/GaoOrderFulfillmentMapper.xml
+++ b/src/main/resources/mapper/timi-server/gao/GaoOrderFulfillmentMapper.xml
@@ -39,6 +39,14 @@
AND `store_id` = #{storeId}
AND `sales_order_id` = #{salesOrderId}
AND `customer_id` = #{customerId}
+
+ AND EXISTS (
+ SELECT 1 FROM `gao_order_fulfillment_item` fulfillment_item
+ WHERE fulfillment_item.`fulfillment_id` = `gao_order_fulfillment`.`id`
+ AND fulfillment_item.`sku_id` IN
+ #{skuId}
+ )
+
AND `status` = #{status}
AND `delivered_at` >= #{beginAt}
AND `delivered_at` <= #{endAt}