Operation Config Center
  1. 引擎
Operation Config Center
  • 接口配置化
    • 产品服务交货信息组关联配置
      POST
    • 服务交货信息详情
      POST
    • 供应商接口信息详情
      POST
    • 供应商接口账号详情
      POST
    • 服务接口交货信息关联配置
      POST
  • PLM提供
    • 产品信息查询(Portal)
      POST
    • 产品国家查询(EJF,平台接单)
      POST
    • 产品揽收仓查询(EJF,平台接单)
      POST
    • 产品信息查询(EJF,平台接单)
      POST
    • 产品预报信息取值配置查询
      POST
    • 产品国家策略组配置
      POST
  • 验证引擎
    • 验证规则组查询
      POST
    • 删除验证规则组
      POST
    • 过滤规则提示列表查询
      POST
    • 报错提示语列表查询
      POST
    • 批量删除特殊规则提示
      POST
    • 批量删除报错提示语
      POST
    • 获取可校验的字段列表
      POST
    • 获取验证规则列表
      POST
  • 单号配置获取
    • 服务号段获取
    • 服务面单获取
  • 引擎
    • 渲染Liquid模板
      POST
    • 运行流程
      POST
    • 执行决策树
      POST
    • 校验条件
      POST
    • 发送HTTP请求
      POST
    • 解析Excel文件-单元格
      POST
    • 填充Excel文件-单元格
      POST
    • 填充Excel文件-列
      POST
    • 上传Oss文件
      POST
    • 下载Oss文件
      POST
    • 上传S3文件
      POST
    • 下载S3文件
      POST
  • 引擎-配置管理
    • 新增配置
    • 修改配置
    • 通过编码查询配置
    • 查询配置列表
    • 通过编码运行配置
  1. 引擎

执行决策树

开发中
正式环境
https://occ-engine.yanwentech.com
正式环境
https://occ-engine.yanwentech.com
POST
/api/engine/ExecuteDecisionTree
请求报文 - Expression 参数说明
数值比较
名称示例
大于{{ countryId>0 }}
大于等于{{ countryId>=0 }}
小于{{ countryId<0 }}
小于等于{{ countryId<=0 }}
相等{{ countryId==10 }}
不相等{{ countryId==10 }}
大于{{ price | gt: 100 }}
大于等于{{ price | gte: 100 }}
小于{{ price | lt: 100 }}
小于等于{{ price | lte: 100 }}
相等{{ countryId | eq: 10 }}
不等于{{ countryId | ne: 10 }}
文本比较
名称示例备注
相等{{ country=='美国' }}
不相等{{ country!='美国' }}
相等{{ country | eq:'USA','1' }}参数2-比较规则:0:区分大小写;1:忽略大小写
不相等{{ country | ne:'美国','0' }}参数2-比较规则:0:区分大小写;1:忽略大小写
包含{{ productCode | in:'1', '100', '101', '102' }}参数1-比较规则:0:区分大小写;1:忽略大小写
不包含{{ countryId | not_in: '0',10, 11, 12 }}参数1-比较规则:0:区分大小写;1:忽略大小写
包含(数组){{ productCode | in_list: productCodeList,'0' }}参数2-比较规则:0:区分大小写;1:忽略大小写
不包含(数组){{ productCode | not_in_list: productCodeList,'0' }}参数2-比较规则:0:区分大小写;1:忽略大小写
迭代包含判断{{ name | loop_contains: keywords,'0' }}参数2-比较规则:0:区分大小写;1:忽略大小写
迭代不包含判断{{ name | loop_not_contains: keywords,'0' }}参数2-比较规则:0:区分大小写;1:忽略大小写
提取Json字符串并比较{{ extendedcol | json_path: '$.CustomerCode' | eq: '205822' }}
范围比较
名称示例
数值{{ weight > 0 and weight <= 5 }}
时间(不包含边界){{ expressTime | between_time: '2024-10-20T18:02:29+08:00', '2024-10-21T18:00:00+08:00', false }}
时间(包含边界){{ expressTime | between_time: '2024-10-20T18:02:29+08:00', '2024-10-21T18:02:29+08:00', true }}
转换方法
名称示例
DJB2 哈希算法{{ "hello" | djb2_hash }}

请求参数

Body 参数application/json
config
object 
必需
takeType
enum<string> 
返回类型
必需
all:全部、first:深度匹配第一条、last:深度匹配最后一条
枚举值:
firstlastall
root
object 
决策配置
必需
data
object 
业务报文
必需
和规则数据比较
示例
{
    "config": {
        "takeType": "all",
        "root": {
            "sorting": 0,
            "expression": "{{ expressTime | compare_time: '>','2021-01-01' }}",
            "value": "全程轨迹",
            "nodes": [
                {
                    "sorting": 0,
                    "expression": "{{ extendedcol | json_path: '$.CustomerCode' | eq: '300740110' }}",
                    "value": "屏蔽轨迹",
                    "nodes": []
                },
                {
                    "sorting": 1,
                    "expression": "{{ productCode | in:484 }}",
                    "value": "全程轨迹",
                    "nodes": [
                        {
                            "sorting": 0,
                            "expression": "{{ extendedcol | json_path: '$.CustomerCode' | eq: '30074011' }}",
                            "value": "自定义-1",
                            "nodes": []
                        }
                    ]
                },
                {
                    "sorting": 2,
                    "expression": "{{ productCode | in: '10','1004','1021','1022','1023','1024','1025','1026' }}",
                    "value": "全程轨迹",
                    "nodes": [
                        {
                            "sorting": 0,
                            "condition": {
                                "conjunction": "and",
                                "children": [
                                    {
                                        "expression": "{{ countryId | in: '1','90','94' }}"
                                    },
                                    {
                                        "expression": "{{ serviceCode == '8908026' }}"
                                    }
                                ]
                            },
                            "value": "尾程轨迹",
                            "nodes": []
                        },
                        {
                            "sorting": 1,
                            "expression": "{{ countryId | in: '10','11','18' }}",
                            "value": "头程轨迹",
                            "nodes": []
                        }
                    ]
                }
            ]
        }
    },
    "data": {
        "trackId": "",
        "waybillNumber": "UH979970595YP",
        "exchangeNumber": "CDL00000000719",
        "yanwenNumber": "9815.102723",
        "productCode": "10",
        "serviceCode": "8908026",
        "countryId": 1,
        "expressTime": "2024-10-20T18:02:29+08:00",
        "trackingStatus": "SC10",
        "message": "",
        "location": "10",
        "timeStamp": "2023-10-27T18:02:29+08:00",
        "createTime": "2023-10-27T18:02:47+08:00",
        "updateTime": "2023-10-27 18:02:30",
        "sourceId": 42,
        "orderNumber": "BG-23102658PPR7L9GJ",
        "system": "MES",
        "extendedcol": "{\"ReceiveType\":\"\",\"Weight\":598,\"CustomerCode\":\"30074011\",\"PostCode\":\"11949-2045\",\"NodeSource\":1,\"Length\":0,\"Width\":0,\"High\":0,\"PrintSortingCode\":\"10-P20-8908026-026_JFK\",\"OutWarehouse\":\"10\",\"CreateId\":\"1100528\",\"Transport\":{\"MasterStatus\":\"3\",\"SubStatus\":\"3\",\"TrackingStatus\":\"SC10\"},\"OldWaybillnumber\":\"\"}"
    }
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://occ-engine.yanwentech.com/api/engine/ExecuteDecisionTree' \
--header 'Content-Type: application/json' \
--data-raw '{
    "config": {
        "takeType": "all",
        "root": {
            "sorting": 0,
            "expression": "{{ expressTime | compare_time: '\''>'\'','\''2021-01-01'\'' }}",
            "value": "全程轨迹",
            "nodes": [
                {
                    "sorting": 0,
                    "expression": "{{ extendedcol | json_path: '\''$.CustomerCode'\'' | eq: '\''300740110'\'' }}",
                    "value": "屏蔽轨迹",
                    "nodes": []
                },
                {
                    "sorting": 1,
                    "expression": "{{ productCode | in:484 }}",
                    "value": "全程轨迹",
                    "nodes": [
                        {
                            "sorting": 0,
                            "expression": "{{ extendedcol | json_path: '\''$.CustomerCode'\'' | eq: '\''30074011'\'' }}",
                            "value": "自定义-1",
                            "nodes": []
                        }
                    ]
                },
                {
                    "sorting": 2,
                    "expression": "{{ productCode | in: '\''10'\'','\''1004'\'','\''1021'\'','\''1022'\'','\''1023'\'','\''1024'\'','\''1025'\'','\''1026'\'' }}",
                    "value": "全程轨迹",
                    "nodes": [
                        {
                            "sorting": 0,
                            "condition": {
                                "conjunction": "and",
                                "children": [
                                    {
                                        "expression": "{{ countryId | in: '\''1'\'','\''90'\'','\''94'\'' }}"
                                    },
                                    {
                                        "expression": "{{ serviceCode == '\''8908026'\'' }}"
                                    }
                                ]
                            },
                            "value": "尾程轨迹",
                            "nodes": []
                        },
                        {
                            "sorting": 1,
                            "expression": "{{ countryId | in: '\''10'\'','\''11'\'','\''18'\'' }}",
                            "value": "头程轨迹",
                            "nodes": []
                        }
                    ]
                }
            ]
        }
    },
    "data": {
        "trackId": "",
        "waybillNumber": "UH979970595YP",
        "exchangeNumber": "CDL00000000719",
        "yanwenNumber": "9815.102723",
        "productCode": "10",
        "serviceCode": "8908026",
        "countryId": 1,
        "expressTime": "2024-10-20T18:02:29+08:00",
        "trackingStatus": "SC10",
        "message": "",
        "location": "10",
        "timeStamp": "2023-10-27T18:02:29+08:00",
        "createTime": "2023-10-27T18:02:47+08:00",
        "updateTime": "2023-10-27 18:02:30",
        "sourceId": 42,
        "orderNumber": "BG-23102658PPR7L9GJ",
        "system": "MES",
        "extendedcol": "{\"ReceiveType\":\"\",\"Weight\":598,\"CustomerCode\":\"30074011\",\"PostCode\":\"11949-2045\",\"NodeSource\":1,\"Length\":0,\"Width\":0,\"High\":0,\"PrintSortingCode\":\"10-P20-8908026-026_JFK\",\"OutWarehouse\":\"10\",\"CreateId\":\"1100528\",\"Transport\":{\"MasterStatus\":\"3\",\"SubStatus\":\"3\",\"TrackingStatus\":\"SC10\"},\"OldWaybillnumber\":\"\"}"
    }
}'

返回响应

🟢200成功
application/json
Body
success
boolean 
是否成功
必需
code
integer 
结果编码
必需
message
string 
结果消息
必需
data
object 
结果数据
必需
sorting
integer 
排序序号
必需
正序,数值小的优先级高
expression
string  | null 
表达式
可选
Finquid表达式
condition
string  | null 
条件
可选
复杂表达式组
value
string  | null 
返回值
可选
匹配成功后返回传入的数据,支持liquid语法
nodes
array [object {3}] 
可选
示例
{
    "success": true,
    "code": 0,
    "message": "ok",
    "data": {
        "sorting": 0,
        "expression": "{{ expressTime | compare_time: '>','2021-01-01' }}",
        "value": "全程轨迹",
        "nodes": [
            {
                "sorting": 2,
                "expression": "{{ productCode | in: '10','1004','1021','1022','1023','1024','1025','1026' }}",
                "value": "全程轨迹",
                "nodes": [
                    {
                        "sorting": 0,
                        "condition": {
                            "conjunction": "and",
                            "children": [
                                {
                                    "expression": "{{ countryId | in: '1','90','94' }}"
                                },
                                {
                                    "expression": "{{ serviceCode == '8908026' }}"
                                }
                            ]
                        },
                        "value": "尾程轨迹",
                        "nodes": []
                    }
                ]
            }
        ]
    }
}
修改于 2025-05-28 09:02:27
上一页
运行流程
下一页
校验条件
Built with