Skip to content

司机端重构

重写司机模块

DriverBaseView

DB

Driver

id
name
...

接口

登录

driver/login

参数名 M(必填)/O(可选)/C(有条件必填) 类型 说明
phone M str 电话号码
psw M str 密码

返回数据

Cookie:

session_id=********

数据包:

{
  "code":0,
  "msg": "ok",
  "data": {
    "name": "",
    "carrier": "",
    "plate_num": ""
  }
}

快速登录

driver/quick/login

返回

{
  "code":0,
  "msg": "ok",
  "data": {
    "name": "",
    "carrier": "",
    "plate_num": "",

  }
}

退出登录

driver/logout

返回

{
  "code":0,
  "msg": "ok",
}

修改密码

driver/psw/reset

参数名 M(必填)/O(可选)/C(有条件必填) 类型 说明
prev_psw M str 原密码
psw M str 新密码

返回

{
  "code":0,
  "msg": "ok"
}

司机上报位置

driver/pos/update

参数名 M(必填)/O(可选)/C(有条件必填) 类型 说明
lng M float 经度
lat M float 纬度

返回

{
  "code":0,
  "msg": "ok"
}

首页数据

driver/homepage

返回

{
  "code": 0,
  "msg": "ok",
  "data":{
    "to_diliver": 10,
    "finished": 3,
    "month": {
      "finished": 100,
      "addresses": 8,
      "sales": 10000, 
    }
  }
}

配送任务列表

driver/delivery/list

参数名 M(必填)/O(可选)/C(有条件必填) 类型 说明
undelivered O int, 1:true 0:false 筛选未配送任务

返回

{
  "code":0,
  "msg": "ok",
  "data": [{
            "lat": 0,
            "order_id": "PL1422649",
            "supplier": "小农女默认1",
            "pagination": "WyIyMDE4LTA0LTI2IDA2OjAwOjAwIiwgIjExMDU0MTciXQ==",
            "receiver_phone": "15221561189",
            "pay_status": 1,
            "total_pay": 6600,
            "receive_begin_time": "2018-04-26 06:00",
            "address": "赋安科技大厦",
            "resname": "蒋慧艳测试餐厅",
            "lng": 0,
            "receive_end_time": "2018-04-26 12:00"
  }]
}

订单详情

driver/delivery/detail

参数名 M(必填)/O(可选)/C(有条件必填) 类型 说明
order_no M str 订单号

返回

{
  "code":0,
  "msg": "ok",
  "data": [
    {
      "receiver_name": "蒋慧艳",   # 收货人
        "real_price": 6600,       # 出库金额
        "sele_manager": "SaaS体验账号_管理员",     # 销售经理
        "receiver_phone": "15221561189",         # 接收人电话
        "receive_begin_time": "2018-04-26 06:00",   # 送货时间
        "address": "赋安科技大厦",                    # 地址
        "pay_status": 1,                            # 支付状态
        "resname": "蒋慧艳测试餐厅",                   # 商户
        "details": [
            {
                "name": "菜心|小条",
                "real_quantity": 3,
                "quantity": 3,
                "total_item_price": 6600
            }
        ],
        "receive_end_time": "2018-04-26 12:00",
        "kid": "33193",
        "freight": 0,
        "total_pay": 6600,      # 应付金额
        "order_no": "PL1422649",    
        "total_price": 6600,    # 下单金额
        "sid": "27729",
        "status": 1,
        "abnormal_money": 0,    # 异常金额
        "refund_money": 0       # 退款金额
        "sale_unit_name": "斤"
    }
  ]
}

支付

driver/order/pay

参数名 M(必填)/O(可选)/C(有条件必填) 类型 说明
order_no M str 订单号

返回

{
    "code": 0,
    "msg": "ok"
    data:{
        "appId": APPID, 
        "timeStamp": 1599993993, 
        "nonceStr": NOUNCESTR,
        "package": "prepay_id=PREPARE_ID", 
        "signType": "MD5",
        "paySign": PAY_SIGN
    }
}

支付

driver/order/pay

参数名 M(必填)/O(可选)/C(有条件必填) 类型 说明
order_no M str 订单号

返回

{
    "code": 0,
    "msg": "ok"
    data:{
        "appId": APPID, 
        "timeStamp": 1599993993, 
        "nonceStr": NOUNCESTR,
        "package": "prepay_id=PREPARE_ID", 
        "signType": "MD5",
        "paySign": PAY_SIGN
    }
}

获取退货和异常的选项

driver/delivery/exception/options

参数:无

返回

{
    "code": 0,
    "msg": "ok",
    "data": {
        "sku_exception_solution": {
            "2": "货品减免(质量问题)",
            "9": "补货",
            "13": "核算账单",
            "14": "客户沟通",
            "62": "其它",
            "166": "市场缺货",
            "167": "换货"
        },
        "nosku_exception_solution": {
            "3": "核算账单",
            "16": "客户沟通",
            "63": "其它",
            "169": "税点",
            "171": "系统问题(公司承担)",
            "172": "进行备注",
            "173": "减免",
            "174": "销售补货",
            "175": "仓库补货",
            "184": "销售补贴",
            "185": "公司补贴"
        },
        "refund_solution": {
            "157": "放弃取货",
            "158": "商品损耗",
            "159": "退回供应商",
            "160": "二次销售",
            "161": "其他"
        },
        "sku_exception_reason": {
            "1": "未按用户时间到达",
            "5": "漏单",
            "6": "送错货品",
            "7": "下错单",
            "8": "需要备注",
            "10": "斤两不对(用户发现)",
            "12": "质量问题",
            "17": "规格问题",
            "22": "司机弄丢/弄坏",
            "25": "市场缺货(未出库)",
            "27": "系统问题",
            "61": "其它",
            "153": "采购问题",
            "176": "无法送达"
        },
        "nosku_exception_reason": {
            "15": "其它",
            "64": "补贴",
            "65": "付款问题",
            "67": "迟到",
            "154": "采购问题",
            "177": "需要备注",
            "178": "客户需要发票",
            "179": "逾期异常",
            "180": "系统问题",
            "182": "商品异常(需补货)",
            "183": "加单补单"
        },
        "order_remark_type": {
            "59": "客户沟通",
            "60": "补贴"
        }
    }
}

退货和异常修改

driver/delivery/order/exception/update

method: POST
以下参数可以参考ma的异常处理请求,基本copy的。
order_id            str         M               订单号
exception           list        O               异常   异常和退货只能有一个。
    sku_id              str         M               
    exception_reason    int         M               异常原因
        1:未按时间到达 5:漏单 6:送错货物 7:下错单 8:需要备注 10:斤两不对(用户发现)
        12:质量问题 17:规格问题 22:司机弄坏 25:市场缺货(未出库)27:系统问题 61:其他
        153:采购问题 176:无法送达

    solution            int         M               处理方式
        2:货品减免 9:补货 13:核算账单 14:客户沟通 62:其他 166:市场缺货 167:换货
    money_delta         str         M               金额变动,分
    department_blame_name   str     M               责任部门
    department_to_name      str     M               跟进部门
    station_blame_id        str     M               责任站点
    lose_money              str     M               赔付金额,元
    description             str     M               描述
    final_amount            str     M               记账数
    customer_info           str     M               未知  # 未知的可以看下ma那边前端怎么用的,后台没发现有什么用。
    item_info               str     M               未知
    exception_info          str     M               未知
refund              list        O               退货
    sku_id              str         M               
    exception_reason    int         M               异常原因
        1:未按时间到达 5:漏单 6:送错货物 7:下错单 8:需要备注 10:斤两不对(用户发现)
        12:质量问题 17:规格问题 22:司机弄坏 25:市场缺货(未出库)27:系统问题 61:其他
        153:采购问题 176:无法送达
    request_amount      str         M               退货数
    department_blame_name   str     M               责任部门
    department_to_name      str     M               跟进部门
    station_blame_id        str     M               责任站点
    station_to_id           str     M               跟进站点
    station_store_id        str     M               入库仓
    lose_money              str     M               赔付金额,元
    driver_id               int     M               取货司机id
    state                   int     M               未知
    description             str     M               描述
    customer_info           str     M               未知
    item_info               str     M               未知
    exception_info          str     M               未知





创建请求eg:
"exception":[{
    "sku_id": "D2460572",
    "exception_reason": 5,
    "solution": 2,
    "money_delta": "-1400",
    "department_blame_name": "01",
    "department_to_name": "01",
    "station_blame_id": "T1577",
    "lose_money": "1",
    "description": "23",
    "final_amount": "9",
    "customer_info": 0,
    "item_info": 0,
    "exception_info": 1
}],
"refund": [{
    "sku_id": "D2460572",
    "exception_reason": 1,
    "request_amount": "1",
    "department_blame_name": "2",
    "department_to_name": "3",
    "station_blame_id": "T248",
    "station_to_id": "T1577",
    "station_store_id": "T248",
    "lose_money": "1",
    "driver_id": 930,
    "state": 1,
    "description": "lala",
    "customer_info": 0,
    "item_info": 0,
    "exception_info": 1
}]

编辑请求eg:
"exception":[{
"sku_id": "D2460572",
    "exception_reason": 5,
    "solution": 2,
    "money_delta": "-1400",
    "department_blame_name": "01",
    "department_to_name": "01",
    "station_blame_id": "T1577",
    "lose_money": "1",
    "description": "23",
    "final_amount": "9",
    "id":214264,   # 新增以下两个,从获取异常信息接口找到。
    "ticket_id":0
}],
"refund":[{
    "sku_id": "D2460572",
    "exception_reason": 1,
    "request_amount": 1,
    "department_blame_name": "2",
    "department_to_name": "3",
    "station_to_id": "T1577",
    "station_store_id": "T248",
    "lose_money": "1",
    "driver_id": 930,
    "state": 2,
    "description": "lala",
    "id": 25382,   # 新增以下两个,从获取异常信息接口找到。
    "ticket_id": 0
}]

返回

{
  "code":0,
  "msg": "ok"
}

异常获取

driver/delivery/order/exception/get

method: get

order_id                str             M           订单id

返回

{
    "msg": "ok",
    "code": 0,
    "data": {
       "_id": "PL1563028",  #订单
       "supply_station_name": "供应商",   #供应商
       "real_quantity": 10.0,  #出库数
       "customer_name": "csd1123",    # 商户名
       "details": [
            {
                "name": "菜心|小条",
                "supplier": "小农女默认1",
                "real_quantity": 3,
                "id": "D1475919"
            }
        ],
        "refunds": [{        #退货
            "id": 25382,
            "department_blame_name": "2",   # 责任部门
            "ticket_id": 0,         #   
            "exception_reason_text": "需要备注",    # 异常原因
            "lose_money": 1,        # 应退金额
            "real_amount": 0.0,     # 赔付金额
            "state": 2,
            "station_store_id": "T248", # 入库站点
            "sku_id": "D2460572", #异常sku_id
            "station_to_name": "郑州-总仓", # 跟进站点
            "exception_reason": 8,      # 异常原因
            "department_to_name": "3",  # 跟进部门
            "description": "lala",
            "sku_name": "芥兰苗",
            "request_amount": 1.0,      # 退货数
            "station_to_id": "T1577",   # 跟进站点id
            "driver_id": 930
        }],
        "exception": [{
                "exception_solution_text": "货品减免(质量问题)",
                "department_blame_name": "0",   # 责任部门
                "ticket_id": 0,
                "exception_reason_text": "未按用户时间到达",
                "lose_money": 0,            
                "solution": 2,
                "money_delta": 0,
                "station_blame_id": "0",
                "sku_id": "D2460572",
                "exception_reason": 1,
                "salemenu_id": "0",
                "final_amount": 10.0,       # 记账数
                "department_to_name": "0",
                "description": "",
                "sku_name": "芥兰苗",
                "station_to_id": "",
                "id": 214356,
            }],


        }
    }

完成配送

driver/delivery/finish

参数名 M(必填)/O(可选)/C(有条件必填) 类型 说明
order_no M str 订单号

返回

{
  "code":0,
  "msg": "ok"
}