文 档 中 心 / Document Center
搜索 管理中心
壹川接口文档V3
添加一条新普线
更新时间:2018-04-19 14:50:11   更新人员:叶洋   文档状态:完成 #190    测试接口
摘要
添加一条新普线
  1. 接口基本信息
    接口名称:新增一条普线
    请求方法:POST
    接口地址:line/normalline
    登录验证:是
  2. 请求参数
    参数名 参数 数据类型 是否必须 示例值 说明
    start_net_id 起点 string
    end_net_id 终点 string
    title 线路简称 string
    full_title 线路名称 string 线路全称
    distance 线路里程 float
    duration 预计耗时 int
    overtime_limit 超时提醒 int 单位小时 0为不限制
    description 线路描述 string
    base_price 底价 float 默认0.0000
    rate{} 分成 object
    ├ from ├ 起始网点分成 float 单位:百分之一
    └ to └ 终止网点分成 float 单位:百分之一
    charge{} 阶梯计费 object
    ├ gbw[] ├ 重货公式 array
    │ ├ wmin │ ├ 阶梯开始值 float 按大于阶梯开始值
    │ ├ wmax │ ├ 阶梯结束值 float 小于并等于截止值
    │ ├ wdj │ ├ 单价 float 单位为:元/kg
    │ ├ wxfl │ ├ 下浮率 float 下伏率只有在多线时才会生效,此处取值范围为:0-99的整数,单位:%;
    │ ├ wdesc │ ├ 阶段收费说明 string
    │ └ wformula │ └ 阶段公式 string [[wgt]]*1.5*(1-[[mul]]*0.04)
    └ gbv[] └ 轻货公式 array
      ├ vmin   ├ 阶梯开始值 float 大于阶梯开始值
      ├ vmax   ├ 阶梯结束值 float 小于并等于截止值
      ├ vdj   ├ 单价 float 单位为:元/m3
      ├ vxfl   ├ 下浮率 float 下伏率只有在多线时才会生效,此处取值范围为:0-99的整数,单位:%;
      ├ vdesc   ├ 阶段收费说明 string
      └ vformula   └ 阶梯公式 string [[vol]]*5*(1-[[mul]]*0.04)
  3. 响应数据参数
    参数名 参数 数据类型 示例值 说明
    line_id 线路id string
  4. 请求示例
    请求例子:
     
    apirq('line/normalline', {
        method: "post",
        data: {
            "start_net_id": "d466b9497ccc7924",
            "end_net_id": "c84dfc14b0fe119f",
            "title": "测试添加普线",
            "full_title": "测试普线",
            "distance": "234154",
            "duration": "24213",
            "overtime_limit": 0,
            "description": "这是一条测试添加的普线",
            "base_price": 5,
            "rate": {
                "from": 30,
                "to": 70
            },
            "charge": {
                "gbw": [
                    {
                        "wmin": 0,
                        "wmax": 3,
                        "wdj": 1.7,
                        "wxfl": 3,
                        "wdesc": "从0到3千克单价为1.7元,多线时下浮百分之3",
                        "wformula": "[[wgt]]*1.7*(1-[[mul]]*0.03)"
                    },
                    {
                        "wmin": 3,
                        "wmax": 20,
                        "wdj": 1.6,
                        "wxfl": 3,
                        "wdesc": "从3到20千克单价为1.6元,多线时下浮百分之3",
                        "wformula": "[[wgt]]*1.6*(1-[[mul]]*0.03)"
                    },
                    {
                        "wmin": 20,
                        "wmax": 100,
                        "wdj": 1.1,
                        "wxfl": 6,
                        "wdesc": "从20到100千克单价为1.1元,多线时下浮百分之6",
                        "wformula": "[[wgt]]*1.1*(1-[[mul]]*0.06)"
                    }
                ],
                "gbv": [
                    {
                        "vmin": 0,
                        "vmax": 20,
                        "vdj": 8.9,
                        "vxfl": 3,
                        "vdesc": "从0到20方单价为8.9元,多线时下浮百分之3",
                        "vformula": "[[vol]]*8.9*(1-[[mul]]*0.03)"
                    },
                    {
                        "vmin": 20,
                        "vmax": 80,
                        "vdj": 8.5,
                        "vxfl": 5,
                        "vdesc": "从20到80方单价为8.5元,多线时下浮百分之5",
                        "vformula": "[[vol]]*8.5*(1-[[mul]]*0.05)"
                    }
                ]
            }
        }
    }) 
    
    返回数据结果:
     
    {
        "code": 0,
        "msg": "数据添加成功!",
        "time": "1524119360",
        "data": {
            "line_id": "9437234ced99aaa9",
            "type": 0,
            "start_net_id": "d466b9497ccc7924",
            "end_net_id": "c84dfc14b0fe119f",
            "status": 0,
            "run_status": 0,
            "approval_status": 0,
            "protocol_status": 0,
            "distance": 234154,
            "duration": 24213,
            "overtime_limit": 0,
            "run_times": 0,
            "waybill_count": 0,
            "listbill_count": 0,
            "create_time": "2018-04-19 14:29:21",
            "create_by": {
                "uid": "0000000000000001",
                "code": "U1000000",
                "username": "administrator",
                "nickname": "超级管理员",
                "realname": "超级管理员"
            },
            "update_time": "2018-04-19 14:29:21",
            "update_by": {
                "uid": "0000000000000001",
                "code": "U1000000",
                "username": "administrator",
                "nickname": "超级管理员",
                "realname": "超级管理员"
            },
            "delete_time": null,
            "base_price": "5.0000",
            "title": "测试添加普线",
            "full_title": "测试普线",
            "initials": "cstjzx",
            "description": "这是一条测试添加的普线",
            "protocol_notpass": ",d466b9497ccc7924,c84dfc14b0fe119f,",
            "path_ids": ",d466b9497ccc7924,c84dfc14b0fe119f,",
            "path_data": {
                "line_type": 1,
                "total_base_price": 5,
                "is_multi": false,
                "path_ids": ",d466b9497ccc7924,c84dfc14b0fe119f,",
                "charge_main": {
                    "gbv": [
                        {
                            "vdesc": "从0到20方单价为8.9元,多线时下浮百分之3",
                            "vdj": 8.9,
                            "vformula": "[[vol]]*8.9*(1-[[mul]]*0.03)",
                            "vmax": 20,
                            "vmin": 0,
                            "vxfl": 3
                        },
                        {
                            "vdesc": "从20到80方单价为8.5元,多线时下浮百分之5",
                            "vdj": 8.5,
                            "vformula": "[[vol]]*8.5*(1-[[mul]]*0.05)",
                            "vmax": 80,
                            "vmin": 20,
                            "vxfl": 5
                        }
                    ],
                    "gbw": [
                        {
                            "wdesc": "从0到3千克单价为1.7元,多线时下浮百分之3",
                            "wdj": 1.7,
                            "wformula": "[[wgt]]*1.7*(1-[[mul]]*0.03)",
                            "wmax": 3,
                            "wmin": 0,
                            "wxfl": 3
                        },
                        {
                            "wdesc": "从3到20千克单价为1.6元,多线时下浮百分之3",
                            "wdj": 1.6,
                            "wformula": "[[wgt]]*1.6*(1-[[mul]]*0.03)",
                            "wmax": 20,
                            "wmin": 3,
                            "wxfl": 3
                        },
                        {
                            "wdesc": "从20到100千克单价为1.1元,多线时下浮百分之6",
                            "wdj": 1.1,
                            "wformula": "[[wgt]]*1.1*(1-[[mul]]*0.06)",
                            "wmax": 100,
                            "wmin": 20,
                            "wxfl": 6
                        }
                    ]
                },
                "sections_divide": [
                    {
                        "sort": 0,
                        "net_id": "d466b9497ccc7924",
                        "rate": 30,
                        "base_price": 1.5
                    },
                    {
                        "sort": 1,
                        "net_id": "c84dfc14b0fe119f",
                        "rate": 70,
                        "base_price": 3.5
                    }
                ],
                "sublines_conf": [
                    {
                        "sort": 0,
                        "net_from": "d466b9497ccc7924",
                        "net_to": "c84dfc14b0fe119f",
                        "sub_rate": 100,
                        "all_rate_from": 30,
                        "all_rate_to": 70,
                        "sub_rate_from": 30,
                        "sub_rate_to": 70
                    }
                ]
            },
            "start_net": {
                "net_id": "d466b9497ccc7924",
                "com_id": "05d48fa8743570b0",
                "code": "N89672",
                "name": "杭州",
                "contacts": "李云",
                "mobile": "13422223333",
                "lng": "120.181620",
                "lat": "30.229713",
                "district_id": 44189
            },
            "end_net": {
                "net_id": "c84dfc14b0fe119f",
                "com_id": "05d48fa8743570b0",
                "code": "N71809",
                "name": "江夏2",
                "contacts": "王小云",
                "mobile": "132001244456",
                "lng": "113.283244",
                "lat": "23.211662",
                "district_id": 1692
            },
            "path_nets": [
                {
                    "net_id": "c84dfc14b0fe119f",
                    "com_id": "05d48fa8743570b0",
                    "code": "N71809",
                    "name": "江夏2",
                    "contacts": "王小云",
                    "mobile": "132001244456",
                    "lng": "113.283244",
                    "lat": "23.211662",
                    "district_id": 1692,
                    "cominfo": {
                        "com_id": "05d48fa8743570b0",
                        "code": "C57732",
                        "name": "天天向上2",
                        "address": "四川省成都市青羊区西御河街道大树拐街15号五福街56号院",
                        "contacts": "李白",
                        "mobile": "13212345678"
                    }
                },
                {
                    "net_id": "d466b9497ccc7924",
                    "com_id": "05d48fa8743570b0",
                    "code": "N89672",
                    "name": "杭州",
                    "contacts": "李云",
                    "mobile": "13422223333",
                    "lng": "120.181620",
                    "lat": "30.229713",
                    "district_id": 44189,
                    "cominfo": {
                        "com_id": "05d48fa8743570b0",
                        "code": "C57732",
                        "name": "天天向上2",
                        "address": "四川省成都市青羊区西御河街道大树拐街15号五福街56号院",
                        "contacts": "李白",
                        "mobile": "13212345678"
                    }
                }
            ]
        }
    } 
    
本书创建于 2018-03-30 12:03:13 ?如有疑问,请联系技术人员