Skip to content

订单打印记录

订单打印记录

  • Author: zhaofei
  • Status: update
  • Type: Standards
  • Created: 2018-9-3

/station/task/distribute/orders 获取任务订单列表

接口描述:  
    配送任务中获取订单任务列表   
方法:  
    GET  
请求  
    start_date  M   datetime    查询开始日期
    end_date    M   datetime    查询截止日期
    offset      O   int         分页偏移量
    limit       O   int         分页每页限制数量
    is_print O  bool 打印状态 为0为未打印,为1为打印
请求示例:  
https://station.guanmai.cn/station/task/distribute/orders/get?order_start_time=2018-09-03&order_end_time=2018-09-03&limit=20&count=1&offset=0&is_print=0 
响应:  
 pagination M   int     分页信息
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   string  返回json数据
响应示例:  
{
     "pagination": {
                  "limit": 20, 
                  "count": 1, 
                  "offset": 0
                  }, 
      "msg": "ok", 
      "code": 0, 
      "data": {
               "order": [
                            {
                             ...
                                //新增加
                             "print_times":3    NUM 打印次数
                             ...
                             } 
                         ]
               }

/station/orders 供应链订单列表

接口描述:  
    供应链订单列表  
方法:  
    GET  
请求:  
    ...
    //新增
    is_print O bool//0 或者1  
    ...
请求示例:
https://station.guanmai.cn/station/orders?start_date=2018-09-03&end_date=2018-09-03&query_type=1&search_text=&offset=0&limit=20?is_print=1
响应:  
    原来基础上添加print_times字段  
    ...
    data O str  
    ...
响应示例:  
{
    "msg": "ok", 
    "code": 0, 
    "data": {
        "list": [{
            "station_id": "T11790", 
            "status": 1,
            ...
            "print_times":3  //新增加
            ... 
            }]
        }
}

/station/print_log/create 提交打印

接口描述:  
    新的接口,提交打印记录
方法:
    post
请求:
    ids   M   list      订单号
    sheet_type M  操作类型 目前配送单type 为 1
请求示例:
    https://station.guanmai.cn/station/print_log/create?sheet_type=1&id=XXXXX
响应:
    {
    "msg": "ok", 
    "code": 0, 
    }

数据库结构:

order_new:

    "_id" : "PL296993",         // 订单ID
    "date_time" : ISODate("2016-07-08T23:58:04.869Z"),      // 下单时间
    ...
    //新增
    "print_times":4    //number类型    老数据是NULL,逻辑加判断
    "details" : [
        {
            "material" : [
                // 以下结构为SPU结构
                {
                    "std_unit_name" : "份",
                    ...
                }
            ...
             }
    ],
    ...

新的数据库表 print_log

_id
operator    string --操作人
operate_time    time
sheet_type      num  --目前1 是配送单
sheet_id   string  --单号