1.创建用餐审批单(新版)
# 接口说明
- 1.如果有审批业务,则需要进行通过该接口创建审批单,在下单时可以选择创建的相应审批单
| 名称 | 描述 |
|---|---|
| HTTP方法 | POST |
| Content-Type | application/x-www-form-urlencoded |
| method | /openapi/func/apply/dinner/create |
| 字段 | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| access_token | token | string | Y | 登录 token |
| sign | 签名 | string | Y | oihfnlyeofdh98 |
| timestamp | 时间戳 | long | Y | 13位时间戳 1241243250000 |
| employee_id | 用户ID | string | Y | 分贝用户id或者第三方用户id,为创建人的ID |
| employee_type | 用户类型 | string | Y | 类型,0为分贝用户,1为第三方用户 |
| data | 请求数据 | jsonobject | Y | 请求数据 |
| data.apply | 申请单内容 | jsonobject | Y | 申请单详细内容 |
| data.apply.apply_reason | 申请事由 | String | N | 申请事由,不能超过200字符 |
| data.apply.third_id | 申请单id | string | Y | 第三方审批单id |
| data.apply.budget | 申请单预算 | integer | Y | 预算总额(单位:分),需要和trip_list中estimated_amount金额相等 |
| data.apply.apply_reason_desc | 申请事由补充说明 | string | Y | 补充事由说明,小于500 |
| data.apply.cost_attribution_list | 费用归属对象集合 | jsonarray | N | 费用归属对象集合,如果是部门,==只能选择自己所在部门.如果是项目,只能填写自己能看到的项目),通过调用部门详情查询分贝部门ID,通过调用项目列表和详情可查看具体项目ID |
| data.apply.cost_attribution_list.cost_attribution_id | 费用归属id | string | N | 部门ID或项目ID,当传递费用归属时,费用归属三个属性必须同时传递,否则无法识别 |
| data.apply.cost_attribution_list.cost_attribution_name | 费用归属name | string | N | 部门名称或项目名称,当传递费用归属时,费用归属三个属性必须同时传递,否则无法识别 |
| data.apply.cost_attribution_list.cost_attribution_category | 费用归属类型 | integer | N | 1.部门 2.项目 当传递费用归属时,费用归属三个属性必须同时传递,否则无法识别 |
| data.apply.new_cost_attributions | (新)费用归属对象集合 | jsonarray | N | (新)费用归属对象集合 |
| data.apply.new_cost_attributions.type | (新)费用归属类型 | Integer | N | (新)费用归属类型1.部门 2.项目,3自定义档案 |
| data.apply.new_cost_attributions.third_archive_id | (新)三方自定义档案id | string | N | 三方自定义档案id(type为3时必传) |
| data.apply.new_cost_attributions.archive_name | (新)自定义档案名称 | string | N | 自定义档案名称(type为3时必传) |
| data.apply.new_cost_attributions.details | (新)费用归属详情 | jsonArray | N | (新)费用归属详情 |
| data.apply.new_cost_attributions.details.third_id | (新)三方费用归属id | string | N | 费用归属类型(type)为1时,该字段值为部门三方id;费用归属类型(type)为2时,该字段为项目三方ID;费用归属类型(type)为3时,该字段值为自定义档案项目三方ID |
| data.apply.new_cost_attributions.details.name | (新)费用归属名称 | string | N | 费用归属类型(type)为1时,该字段值为部门name;费用归属类型(type)为2时,该字段为项目name;费用归属类型(type)为3时,该字段值为自定义档案项目name |
| data.trip_list | 审批列表 | jsonarray | Y | 审批列表 |
| data.trip_list.start_city_id | 用餐使用城市ID | string | Y | 需要调用查询城市code接口获取 |
| data.trip_list.start_time | 开始时间 | string | Y | 用餐使用时间段开始时间, 格式:2019-03-10 12:00 |
| data.trip_list.end_time | 结束时间 | string | Y | 用餐使用时间段结束时间,用于跨天的时间范围 |
| data.trip_list.estimated_amount | 预估价格 | integer | Y | 100,==(单位分),需要和apply.budget金额一致== |
| data.trip_list.person_count | 用餐人数 | integer | Y | 50 |
| data.custom_fields | 自定义字段 | jsonarray | N | 审批单自定义字段 |
| data.custom_fields.type | 自定义字段类型 | string | N | 与配置表字段key匹配 |
| data.custom_fields.value | 自定义字段值 | string | N | 审批单自定义字段值 |
请求示例:
"access_token":"5747fbc10f0e60e0709d8d722",
"timestamp":1635820323000,
"sign":"oihfnlyeofdh98",
"employee_id":"59b74c1323445f2d54dd07922",
"employee_type":"1",
"data":
{
"apply": {
"apply_reason":"",
"budget": 10000,
"third_id": "8765432687wtw34567876543244576",
"apply_reason_desc": "测试创建用餐审批单-部门",
"new_cost_attributions":[
{
"type":"1",
"third_archive_id":"5f361f6523445f0f90a7a8db",
"archive_name":"xxx",
"details":[
{
"third_id":"5f361f652323223445f0f90a7a8db",
"name":"xxx"
}
]
}
],
"cost_attribution_list": [
{
"cost_attribution_id": "od-2fd01a3037c27fff0cba7a34d1c2bb07",
"cost_attribution_name": "开放平台",
"cost_attribution_category": 1
},
{
"cost_attribution_id": "5a66b2c1235f2417491280",
"cost_attribution_name": "test1",
"cost_attribution_category": 2
}
]
},
"trip_list": [
{
"start_city_id": "1000001",
"estimated_amount": 10000,
"start_time": "2020-05-17 12:00",
"end_time": "2020-05-17 19:00",
"person_count": 10
}
],
"custom_fields": [
{
"type": "1",
"value": "测试"
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
响应结果:
{
"request_id": "xUolOnJHWhIO4YP8MozO",
"code": 0,
"msg": "success",
"data": {
"id": "58baa286681765439481560f013ac"
}
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9