审批单修改接口

地址URL

https://api.es.xiaojukeji.com/river/Approval/update

支持格式

Json

请求类型

POST

请求参数

参数名称 数据类型 必选 说明
client_id string yes 申请应用时分配的AppKey
access_token string yes 授权后的access token
timestamp string yes 当前时间戳
company_id string yes 企业ID
approval_type int yes 审批单类型(1-差旅 travel,目前只支持差旅的修改)
approval_id string no 审批单ID(创建api返回的滴滴内部审批单ID)
travel_detail object no approval_type=1必传,其余不传
extra_info json no 扩展信息,自定义字段
sign string yes 签名

1、计算签名时候,需要对travel_detail或者business_trip_detail值做 json_encode 处理成字符串格式,再参与签名;
2、approval_type=1时,用过车的城市之后的城市可以修改,之前的无法修改;
3、修改时,凡是涉及到有日期规定的,规定的最晚时间必须大于修改时的时间。

可修改内容

1.差旅结束时间:
差旅开始时间不允许修改,结束时间只能往后延期。即newStartTime = oldStartTime && oldEndTime <= newEndTime。
时间修改后,所有已用车城市的规则有效时间会被更新,未用车城市规则被删除然后重新创建

2.差旅行程
2.1 当差旅制度-出差城市配置为由员工填写时 未发生用车时,删除旧的差旅行程信息和规则,生成新的行程和规则。 已发生用车时:已用车城市行程不允许修改,未用车城市行程可以修改。 比如差旅行程为:北京-上海,上海-北京。如果上海发生了用车,那么北京-上海的行程是不允许修改的,上海-北京允许修改。 2.2 当差旅制度-出差城市配置为无需员工填写时 出发地、目的地城市传空

travel_detail

参数名称 数据类型 必选 说明
start_date date yes 行程开始日期,如2017-01-10
end_date date yes 行程结束日期,如2017-02-01
trips array no 行程路线,行程使用的制度(regulation_id)中,出差城市配置为无需填写时,trips可为空。否则必传,需按照行程顺序填写
end_city_rule int yes 行程终点城市是否包含市内用车权限(0-不包含,1-包含),trips最后一行视为终点城市

trips

参数名称 数据类型 必选 说明
departure_city string yes 出发地城市名称,如北京市
departure_city_id int yes 出发地城市id
destination_city string yes 目的地城市名称,如上海市
destination_city_id int yes 目的地城市id
start_date date yes 行程开始日期,如2017-01-10
end_date date yes 行程结束日期,如2017-01-20

差旅请求参数示例:

{   
    "client_id": "xxxxxx", 
    "access_token": "xxxxx", 
    "timestamp": "xxxxxx", 
    "company_id": "xxxxxx", 
    "approval_id": "xxxxxx",
    "approval_type": "1",
    "travel_detail": {
        "start_date": "xxxxxx",
        "end_date": "xxxxxx",
        "end_city_rule": "xxx",
        "trips": [
            {
                "departure_city_id": "110000",
                "departure_city": "北京",
                "destination_city_id": "310000",
                "destination_city": "上海",
                "start_date": "2017-03-01",
                "end_date": "2017-03-03"
            },
           {
                "departure_city_id": "310000",
                "departure_city": "上海",
                "destination_city_id": "410000",
                "destination_city": "深圳",
                "start_date": "2017-03-03",
                "end_date": "2017-03-05"
            },
            {
                "departure_city_id": "410000",
                "departure_city": "深圳",
                "destination_city_id": "110000",
                "destination_city": "北京",
                "start_date": "2017-03-05",
                "end_date": "2017-03-08"
            }
        ]
    },
    "sign": "xxxxxxxx"
}

请求示例

curl -X POST -H "content-type:application/json" \
-d '{"client_id":"client_id_test","access_token":"access_token_test","timestamp":1583487394,"company_id":"12345678980","phone":"11000001234","approval_id":"781948394919012","approval_type":1,"travel_detail":{"start_date":"2019-08-25","end_date":"2019-08-29","end_city_rule":1,"trips":[{"departure_city":"\u5317\u4eac\u5e02","departure_city_id":1,"destination_city":"\u4e0a\u6d77\u5e02","destination_city_id":11,"start_date":"2019-08-25","end_date":"2019-08-29"}]},"sign":"e54dbce9b2c6a60f6544507e280df77c"}' \
https://api.es.xiaojukeji.com/river/Approval/update

返回示例

{
    "errno": 0,
    "errmsg": "SUCCESS",
    "data": null

}

results matching ""

    No results matching ""