本文将介绍如何获取氚云的连接器信息及配置氚云的请求方案和写入方案
开发文档:https://bbs.qeasy.cloud/d/12957-chuan-yun-gua-pei-qi-pei-zhi-zhi-nan
一、建立连接器
1. 登录氚云,账号需要有管理员权限(氚云:https://www.h3yun.com/entry/)
2. 在个人中心获取授权信息:EngineCode
、Secret
3. 将信息输入连接器中,Host
固定为https://www.h3yun.com/OpenApi/Invoke
二、配置请求适配器
1. 请求适配器:\Adapter\ChuanYun\ChuanYunQueryAdapter
2. 获取表单ID和字段key
(注意明细表获取的字段key是 表key.字段key 的格式,我们只需要点后面的字段key)
3. 请求调度者配置
API: LoadBizObjects
请求方式:POST
特殊注意事项:①要启用数据建模,严格按照下面请求参数字段类型配置;②过滤条件配置较复杂,下文详细介绍
其中Matcher
过滤条件比较复杂,根据实际情况配置。以下进行两个示例:
ModifiedTime
大于等于上次同步时间:
{
"Type": "Item",
"Name": "ModifiedTime",
"Operator": 1,
"Value": "{{LAST_SYNC_TIME|datetime}}"
}
ModifiedTime
大于等于上次同步时间 且 status
等于0 且 F000018
等于否:
{
"Type":"And",
"Matchers":[
{
"Type":"Item",
"Name":"ModifiedTime",
"Operator":1,
"Value":"{{LAST_SYNC_TIME|datetime}}"
},
{
"Type":"Item",
"Name":"Status",
"Operator":2,
"Value":"0"
},
{
"Type":"Item",
"Name":"F000018",
"Operator":2,
"Value":"否"
}
]
}
以下为范例请求参数:
{
"SchemaCode": "D2857040ec1eb366ceb47dfb7441cb8e1f9bc63",
"BizObjectId": "e0c37dfc-d89d-4d32-878e-53605c679baa",
"Filter": {
"FromRowNum": "0",
"RequireCount": true,
"ReturnItems": [],
"SortByCollection": [],
"ToRowNum": "100",
"Matcher": {
"Type": "Item",
"Name": "ModifiedTime",
"Operator": 1,
"Value": "2024-07-09 11:00:24"
}
}
}
三、写入调度者配置
1. 写入适配器:\Adapter\ChuanYun\ChuanYunExecuteAdapter
2. 写入调度者配置
3. 写入调度者配置
写入参数示例:
{
"SchemaCode": "D2857040ec1eb366ceb47dfb7441cb8e1f9bc63",
"BizObject": {
"CreatedBy": "8b424a5b-cf2a-4c13-8b62-052a7f4aa1a8",
"OwnerId": "8b424a5b-cf2a-4c13-8b62-052a7f4aa1a8",
"F0000002": "CGJM002685",
"F0000001": "***",
"F0000003": "***",
"F0000006": "人民币",
"F0000015": "892300",
"D285704Fbdebecea94c34b2b80064ae8ac4a108e": [
{
"F0000009": "150800433",
"F0000010": "Storm LGR Extreme 电控盒",
"F0000011": "(空白)",
"F0000016": "Pcs",
"F0000012": "9.079646",
"F0000017": "10.26",
"F0000013": "2024-07-09 00:00:00",
"F0000014": "2100-01-01 00:00:00",
"F0000018": "TRUE",
"F0000019": "130971"
}
]
},
"IsSubmit": false
}