Skip to content

仓储管理

仓储管理

/station/task/purchase/data -- 采购任务

接口名
    /station/task/purchase/data
描述
    1. 拉取时间周期内站点的采购单列表
    2. 导出采购单列表数据
Method
    GET
请求
    cycle_start_time M string 周期开始时间(%Y-%m-%d-%H-%M-%S)
    time_config_id M string 服务时间配置ID
    out_stock_filter O bool 是否包含已出库订单
    export O int 导出标识
    export_id_list O list 需要导出的站点ID列表
    supply_station_id O string 过滤站点
响应
    code            M   int         错误码。0为成功、其他为错误。
    cout            M   int         统计数据
    data            M   int         返回信息
示例
    request
        http://127.0.0.1:8570/station/task/purchase/data?out_stock_filter=true&cycle_start_time=2016-11-28-09-30-00&time_config_id=ST137
    response
        {
            code: 0,
            data: [{
               total_price: 250,
               station_name: "蔬菜",
               source_order_ids: [
                   "PL361380"
               ],
               date_time: 1480305110,
               station_id: "T2658",
               status: 1,
               customer: {
                   extender: "{"
                   resname ": "
                   SR - \u65b0\ u83dc\ u6765\ u670d\ u52a1\ u7ad9\ uff08\ u65b0\ uff09 "}",
                   address_id: "T2652",
                   address: "江西省上饶市玉山县冰溪镇果蔬批发市场西栋1单元4号店",
                   receive_end_time: "2016-11-29 09:00:00",
                   address_sign_id: null,
                   receiver_name: "姜凯捷",
                   receive_begin_time: "2016-11-29 04:00:00",
                   uid: "T2652",
                   receiver_phone: "13607030720"
               },
               details: [{
                   quantity: 1,
                   origins: [{
                       order_id: "PL361380",
                       sku_id: "D1848492"
                   }],
                   purchase_quantity: 1,
                   mitems: [{
                       std_unit_name: "斤",
                       accept_std_count: 0.5,
                       sale_ratio: 0.5,
                       std_sale_price: 100,
                       spu_id: "C370091",
                       real_std_count: 0.5
                   }],
                   version: 5,
                   sort_station_ids: [],
                   real_quantity: 1,
                   sale_product: {
                       salemenu_id: "S2999",
                       sale_price: 50,
                       std_sale_price: 100,
                       category_id_2: "B7264",
                       category_title_1: "蔬菜",
                       name: "小葱|半斤",
                       std_unit_name: "斤",
                       sale_ratio: 0.5,
                       is_weigh: false,
                       category_title_2: "葱姜蒜",
                       sale_unit_name: "半斤",
                       station_id: "T2658",
                       category_id_1: "A1171",
                       id: "D1848491"
                   },
                   id: "D1848491"
               }, {
                   quantity: 2,
                   origins: [{
                       order_id: "PL361380",
                       sku_id: "D1845577"
                   }],
                   purchase_quantity: 2,
                   mitems: [{
                       std_unit_name: "斤",
                       accept_std_count: 2,
                       sale_ratio: 1,
                       std_sale_price: 100,
                       spu_id: "C369996",
                       real_std_count: 2
                   }],
                   version: 2,
                   sort_station_ids: [],
                   real_quantity: 2,
                   sale_product: {
                       salemenu_id: "S2999",
                       sale_price: 100,
                       std_sale_price: 100,
                       category_id_2: "B7259",
                       category_title_1: "蔬菜",
                       name: "生菜|外地",
                       std_unit_name: "斤",
                       sale_ratio: 1,
                       is_weigh: false,
                       category_title_2: "叶菜类",
                       sale_unit_name: "斤",
                       station_id: "T2658",
                       category_id_1: "A1171",
                       id: "D1845576"
                   },
                   id: "D1845576"
               }],
               id: "LK432570"
            }]
        }
逻辑
    获取请求参数
    通过time_config_id过滤本站点的销售单列表
    通过cycle_start_time获取查询的订单起始时间,默认查询当前周期内的订单
    销售单列表不存在:
        返回空数据
    销售单存在:
        获取订单信息(thrift接口)
            拉取当前站点的订单
            获取订单的上游订单ID
            拉取上游订单
            聚合上游订单信息
            如果需要获取商品详情则拉取商品详情
            组装thrift接口,返回
        返回结果