分拣迭代 销售单位称重录入
分拣迭代
数据库结构改动
mongo:
order_new表:
details 新增字段
sorting_saleunit_weighting_quantity
逻辑:做兼容:没有这个字段就默认取quantity(下单数,销售单位)
mysql:
tbl_order_detail_2019xx # mysql订单详情表新增字段: 称重数(销售单位)
sorting_saleunit_weighting_quantity # # 新增字段,表示普通PL单称重数据
tbl_order_supply_chain # 上下游订单关系表
saleunit_weighting_amount # 新增字段,表示LK单中PL单称重数据
修改订单创建微服务接口/order/create
说明:纯后端逻辑改动
生成sku detail时给字段sorting_saleunit_weighting_quantity默认值
https://station.guanmai.cn/weight/skus 【修改老接口: 增加销售单位称重数返回 】
请求方法: GET(PAD) POST(PC)
请求:
time_config_id M str
date M date
响应:
code M int 0 为成功,其它为失败
msg M str 错误提示信息
data M map 分拣任务信息
例子:
request:
无
response:
{
"data": {
"pagination": {
"next": null
},
"skus": [
{
"saleunit_weighting_quantity": 40, // 新增销售单位称重数返回
"out_of_stock": false,
"sale_weighting_quantity": 0.0,
"jingcai_has_sorted": false,
"spu_id": "C1355555",
"order_id": "PL6142078",
"category1_name": "蔬菜",
"category2_name": "叶菜",
"route_name": "无线路",
"sale_unit_name": "斤",
"has_weighted": false,
"name": "广州白菜",
"quantity": 40.0,
"is_weight": true,
"remark": "",
"sale_unit_price": 1.0,
"std_sale_price": 1.0,
"real_quantity": 40.0,
"sale_ratio": 1.0,
"last_print_time": null,
"sort_way": 0,
"id": "D7608692",
"category_id_1": "A3978",
"category_id_2": "B48867",
"img_url": "https://img.guanmai.cn/product_pic/62605eaa82583478.jpeg",
"std_unit_name": "斤",
"weighting_quantity": 0.0
}
],
"orders": {
"PL6142078": {
"route_name": "无线路",
"batch_remark": "",
"sort_id": "1",
"generate_sort_num_rule": 1,
"address_name": "海底捞南头店",
"order_sort_num": 1
}
}
},
"code": 0,
"msg": "ok"
}
https://station.guanmai.cn/weight/sku/saleunit_weight/update 【新增接口: 设置销售单位称重数接口】
请求方法: POST
请求:
weights[ M list
{ M map
sku_id M str
order_id M str
weight M float // 当前称重数,值为https://station.guanmai.cn/weight/skus接口返回的saleunit_weighting_quantity
set_weight M float // 设置的称重数
source_order_id O str // 如果是LK单,需要传,如果不是,不需要
}
]
响应(不变):
code M int 0 为成功,其它为失败
msg M str 错误提示信息
data M null
例子:
request:
"weights": [
{
"sku_id": "D7552558",
"order_id": "LK6142077",
"weight": 0, // 当前称重数,销售单位
"set_weight": 5 // 要设置的称重数, 销售单位
'source_order_id': 'PL6142077' // 返回的数据中有source_order_id字段时原样返回
}
]
response:
无
https://station.guanmai.cn/weight/skus/export 【修改老接口:绩效导出】
说明: 按订单分拣和按商品分拣的绩效导出接口, 完全异步导出,前端无需改动
请求方法: GET
请求(不变):
time_config_id M 运营时间id
start_date M 开始日期
end_date M 结束日期
export M 导出 1,绩效导出 2,缺货导出
响应(不变):
code M int 0 为成功,其它为失败
msg M str 错误提示信息
data M map
例子:
request:
time_config_id: ST2076
start_date: 2019-07-01
end_date: 2019-07-02
export: 1
response:
{
"data": {"task_id": 436613},
"code": 0,
"msg": "ok"
}
https://station.guanmai.cn/weight/skus/export 【修改老接口:绩效导出】
请求方法: POST
请求(不变):
time_config_id M str 运营时间id
date M date 日期
export M int 导出 1,绩效导出
响应(修改):
code M int 0 为成功,其它为失败
msg M str 错误提示信息
data M list 分拣sku信息列表
例子:
request:
time_config_id: ST2076
date: 2019-07-02
export: 1
response:
{
"data": [
{
"saleunit_weighting_quantity": 10, // 新增称重数(销售单位),返回
"is_weighting_task": false,
"resname": "海底捞",
"category1_name": "水果",
"order_id": "PL7075451",
"employee_number": "",
"sort_id": "无线路-1",
"real_quantity": "10.00",
"sale_unit_name": "斤",
"sale_ratio": 1.0,
"spu_id": "C1275635",
"user_name": "miaomiao",
"base_weight_num": "10.00",
"category2_name": "瓜果",
"driver_name": null,
"base_order_num": "10.00",
"name": "有籽西瓜",
"std_unit_name": "斤",
"sort_way": "未分拣",
"is_weight": true,
"quantity": "10.00",
"operate_time": "2019-07-01 17:03:15",
"id": "D7565591"
},
{
"saleunit_weighting_quantity": 10, // 新增称重数(销售单位),返回
"is_weighting_task": true,
"resname": "八合里(深圳总店)",
"category1_name": "畜类",
"order_id": "PL7078610",
"employee_number": "",
"sort_id": "R-1",
"real_quantity": "3.50",
"sale_unit_name": "斤",
"sale_ratio": 1.0,
"spu_id": "C1375698",
"user_name": "miaomiao",
"base_weight_num": "3.50",
"category2_name": "猪",
"driver_name": null,
"base_order_num": "5.00",
"name": "飞排",
"std_unit_name": "斤",
"sort_way": "常规分拣",
"is_weight": true,
"quantity": "5.00",
"operate_time": "2019-07-01 17:41:17",
"id": "D7552687"
}
],
"code": 0,
"msg": ""
}
https://station.guanmai.cn/delivery/print 【修改老接口: 配送单打印接口】
说明:请求不变,响应增加saleunit_weighting_quantity销售单位称重数返回
请求方法: POST
请求(不变):
ids M list 订单id列表
type M int 1:未编辑过的 2:编辑过的 (这里传2)
响应(修改:新增称重数(销售单位)返回):
code M int 0 为成功,其它为失败
msg M str 错误提示信息
data M null
例子:
request:
无
response:
{
"code":0,
"msg":"ok",
"data": {
"delivery_details":[
{
"id": "PL5051844",
"sid": "118695",
"sales_name": "",
"cname": "商户公司",
"city": "长沙市",
"area_l1": "芙蓉区",
"area_l2": "湘湖街道",
"resname": "测试1",
"receive_begin_time": "2019-03-11 18:00",
"receive_end_time": "2019-03-12 09:30",
"address": "收货地址",
"abnormal_money": "0.00",
"date_time": "2019-03-11 12:15:39",
"driver_name": "司机名称",
"source_origin_id": "",
"child_sort_id": "",
"origin_customer": {},
"tax_number": 139154,
"pay_method": {
"begin_day": null,
"settle_day": null,
"pay_method": 1,
"cycle_length": null
},
"refunds": [
"detail_id":"D234533"
'type_text':"异常原因"
'text':"异常描述",
'money_delta':"异常金额",
'amount_delta':"异常数量"
],
"abnormals": [
"detail_id":"D234533"
'type_text':"异常原因"
'text':"异常描述",
'money_delta':"异常金额",
'amount_delta':"异常数量"
],
"sort_id": "分拣序号",
"carrier": "承运商A",
"settle_way": 1,
"refund_money": "0.00",
"remark": "订单备注",
"receiver_phone": "13312345645",
"address_route_name": "线路",
"real_price": "122.20",
"freight": "0.00",
"total_price": "122.20",
"total_pay": "122.20",
"receiver_name": "买卖qs",
"bill_receiver": null,
"bill_address": null,
"driver_phone": "13456789012",
"sale_manager": {
"id": null,
"name": null,
"phone": null
}, //销售经理
"details": [
{
"saleunit_weighting_quantity": 3.0, // 新增称重数(销售单位)返回
"id": "D4440479",
"name": "宽叶菠",
"category_title_1": "蔬菜",
"category_title_2": "叶菜",
"pinlei_title": "菠菜",
"spu_name": "宽叶菠",
"std_sale_price": 100,
"sale_price": 100,
"real_item_price_without_tax": "1.00",
"sale_price_without_tax": "1.00",
"real_item_price": 1,
"origin_item_price": 0,
"org_item_price": 1,
"org_sale_price": 1,
"org_std_sale_price": 1,
"total_item_price": 1,
"tax_rate": 0,
"sale_ratio": 1,
"sale_unit_name": "斤",
"std_unit_name": "斤",
"real_is_weight": true,
"tax": "0.00",
"union_dispatch": true,
"desc": "",
"real_weight": 1,
"is_weigh": false,
"quantity": 1,
"is_price_timing": false,
"salemenu_id": "S9993",
"remark": null,
"specs": "-",
"outer_id": ""
},
{
"saleunit_weighting_quantity": 3.0, // 新增称重数(销售单位)返回
"id": "D4440479",
"name": "宽叶菠",
"category_title_1": "蔬菜",
"category_title_2": "叶菜",
"pinlei_title": "菠菜",
"spu_name": "宽叶菠",
"std_sale_price": 1,
"sale_price": 1,
"real_item_price_without_tax": "1.00",
"sale_price_without_tax": "1.00",
"real_item_price": 1,
"origin_item_price": 0,
"org_item_price": 1,
"org_sale_price": 1,
"org_std_sale_price": 1,
"total_item_price": 1,
"tax_rate": 0,
"sale_ratio": 1,
"sale_unit_name": "斤",
"std_unit_name": "斤",
"real_is_weight": true,
"tax": "0.00",
"union_dispatch": true,
"desc": "",
"real_weight": 1,
"is_weigh": false,
"quantity": 1,
"is_price_timing": false,
"salemenu_id": "S9993",
"remark": null,
"specs": "-",
"outer_id": ""
}
...
]
}
]
}
}