商户自定义编码
商户自定义编码
项目简介:新增一个字段用户保存商户自定义编码,并对其进行增改查 -- 相应的权限控制
-
数据新增
- tbl_address 中添加一个字段「res_custom_code」用于保存店铺(商户)自定义编码
- 默认值为空字符串,非必填字符串
- station 集合中通过代码兼容的方式增加一个字段「show_res_custom_code」
- 该字段标识是否在分拣系统中展示商户自定义编码
- ma -> 商户/商户列表/新建商户 -> 新增
- tbl_address 中添加一个字段「res_custom_code」用于保存店铺(商户)自定义编码
-
数据的获取,展示与修改
- ma -> 商户/商户列表/商户详情 -> 展示与修改
- ma -> 商户/商户列表 -> 展示
-
权限控制
- 权限数据表增加数据 - 通过 SQL 语句添加数据
- 打印模板
- 后端不检测模板的数据内容,前端传回的是一个 json 数据。
- 在模板使用的时候,与前端约定一个名字标识新增的商户自定义编码
-
分拣系统中根据站定系统设定来展示商户名称还是商户自定义编码
数据库变更
MySQL
需要在商户的的数据表 「tbl_address」中增加一个字段来保存「商户自定义编码」,同时要在权限表中增加关于商户自定义编码的展示权限。数据的改动均在 MySQL 中
* MySQL
> management
> tbl_address
> 新增字段名:res_custom_code
> 类型:String
> 默认值:""
> 实现方式:通过 SQL 语句实现
> xnn_core_product_2
> auth_promission
> 新增一条权限数据
> 实现方式:通过 SQL 语句实现
* SQL 语句
> tbl_address 加字段
ALTER TABLE `tbl_address`
ADD `res_custom_code`
VARCHAR(20) NOT NULL DEFAULT ''
COMMENT '商户自定义编码';
> 加权限
INSERT INTO `auth_permission`
(id,name,name_en,codename,content_type_id,level2_id)
VALUES
(626,'分拣任务信息展现','GET Restaurant Custom Code','get_res_custom_code',23,19);
Mongo
需要在站点的数据数据中增加一个字段 show_res_custom_code 标识是否使用商户自定义编码
* Mongo
> xnn_core_product_2
> station
> 新增字段:show_res_custom_code
> 类型: Int
> 取值范围:0使用商户名称 1使用商户自定义编码
> 默认值: 0使用商户名称
> 实现方式:代码兼容实现
Manage 模块
/custommanage/restaurant/add 新增商户
接口:
/custommanage/restaurant/add
class:
website/custommanage/views/custommanage.py/RestaurantAddView
方法:
POST
请求
################# 本次需求改动涉及的字段 ######################
res_custom_code O String 用户自定义编码[注1]
kid O String user_id
username O String 用户名
password O String 密码
payer_name O String 结算人
payer_telephone O String 结算电话
telephone O String 手机号
pay_method O Int 结算周期
settle_way O Int 结款方式
finance_status O Int 财务状况 0未冻结 1冻结 2未知 -99删除
whitelist O Int 是否白名单
company_name O String 公司名
restaurant_name M String 店铺名称
receiver_name M String 收货人
receiver_telephone M String 收货电话
district_code M String 城市code
area_level1 M Int 一级地址id
area_level2 M Int 二级地址id
restaurant_address M String 店铺地址
create_employee_id O String 开户经理id
sale_employee_id O String 销售经理id
salemenu_ids O List<String> 报价单id列表
check_out O Bool 审核状态
is_credit O Int 是否授信
credit_limit O Float 授信额度
lat O Float 纬度
lng O Float 经度
map_address O String 地图地址
settle_date_type O Int 结款方式
address_label_id O Int 商户标签id
响应:
code M Int 状态码
msg M String 状态消息
data M Dict 响应内容
{
KID M String 账户id
SID M String 店铺id
}
示例:
请求:
{
res_custom_code: 'test123456'
username: mmsh01
KID: K073655
company_name: 商户1
isEditPassword: false
telephone:
customer_type: 0
kid: K073655
settle_way: 1
payer_name: 测试删除
payer_telephone: 134
finance_status: 0
whitelist: 1
check_out: 1
pay_method: 2
settle_date_type: 1
is_credit: 0
lng: 114.088007
lat: 22.548645
address_label_id: 1911
map_address: 广东省深圳市福田区华强北街道红荔路185群星广场
restaurant_name: zzz
receiver_name: zzz
receiver_telephone: 13112345678
district_code: 440300
area_level1: 30300000000
area_level2: 30300500000
restaurant_address: 广东省深圳市福田区华强北街道红荔路185群星广场
create_employee_id: 2011
sale_employee_id: 2011
salemenu_ids: ["S21329"]
}
响应:
{
code: 0,
msg: 'ok',
data: {
KID: "K073655"
SID: "S312206"
}
}
说明:
* 注1 res_custom_code 用户自定义编码
由大写英文字母和数字组成,长度小于 11 个字符,小写字母后台会转换成大写
/custommanage/list 商户列表
接口:
/custommanage/list
class:
website/custommanage/views/custommanage.py/SearchView
方法:
GET
请求:
firstMenu O Bigint 一级标签
secondMenu O Bigint 二级标签
stationMenu O String 站点id
num O Int 返回数据量
page O Int 页数
check_out O Int 审核状态
city O Int 城市district_code
crtManeger O Int 开户经理
saleManager O Int 销售经理
salemenu O String 销售单id
pay_method O Int 结算周期
settle_way O Int 结款方式
search_text O String 搜索关键字
customer_type O Int 商户类型(1:店铺,2:个人)
address_label_id O Int 商户标签(无:-1)
export O Int 是否导出excel(1为导出)
响应:
code M Int 返回码、0:成功、其他:失败。
count M Int 返回商户数量
data M List<Dict> 商户信息
[
{
################# 本次需求改动涉及的字段 ######################
res_custom_code O String 用户自定义编码
KID M String 商户账户id(user_id)
cname M String 公司名
SID M String 商户id(address_id)
create_time M String 商户注册日期
username M String 登录账号
resname M String 店铺名
settle_way M Int 结款方式
pay_method M Int 结算周期
city M String 城市名
area_l1 M String 一级区域
area_l2 M String 二级区域
addr_detail M String 店铺地址
name M String 店铺联系人
telephone M String 电话
create_employee_name M String 开户经理
create_employee_phone M String 开户经理电话
sales_employee_name M String 销售经理
sales_employee_phone M String 销售经理电话
whitelist M Int 是否白名单
balance M Float 余额
service_station M String 从属站点列表
address_label M String/None 商户标签
customer_type M Int 商户类型(1:店铺,2:个人)
point M Int 积分
},
...
]
示例:
请求:
{
export: 0
firstMenu: 0
secondMenu: 0
stationMenu: 0
page: 1
city: 0
saleMenu: 0
num: 10
search_text:
address_label_id: 0
}
响应:
{
"code": 0,
"data": [{
"check_out": 1,
"user_id": 73655,
"address_label": null,
"create_time": "2019-08-19",
"KID": "K073655",
"customer_type": 1,
"cname": "商户1",
"create_employee_phone": "--",
"resname": "1",
"telephone": "134",
"pay_method": "周结",
"sales_employee_phone": "--",
"addr_detail": "123",
"settle_way": "先货后款",
"create_employee_name": "--",
"finance_status": 0,
"whitelist": 1,
"keycustomer": 0,
"area_l2": "下沙村",
"city": "东莞市",
"area_l1": "石排镇",
"sales_employee_name": "(待定)",
"service_station": ["喵喵总仓"],
"username": "mmsh01",
"point": 0,
"balance": 6885.93,
"name": "测试删除",
"SID": "S281196"
}],
"count": 1
}
说明:
商户管理页面、按照条件查询商户
绑定本group下的报价单即为本group的商户
商户数据导出也走的这个接口
/custommanage/get 商户详情
接口:
/custommanage/get
class:
website/custommanage/views/custommanage.py/GetView
方法:
GET
请求:
id M String 商户 id
响应:
code M Int 状态码
msg M String 状态消息
data M Dict 响应内容
{
area M Dict 层级化的area
{
area_level1_id M Dict 一级地理标签id
{
child M List<Dict> 二级地理标签信息列表
[
{
area_level2_id: area_level2_name
M M
二级地理标签id 二级地理标签名称
},
...
]
district_code M String 邮政编码
name M String 一级地理标签名称
},
...
}
city M Dict 城市信息
{
district_code M Dict 邮政编码
{
name M String 城市名称
area M Dict 城市区域信息
{
area_level1_id M Dict 一级地理标签id
{
name M String 一级区域名称
street M List<Dict> 街道信息
[
{
area_level2_id:area_level2_name
M M
二级地理标签id 二级地理标签名称
},
...
]
}
}
},
...
}
create_employee M Dict 区域内的开户经理(信息平台用户)
{
user_id M Dict 用户 id
{
name M String 用户名称
district_code M String/None 城市邮政编码
}
}
sale_employee M Dict 域内的销售经理
{
user_id M Dict 用户 id
{
name M String 用户名称
district_code M String/None 城市邮政编码
}
}
station_salemenu M Dict 站点报价单列表
[
{
stations_id M String 站点 id
stations_name M String 站点名称
salemenu_id M String 报价单 id
salemenu_name M String 报价单名称
},
...
]
station_salemenu M Dict 站点报价单列表
{
station_id M Dict 站点 id
{
district_code M String/None 城市邮政编码
salemenu M List<Dcit> 站点报价单
{
salemenu_id M String 报价单 id
salemenu_name M String 报价单名称
}
distribute_city_ids M List<String> 报价单分布城市id
[
district_code M String 城市邮政编码
...
]
key_url M String cms_key
name M String 站点名称
},
...
}
data M Dict 商户数据
{
################# 本次需求改动涉及的字段 ######################
res_custom_code O String 用户自定义编码
cname M String 公司名称
pay_method M Int 结算周期
settle_way M Int 结算方式
create_employee_name M String 开户经理
create_employee_id M Int 开户经理 id
credit_limit O Int 授信额度
username M String 登陆帐户
effective_date M DateTime 生效日期
lng M Float 东经度
lat M Float 北纬度
area_l2 M String 二级地理名称
area_l2_id M String 二级地理 id
area_l2_code M String 二级地理对应的城市 id
is_whitelist M Int 是否白名单
finance_status M Int 冻结状态
available_credit M Int 可用授信额度
resname M String 店铺名称
area_l1_code M String 一级地理对应的城市 id
KID M String 帐户 id
sales_employee_name M String 销售经理名称
settle_remind M Int 结算提醒
begintime M DateTime 收货开始时间
endtime M DateTime 收货结束时间
check_out M Int 审核状态
telephone M String 登陆帐户手机号
begin_day M Int 账单起始日
area_l1_id M String 一级地理 id
district_code M String 城市 id
sales_employee_id M Int 销售经理 id
bill_receiver M String 账单接收人
bill_address M String 账单接收地址
settle_date_type M Int 日期维度
settle_day M Int 结算日
payment_telephone M String 结款人电话
keycustomer M Int 是否是重点客户
payment_name M String 结款人名称
is_credit M Int 是否授信
area_detail M String 收货详细地址
receivephone M String 收货人电话
receiveperson M String 收货人名称
salemenus M List<Dict> 商户绑定的报价单
[
{
restaurant_id M Int 商户 id
service_station_id M String 配送站点 id
salemenu_id M String 报价单 id
station_id M String 服务站点 id
freight_id M String 运费模板 id
id M String 商户报价单 id
msg M String 配送范围消息
salemenu_name M String 报价单名称
service_station_name M String 服务站点名称
},
...
]
city M String 城市名称
map_address M String 地理位置
customer_type M Int 商户类型
SID M String 店铺 id
}
timereceive M List 收货时间列表
}
示例:
请求:
{
"id": "S330599"
}
响应:
{
"msg":"ok",
"code":0,
"data":{
"station_salemenu":{
"T5110":{
"district_code":"440300",
"salemenu":[
{
"salemenu_id":"S5181",
"salemenu_name":"【分仓一】水果报价单"
},
...
],
"distribute_city_ids":[
"440300"
],
"key_url":"xscs",
"name":"一分仓-李铭"
},
...
},
"area":{
"30100000000":{
"district_code":"440300",
"child":[
{
"30100100000":"华强北"
},
...
],
"name":"福田区"
},
...
},
"city":{
"350200":{
"area":{
"1390100000000":{
"street":[
{
"1390100100000":"集美街道"
},
...
],
"name":"集美区"
},
...
},
"name":"厦门市"
},
...
},
"data":{
"res_custom_code": "hello2gm"
"cname":" 西瓜",
"pay_method":2,
"create_employee_name":"--",
"credit_limit":99999999,
"username":"nick_test",
"effective_date":"2019-10-11",
"lng":114.039345,
"area_l2":"科技园",
"is_whitelist":1,
"area_l1":"南山区",
"finance_status":0,
"area_l2_id":"30200900000",
"available_credit":99999999,
"resname":"小西瓜",
"lat":22.543777,
"create_employee_id":0,
"area_l1_code":"440300",
"KID":"K346123",
"sales_employee_name":"(待定)",
"settle_remind":-1,
"begintime":null,
"check_out":1,
"telephone":"",
"begin_day":1,
"area_l1_id":"30200000000",
"district_code":"440300",
"sales_employee_id":-1,
"bill_receiver":null,
"settle_date_type":2,
"settle_day":1,
"area_l2_code":"440300",
"keycustomer":0,
"endtime":null,
"payment_telephone":"13112341234",
"payment_name":"刘小北",
"is_credit":1,
"bill_address":null,
"area_detail":"香梅路1061号中投国际商务中心",
"settle_way":1,
"receivephone":"13111223344",
"salemenus":[
{
"restaurant_id":330599,
"service_station_id":"T4969",
"salemenu_id":"S17099",
"station_id":"T4969",
"freight_id":"Y001785",
"id":570140,
"msg":"",
"salemenu_name":"三只松鼠",
"service_station_name":"总仓-李铭"
}
],
"city":"深圳市",
"map_address":"广东省深圳市福田区香梅路1061号",
"customer_type":1,
"SID":"S330599",
"receiveperson":"刘小南"
},
"create_employee":{
"1449":{
"district_code":null,
"name":"李铭"
},
...
},
"sale_employee":{
"1449":{
"district_code":null,
"name":"李铭"
},
...
},
"timereceive":[
"06:30",
"06:40",
"06:50",
"07:00",
"07:10",
"07:20",
"07:30",
"07:40",
"07:50",
"08:00",
"08:10",
"08:20",
"08:30",
"08:40",
"08:50",
"09:00",
"09:10",
"09:20",
"09:30",
"09:40",
"09:50",
"10:00",
"10:10",
"10:20",
"10:30",
"10:40",
"10:50",
"11:00"
]
}
}
说明:
/custommanage/restaurant/import 批量导入新建商户
接口:
/custommanage/restaurant/import
class:
website/custommanage/views/custommanage.py/RestaurantImportView
方法:
POST
请求:
data M List<Dict> 新建商户数据列表
[
{
################# 本次需求改动涉及的字段 ####################
res_custom_code O String 用户自定义编码
username M String 帐户
payer_name M String 结款人
settle_way O Int 结算方式 1先货后款 2先款后货
account_period_way O Int 账期方式 1按周期 2按额度
pay_method O Int 结款周期 1日结 2周结
settle_date_type O Int 时间维度 1下单时间 2收货时间
finance_status O Int 冻结 0非冻结 1冻结
whitelist O Int 财务白名单 0不加入 1加入
payer_telephone O String 结款电话
company_name O String 公司名称
restaurant_name M String 店铺名称
address_label_id O Int 商户标签 -1没有标签
receiver_name M String 收货人
receiver_telephone M String 收货电话
district_code M String 地理标签
area_level1 M String 一级地理标签
area_level2 M String 二级地理标签
restaurant_address M String 店铺地址
sale_employee_id M String 开户经理
salemenu_ids M List<String> 报价单 id 列表
}
]
响应:
code M Int 状态码
msg M String 状态消息
data M null
示例:
请求:
{
data: [{"username":"nick_test","payer_name":"刘小北","settle_way":1,"account_period_way":2,"pay_method":2,"settle_date_type":2,"finance_status":0,"whitelist":1,"payer_telephone":"13112341234","company_name":" 西瓜","restaurant_name":"小西瓜","address_label_id":-1,"receiver_name":"刘小南","receiver_telephone":"13111223344","district_code":"440300","area_level1":"30200000000","area_level2":"30200900000","restaurant_address":"香梅路1061号中投国际商务中心","sale_employee_id":-1,"salemenu_ids":["S17099"]}]
}
响应:
{"msg": "ok", "code": 0, "data": null}
说明:
/custommanage/edit 商户数据更新
接口:
/custommanage/edit
class:
website/custommanage/views/custommanage.py/EditView
方法:
POST
请求:
################# 本次需求改动涉及的字段 ##################
res_custom_code O String 用户自定义编码
id M String 店铺id
new_cname O String 公司名
telephone O String 手机号码
settle_way O Int 结款方式
paymentName M String 结算人
paymentTelephone M String 结算人电话
check_out O Int 审核状态
freezeState M Int 冻结状态 0非冻结 1冻结
white M Int 白名单状态 0关闭 1开启
shopName M String 店铺名称
address_label_id O Int 商户标签
receiver M String 收货人
receiverPhone M String 收货人电话
originalArea M Int 邮政编码
firstArea M Bigint 一级地址id
secondArea M Bigint 二级地址id
shopAddress M String 收货地址
lat O Float 纬度
lng O Float 经度
map_address O String 地理位置
creatEmployeeValue O Int 开户经理
saleEmployeeValue O Int 销售经理
is_credit O Int 账期方式 0按周期 1按额度
# 账期方式按额度
credit_limit O Float 授信额度
# 账期方式按周期
effective_date O Date 生效时间
begin_day O Int 起始日
settle_day O Int 结算日
settle_date_type O Int 日期纬度 1按下单日期 2按收货日期
pay_method O Int 结款周期
settle_remind O Int 结算提醒 -1表示不开启,1-7天表示结算日前几天提醒
status: O String 报价单修改状态 编辑和删除
service_station_id O Sting 配送站点
salemenu_id O String 报报价单id
响应:
code M Int 状态码
msg M String 状态消息
示例:
请求:
{
id: S312206
new_cname: 商户1
telephone:
settle_way: 1
paymentName: 测试删除
paymentTelephone: 134
check_out: 1
freezeState: 0
white: 1
shopName: zzz
address_label_id: -1
receiver: zzz
receiverPhone: 13112345678
originalArea: 440300
firstArea: 30300000000
secondArea: 30300500000
shopAddress: 广东省深圳市福田区华强北街道华新村交行大厦(红荔路)
lat: 22.549475
lng: 114.085846
map_address: 广东省深圳市福田区华强北街道华新村交行大厦(红荔路)
creatEmployeeValue: 2011
saleEmployeeValue: 2011
settle_date_type: 2
pay_method: 3
begin_day: 1
settle_day: 1
effective_date: 2019-09-16
settle_remind: -1
is_credit: 0
res_custom_code: 'hello2gm'
}
{
status: deleteSSM
record_id: 530223
id: S312206
}
响应:
{
code: 0
msg: "success"
}
说明:
该接口再编辑商户信息时,针对不同的内容会分别进行调用
Station 模块
/station/new 站点首页
接口:
/station/new
class:
website/station/views/station.py/StationTemplateView
方法:
GET
请求:
无
响应:
渲染后的 html 页面中加入一个字段 show_res_custom_code
show_res_custom_code M Int 是否展示商户自定义编码 0不展示 1展示
示例:
请求:
响应:
说明:
此字段用于控制展示商户自定义编码,默认值为 0,拥有「分拣任务信息展现」权限的用户可以更改此值
/station/orders 订单列表/按订单查看
接口:
/station/orders
class:
/website/station/views/order.py/TransportOrdersQueryView
方法:
GET
请求:
query_type M Int 查询类型 1下单时间 2运营时间 3收货时间
部分参数跟查询类型关联,枚举如下:
* query_type = 1 按下单时间查询,默认值为当天
start_date C String 开始时间[注1]
end_date C String 截止时间
* query_type = 2 按运营时间查询
time_config_id C String 运营时间id
cycle_start_time C String 运营开始时间
cycle_end_time C String 运营结束时间
* query_type = 3 按收货时间查询
receive_start_date C String 收货开始时间
receive_end_date C String 收货结束时间
search_text O String 搜索字段 支持订单号和商户搜索
client O String 订单来源 不传默认全部[注2]
status O Int 订单状态 1待分拣 5分拣中 10 配送中 15 已签收 不传默认全部
pay_status O Int 支付状态 1未支付 5部分支付 10已支付 不传默认全部
has_remark O Int 订单备注 1有备注 0无备注 不传默认全部
inspect_status O Int 装车状态 1未装车 2已装车 不传默认全部
stock_type O Int 出库状态 1未出库 2已出库 不传默认全部
is_print O Int 打印状态 0未打印 1已打印 不传默认全部
receive_way O Int 收货方式 1配送 2自提 不传默认全部
pick_up_st_id C Int 自提点id 不传默认全部
search_area O String 地理标签 不传默认全部
route_id O Int 线路Id 不传默认全部
carrier_id O Int 承运商id 不传默认全部
driver_id C Int 配送司机id 不传默认全部
salemenu_id O String 报价单id 不传默认全部
offset O Int 分页 查询起点偏移条数
limit O Int 分页 返回条数
响应:
code M Int 状态码
msg M String 状态消息
data M Dict 响应内容
{
total_sale_money_with_freight M String 下单金额
in_query M Bool 是否在搜索范围内
list M List<Dict> 订单详情数据列表
[
{
kind_of_sku M Int 商品种类数
number_of_sku M Float 商品下单数
abnormal_money M String 异常金额
client M Int 订单来源
client_desc M String 订单来源描述
coupon_amount M String 优惠金额
create_user M String 订单创建人
customer M Dict 商户信息
{
id M String 帐户id
address M String 地址信息
address_id M String 商户id
extender M Dict 扩展信息
{
########### 本次需求改动涉及的字段 ##############
res_custom_code O String 用户自定义编码
resname M String 商户名称
order_pay_method M string 支付方式
}
new_consumer M Int 是否是新客[注3]
pick_up_st_name M String 自提点名称
receive_way M Int 收货方式
receiver_name M String 收货方姓名
receiver_phone M String 收货方电话
salemenu_id M String 报价单id
station_id M String 站点id
date_time M Int 下单时间(秒)
date_time_str M String 下单时间
}
details M List<Dict> 订单 sku 列表
[
{
id M String sku_id
accept_quantity M Int 收货数量
detail_tax M String 商品税额
exc_quantity M Int 异常数量
quantity M Int 下单数量
real_item_price M String 真实总价(分)
real_quantity M Int 称重后数量
real_refund_quantity M Int 实际退货数
request_refund_quantity M Int 请求退货数
sale_price M String 销售单位价格
spu_id M String spu_id
spu_remark M String spu备注
sync_origin_id M String 真实交易id
tax_rate M Int 税率
total_item_pay M String 商品应付金额
total_item_price M String 商品出库金额
unit_price M String 基本单位价格
version M Int 版本号
},
...
]
driver_id M Int 配送司机id
driver_name M String 配送司机姓名
freeze M Int 订单状态 0未锁定 1锁定
freight M String 运费
id M String 订单id
inspect_status M String 装车状态 1未装车 2已装车
order_tax M String 订单税率
origin_total_price M String 订单总金额
outstock_status M Int 出库状态 1未出库 2已出库
pay_status M Int 支付状态
print_times M Int 打印次数
real_money M String 实际金额
receive_begin_time M String 收货开始时间
receive_end_time M String 收货结束时间
refund_kind M Int 退货商品种类数
refund_money M String 订单退货金额
remark M String 订单备注
route_name M String 配送线路名称
sale_money M String 订单金额
salemenu_ids M List<String> 报价单列表
[
salemenu_id M String 报价单id
]
sale_money_with_freight M String 订单金额(加运费)
sale_money_without_tax M String 订单金额(无税)
settle_way M Int 结算方式 1先货 2先款
sort_id M String 分拣序号
station_id M String 站点id
status M Int 订单处理状态
total_price M String 订单总金额
time_config_info M Dict 运营时间信息
{
desc M String 运营时描述
final_distribute_time M String 最晚配送时间
final_distribute_time_span M Int [注4]
name M String 运营时间名称
order_time_limit M Dict 下单时间限制
{
start M String 开始时间
end M String 结束时间
e_span_time M Int 下单起止时间跨天数
}
receive_time_limit M Dict 收货时间限制
{
start M String 开始时间
end M String 结束时间
s_span_time M Int [注5]
e_span_time M Int [注6]
receiveTimeSpan M String [注7]
}
service_time_creator M String 服务时间创建站点
task_begin_time M String 任务开始时间
type M Int 时间配置类型[注8]
_id M Int 运营时间id
}
},
...
]
pagination M Dict 分页对象
{
count M Int 查询结果条数
limit M Int 返回条数
offset M Int 查询起点偏移条数
}
}
示例:
请求:
{
start_date: 2019-08-28,
end_date: 2019-08-30,
query_type: 1,
search_text: PL8288223,
offset: 0,
limit: 20
}
响应:
{
"msg": "ok"
"code": 0,
"data": {
"total_sale_money_with_freight": "200.00",
"in_query": false,
"pagination": {
"offset": 0,
"count": 1,
"limit": 20
},
"list": [
{
"sale_money_with_freight": "205.00",
"settle_way": 1,
"coupon_amount": "0.00",
"date_time_str": "2019-08-29 20:22:56",
"refund_kind": 0,
"status": 10,
"details": [
{
"total_item_pay": "200.00",
"quantity": 2,
"unit_price": "100.00",
"total_item_price": "200.00",
"exc_quantity": 0,
"request_refund_quantity": 0,
"detail_tax": "0.00",
"real_item_price": "200.00",
"version": 2,
"sync_origin_id": "D8972178",
"real_refund_quantity": 0,
"spu_id": "C2091947",
"spu_remark": "",
"accept_quantity": 2,
"id": "D8972178",
"sale_price": "100.00",
"real_quantity": 2,
"tax_rate": 0
}
],
"driver_name": "陈司机",
"outstock_status": 1,
"origin_total_price": "200.00",
"print_times": 0,
"pay_status": 1,
"driver_id": 3384,
"route_name": "B2线路",
"sort_id": "2",
"receive_begin_time": "2019-08-30 06:00",
"total_price": "200.00",
"time_config_info": {
"final_distribute_time_span": 1,
"receive_time_limit": {
"end": "23:00",
"start": "06:00",
"receiveTimeSpan": "15",
"e_span_time": 1,
"s_span_time": 1
},
"desc": "午市",
"type": 1,
"service_time_creator": "T17188",
"final_distribute_time": "06:00",
"name": "午市",
"_id": "ST1748",
"task_begin_time": "06:00",
"order_time_limit": {
"start": "06:00",
"end": "22:30",
"e_span_time": 0
}
},
"salemenu_ids": [
"S10144"
],
"station_id": "T17188",
"date_time": 1567081376,
"sale_money": "200.00",
"freight": "5.00",
"real_money": "200.00",
"freeze": 0,
"remark": null,
"inspect_status": 1,
"client": 1,
"client_desc": "后台下单",
"abnormal_money": "0.00",
"sale_money_without_tax": "200.00",
"id": "PL8288223",
"create_user": "miaotest",
"receive_end_time": "2019-08-30 23:00",
"customer": {
"receiver_phone": "15909098765",
"address": "广东省深圳市福田区华强北街道振兴路366港澳城(华强北路)",
"extender": {
"order_pay_method": 2,
"resname": "店铺0725"
},
"pick_up_st_name": null,
"address_id": "260314",
"salemenu_id": "",
"station_id": "",
"id": "273918",
"receiver_name": "一一",
"new_consumer": 0,
"receive_way": 1
},
"refund_money": "0.00",
"order_tax": "0.00"
}
]
}
}
说明:
本次改动 在订单请求的数据中,增加一个字段「商户自定义编码」
参数说明:
* 注1 C -> conditional -> 某些条件下必选
* 注2 client -> 订单来源
1后台下单 2微信商城 3app 4微信小程序 5有赞推送 6开放平台 7后台补录 8云管家代客下单
* 注3 new_consumer -> 是否是新客
1首次下单 2下单次数在小于等于7次 0超过7次下单
* 注4 final_distribute_time_span -> 最晚配送时间和下单时间比的跨天数
* 注5 s_span_time -> 开始时间跟下单时间相比跨几天
* 注6 e_span_time -> 结束时间跟下单时间相比跨几天
* 注7 receiveTimeSpan -> 收货时间选项的时间间隔,单位分钟
* 注8 type -> 时间配置类型
0默认 1普通 2预售
/station/profile/update 系统/修改系统设置
接口:
/station/profile/update
class:
website/station/views/station.py/StationProfileUpdateView
方法:
POST
请求:
################## 本次改动涉及的字段 ########################
show_res_custom_code O Int 分拣任务信息展现
show_sku_outer_id M Int 商品 id 展示方式
default_settle_way O Int 默认结算方式
show_tax_rate O Int 税额展示
allow_order_remark O Bool 订单备注
suggest_price O Int 建议价格区间
allow_multi_batch O Int 扫码入库规则
generate_sort_num_rule O Int 分拣序号生成规则
in_stock_price_warning O Int 入库单价预警维度
sorting_product_code_type O Int 分拣商品码
weigh_stock_in O Int 地磅称重入库
weigh_check O Int 地磅称重判定
响应:
code M Int 状态码
msg M String 状态消息
data M 响应内容
示例:
请求:
{
show_sku_outer_id: 0
default_settle_way: 1
show_tax_rate: 1
allow_order_remark: 1
suggest_price: 1
show_order_remark: true
allow_multi_batch: 1
generate_sort_num_rule: 3
in_stock_price_warning: 1
sorting_product_code_type: 2
weigh_stock_in: 0
weigh_check: 1
}
响应:
{"code": 0, "data": null, "msg": "ok"}
说明:
/delivery/print 配送单打印 (假单)
接口:
/delivery/print
class:
website/delivery/views/edit_delivery.py/DeliveryPrintView
方法:
POST
请求:
ids M List<String> 订单 id 列表
type M Int 打印类型 1未编辑过的 2编辑过的 (这里传2)
响应:
code M Int 状态码
msg M String 状态消息
data M Dictionary 响应内容
{
delivery_details M List<Dict> 配送详情列表
[
{
############## 本次改动涉及的字段 ##############
res_custom_code M String 商户自定义编码
tax_number M Int 税号
refunds M List<Dict> 退货列表
[
{
detail_id M String 退货商品 id
type_text M String 退货原因
text M String 退货备注
money_delta M Float 退货金额
amount_delta M Float 退货数量
},
...
]
refunds M List<Dict> 退货列表
sort_id M String 分拣单号
coupon_amount M Float 优惠金额
receive_begin_time M DateTime 收货开始时间
receive_end_time M DateTime 收货结束时间
sid M Int 商户 id
receiver_phone M String 收货人电话
abnormal_money M Float 异常金额
id M String 订单 id
area_l1 M String 一级地区名称
pay_method M Dict 结款周期相关信息
{
pay_method M String 订单支付方式
begin_day M Int 起始日
settle_day M Int 结算日
cycle_length M Int 自定义周期长度
}
city M String 城市名称
driver_name M String 配送司机名称
origin_customer M Dict 原始订单信息
total_tax M String 总税金
remark M String 订单备注
settle_way M Int 订单结算方式
source_origin_id M String 原始订单号
total_pay M Float 订单总支付金额
total_price M Float 订单总金额
freight M Float 运费
child_sort_id M String 子分拣号
carrier M String 订单承运商名称
bill_address M String 账单地址
details M List<Dict> 订单详情列表
[
{
name M String 规格商品名称
real_weight M Float 实际重量
sale_price_without_tax
M String 销售价格
salemenu_id M String 报价单 id
remark M String 商品备注
std_sale_price M Float 基本单位售价
outer_id M String 自定义 id
origin_item_price M Float 锁价前的价格
org_item_price M Float sku镜像原金额
org_std_sale_price M Float sku镜像原基本单位价格
org_sale_price M Float sku镜像原销售单位价格
pinlei_title M String 品类名称
sale_ratio M Int 销售规格
tax M Float 税金
saleunit_weighting_quantity
M Float 销售单位称重数
real_item_price_without_tax
M Float 不含税应付金额
supplier_name M String 供应商名称
category_title_1 M String 一级分类名称
quantity M Float 下单数量
spu_name M String 商品名称
std_unit_name M String 基本单位的名称
sale_price M Float 销售单位价格
id M String sku_id
real_is_weight M Bool 是否是称重商品
category_title_2 M String 二级分类名称
total_item_price M Float 该商品下单总价
union_dispatch M Bool 是否统配
purchase_station_id
M String 供应商 id
specs M String 规格
sale_unit_name M String 销售单位名称
real_item_price M Float 该商品实际金额
is_price_timing M Int 是否时价
supplier_id M String 供应商 id
},
...
]
details M List<Dict> 订单详情列表
sales_name M String 销售经理名称
cname M String 公司名称
address M String 收货地址
receiver_name M String 收货人名称
resname M String 商户名称
template_id M Int 打印模板 id
sale_manager M Dict 销售经理信息
{
name M String 姓名
id M Int id
phone M String 手机号码
}
bill_receiver M String 账单接收人名称
date_time M DateTime 下单时间
real_price M Float 订单实际金额
address_route_name M String 配送路线名称
refund_money M Float 退货金额
driver_phone M String 配送司机名称
abnormals M List<Dict> 异常信息
[
{
type_text M String 异常原因文案
money_delta M Float 异常金额
detail_id M String 异常商品ID,非商品异常为0
text M String 描述
amount_delta M Float 异常数量
},
...
]
},
...
]
}
示例:
请求:
{
"ids": ["PL8796161"],
"type": 2
}
响应:
{
"msg": "ok",
"data": {
"delivery_details": [
{
"res_custom_code": "hello2gm"
"tax_number": 131459,
"refunds": [],
"sort_id": "",
"receive_begin_time": "2019-09-23 20:00",
"coupon_amount": 0,
"sid": "173573",
"receiver_phone": "10112341234",
"receive_end_time": "2019-09-23 20:30",
"id": "PL8796161",
"abnormal_money": 0,
"area_l1": "宝安区",
"pay_method": {
"settle_day": null,
"pay_method": 1,
"cycle_length": null,
"begin_day": null
},
"city": "深圳市",
"driver_name": "",
"origin_customer": {},
"total_tax": "0.00",
"remark": null,
"settle_way": 1,
"total_pay": 1317.92,
"source_origin_id": [],
"total_price": 1317.92,
"freight": 0,
"child_sort_id": "",
"carrier": "",
"bill_address": null,
"details": [
{
"res_custom_code": "hello2gm"
"std_sale_price": 23,
"quantity": 5.18,
"real_item_price": 119.14,
"origin_item_price": 23,
"outer_id": "",
"union_dispatch": true,
"org_std_sale_price": 2300,
"remark": "ZeBZpf",
"category_title_1": "海鲜",
"id": "D3454897",
"specs": "-",
"supplier_name": "[先进先出] 鱼肉供应商",
"sale_unit_name": "斤",
"saleunit_weighting_quantity": 5.18,
"real_item_price_without_tax": "119.14",
"std_unit_name": "斤",
"sale_price_without_tax": "23.00",
"purchase_station_id": "T10001",
"salemenu_id": "S7541",
"sale_price": 23,
"total_item_price": 11914,
"org_item_price": 23,
"real_weight": 5.18,
"category_title_2": "测试",
"tax": "0.00",
"name": "清江鱼",
"is_weigh": false,
"org_sale_price": 23,
"spu_name": "清江鱼",
"tax_rate": 0,
"supplier_id": "T10111",
"is_price_timing": 0,
"pinlei_title": "测试",
"sale_ratio": 1,
"real_is_weight": true
},
...
],
"sales_name": "",
"cname": "",
"address": "广东省深圳市南山区科技南一路1号",
"receiver_name": "101",
"resname": "101",
"template_id": 732,
"sale_manager": {
"phone": null,
"name": null,
"id": null
},
"bill_receiver": null,
"date_time": "2019-09-17T17:27:15",
"real_price": 1317.92,
"area_l2": "新安",
"address_route_name": "人民路",
"refund_money": 0,
"driver_phone": "",
"abnormals": []
}
]
},
"code": 0
}
说明:
请求不变,响应中增加「商户自定义编码」的字段「res_custom_code」
调用方式:供应链>配送任务>查看编辑单据>打印
供应链>订单列表>订单详情>编辑配送单>打印单据
从 delivery 库中的
tbl_delivery,
tbl_delivery_rules,
tbl_delivery_sku,
tbl_delivery_sku_rules
拉取数据
/station/user 获取用户数据
接口:
/station/user
class:
website/station/views/station.py/UserInfoView
方法:
GET
请求:
无
响应:
code M Int 状态码
msg M String 状态消息
data M Dict 响应消息
{
username M String 用户名
name M String 用户昵称
stock_method M Int 库存方式 1普通 2先进先出
profile M Dict 分拣系统设置数据
{
################## 本次修改新增的字段 ##################
show_res_custom_code M Int 是否显示商户自定义编码
weigh_stock_in M Int 地磅称重入库
weigh_check M Int 地磅称重判定
sorting_product_code_type M Int 分拣商品码
}
user_permission M List 用户权限列表
station_id M String 站点 id
station_name M String 站点名称
group_id M Int 用户组 id
id M Int 用户 id
type M Int 用户类型[注1]
}
示例:
请求:
无
响应:
{
"code":0,
"msg":"ok",
"data":{
"username":"miaomiao",
"name":"喵喵",
"stock_method":1,
"profile":{
"weigh_stock_in":0,
"weigh_check":0,
"sorting_product_code_type":1
},
"user_permission":[
"distribution_order_edit",
"delete_settle_supplier",
"get_turnover_loan_sheet",
"add_distribute_config",
...
],
"type":0,
"station_id":"T7936",
"id":3876,
"station_name":"喵喵总仓",
"group_id":356
}
}
说明:
参数说明:
* 注1 type 用户类型
admin = 999 # 管理员 type_id = 0 is_staff =1
normal = 0 # 普通用户 type_id =0 is_staff = 0
supplier = 1 # 供应商 type_id =1 is_staff =0
openapi = 6 # 开放平台 type_id =6 is_staff =0
Stock 模块
/stock/purchase_sheet/details 采购单据打印
接口:
/stock/purchase_sheet/details
class:
website/station/stock/views/purchase_sku.py/PurchaseSheetDetailsGetViewNew
方法:
GET
请求:
sheet_no M String 采购单据 id
响应:
code M Int 状态码
msg M String 状态消息
data M Dict 响应内容
{
in_stock_sheet_id M String 采购单据 id
purchase_sheet M Dict 采购单据基础数据
{
ref_price_type M Int 参考价格类型
create_time M DateTime 创建时间
station_name M String 站点名称
purchaser_phone_num M String 采购员电话
customer_id M String 供应商编号
operator M String 操作人
status M String 采购单据状态[注1]
submit_time O DateTime 提交时间
require_goods_sheet_status M Int 要货单状态[注2]
supplier_name M String 供应商名称
settle_supplier_id M String 供应商id
supplier_phone_num O String 供应商电话
}
task M Dict 采购任务详情列表
[
{
supplier_purchase_avg_price M Float 供应商采购均价
spec_name M String 采购规格名称
suggest_purchase_num M Float 建议采购数
purchase_amount M Float 采购数量
category_name_1 M String 一级分类名称
category_name_2 M String 二级分类名称
plan_amount M Float 计划采购数
release_id O Int 发布id
ratio M Float ratio比例
purchase_price M Float 采购价
pinlei_name M String 品类名称
already_purchased_amount M Float 已采购数
release_time O DateTime 发布时间
spec_id M String 采购规格id
std_unit_name M String 基本单位
address M List<Dict> 地址
[
{
######### 本次更新涉及的字段 ##############
res_custom_code M String 商户自定义编码
suggest_purchase_num M Float 建议采购数
address_id M String 商户 id
remark M String 商品备注
res_name M String 商户名称
sort_id M Int 分拣 id
plan_amount M Float 计划采购数
},
...
]
last_purchase_price O Float 最后一次采购价
ref_price M Float 参考价
status M Int 采购单据状态
purchase_unit_name M String 采购单位
spu_status M Int spu状态
stock M Float 库存
},
...
]
}
示例:
请求:
{
"sheet_no": "T4969-JHD-2019-10-12-00012"
}
响应:
{
"code":0,
"msg":"ok",
"data":{
"in_stock_sheet_id":"T4969-JHD-2019-10-12-00012",
"purchase_sheet":{
"ref_price_type":2,
"create_time":"2019-10-12T10:14:42.962",
"submit_time":"2019-10-12T10:14:44.538",
"settle_supplier_id":"T4975",
"supplier_name":"【总仓】水果供应商",
"require_goods_sheet_status":1,
"customer_id":"SG",
"status":2,
"supplier_phone_num":"15896596699",
"purchaser_phone_num":"13243647837",
"station_name":"总仓-李铭",
"operator":"13243647837"
},
"tasks":[
{
"purchase_amount":148.84,
"spec_id":"D2191514",
"plan_amount":148.84,
"suggest_purchase_num":145.08999999999997,
"category_name_1":"水果",
"ref_price":700,
"stock":3.75,
"release_id":117322492,
"address":[
{
"suggest_purchase_num":145.08999999999997,
"address_id":"160916",
"remark":"oY5f5e",
"res_name":"cvcvf4",
"sort_id":22,
"plan_amount":14.06
},
...
],
"ratio":1,
"release_time":"2019-10-12T10:13:46",
"spec_name":"黑美人【斤】",
"purchase_price":"700",
"already_purchased_amount":148.84,
"last_purchase_price":7,
"spu_status":1,
"status":3,
"purchase_unit_name":"斤",
"std_unit_name":"斤",
"pinlei_name":"西瓜",
"category_name_2":"瓜果",
"id":"5da137137a60f679ac8ed1df"
},
...
]
}
}
说明:
参数说明:
* 注1 status 采购单据状态
-1已删除 2已提交 3未提交
* 注2 require_goods_sheet_status 要货单状态
1未发送 2未提交 3已提交 4已删除
/stock/purchase_sheet/details_no_login 采购单据分享
接口:
/stock/purchase_sheet/details_no_login
class:
website/station/stock/views/purchase_sku.py/PurchaseSheetDetailsGetNoLoginViewNew
方法:
GET
请求:
sheet_no M String 采购单据 id
token M String token
_tace_group_id M Int 用户组 id
station_id M String 站定 id
响应:
code M Int 状态码
msg M String 状态消息
data M Dict 响应内容
{
in_stock_sheet_id M String 采购单据 id
purchase_sheet M Dict 采购单据基础数据
{
ref_price_type M Int 参考价格类型
create_time M DateTime 创建时间
station_name M String 站点名称
purchaser_phone_num M String 采购员电话
customer_id M String 供应商编号
operator M String 操作人
status M String 采购单据状态[注1]
submit_time O DateTime 提交时间
require_goods_sheet_status M Int 要货单状态[注2]
supplier_name M String 供应商名称
settle_supplier_id M String 供应商id
supplier_phone_num O String 供应商电话
}
task M Dict 采购任务详情列表
[
{
supplier_purchase_avg_price M Float 供应商采购均价
spec_name M String 采购规格名称
suggest_purchase_num M Float 建议采购数
purchase_amount M Float 采购数量
category_name_1 M String 一级分类名称
category_name_2 M String 二级分类名称
plan_amount M Float 计划采购数
release_id O Int 发布id
ratio M Float ratio比例
purchase_price M Float 采购价
pinlei_name M String 品类名称
already_purchased_amount M Float 已采购数
release_time O DateTime 发布时间
spec_id M String 采购规格id
std_unit_name M String 基本单位
address M List<Dict> 地址
[
{
######### 本次更新涉及的字段 ##############
res_custom_code M String 商户自定义编码
suggest_purchase_num M Float 建议采购数
address_id M String 商户 id
remark M String 商品备注
res_name M String 商户名称
sort_id M Int 分拣 id
plan_amount M Float 计划采购数
},
...
]
last_purchase_price O Float 最后一次采购价
ref_price M Float 参考价
status M Int 采购单据状态
purchase_unit_name M String 采购单位
spu_status M Int spu状态
stock M Float 库存
},
...
]
}
示例:
请求:
{
"sheet_no": "T4969-CGD-2019-10-12-00022"
"token": "6b013de6b90d7b97ea932f65f81c985d"
"__trace_group_id": 244
"station_id": "T4969"
}
响应:
{
"code":0,
"msg":"ok",
"data":{
"in_stock_sheet_id":"T4969-JHD-2019-10-12-00012",
"purchase_sheet":{
"ref_price_type":2,
"create_time":"2019-10-12T10:14:42.962",
"submit_time":"2019-10-12T10:14:44.538",
"settle_supplier_id":"T4975",
"supplier_name":"【总仓】水果供应商",
"require_goods_sheet_status":1,
"customer_id":"SG",
"status":2,
"supplier_phone_num":"15896596699",
"purchaser_phone_num":"13243647837",
"station_name":"总仓-李铭",
"operator":"13243647837"
},
"tasks":[
{
"purchase_amount":148.84,
"spec_id":"D2191514",
"plan_amount":148.84,
"suggest_purchase_num":145.08999999999997,
"category_name_1":"水果",
"ref_price":700,
"stock":3.75,
"release_id":117322492,
"address":[
{
"suggest_purchase_num":145.08999999999997,
"address_id":"160916",
"remark":"oY5f5e",
"res_name":"cvcvf4",
"sort_id":22,
"plan_amount":14.06
},
...
],
"ratio":1,
"release_time":"2019-10-12T10:13:46",
"spec_name":"黑美人【斤】",
"purchase_price":"700",
"already_purchased_amount":148.84,
"last_purchase_price":7,
"spu_status":1,
"status":3,
"purchase_unit_name":"斤",
"std_unit_name":"斤",
"pinlei_name":"西瓜",
"category_name_2":"瓜果",
"id":"5da137137a60f679ac8ed1df"
},
...
]
}
}
说明:
请求不变,响应中 data -> task -> address 中增加字段
res_custom_code 商户自定义编码
/purchase/task/print 采购任务/单据打印
接口:
/purchase/task/print
class:
website/purchase_task/views/purchase_task.py/PurchaseTaskPrintView
方法:
GET
请求:
q_type C Int 查询类型 1按下单时间 2按运营周期 3按收货时间
######################## 按运营周期查询 #########################
time_config_id O String 时间配置ID
q O String 搜索字段,支持订单号和商品名称搜索
begin_time C DateTime 开始时间
end_time C DateTime 结束时间
category1_ids O List 一级分类
category2_ids O List 二级分类
pinlei_ids O List 品类
status O Int 任务状态
order_status O Int 订单状态
settle_supplier_id O String 供应商筛选 id
purchaser_id O Int 筛选的采购员id
route_id O Int 线路id
weight_status O Int 分拣状态 1已完成 2未完成
has_created_sheet O Bool 是否生成采购单 0未生成 1已生成
limit O Int 分页参数
响应:
code M Int 状态码
msg M String 响应消息
data M List<Dict> 响应内容
[
{
station_name M String 采购单位
customer_id M String 供应商编号
tasks M List<Dick> 采购任务列表
[
{
std_unit_name M String 基本单位名称
address_count M Int 商户数
addresses M List<Dict> 商户需求数据列表
[
{
######### 本次更新涉及的字段 ##############
res_custom_code M String 商户自定义编码
plan_purchase_amount
M Float 计划采购量
sort_id M String 分拣 id
res_name M String 店铺名称
sale_ratio M Int 销售比例
remark M String 订单备注
sale_unit_name M String 销售单位名称
address_id M String 店铺 id
}
]
suggest_purchase_num M Float 建议采购量
sale_unit_name M String 销售单位名称
category2_name M String 二级分类名称
price M Int 参考价格
category1_name M String 一级分类名称
sale_ratio M Int 销售比例
pinlei_name M String 品类名称
stock M Float 库存量
sku_name M String sku 名称
},
...
]
settle_supplier_id M String 供应商 id
settle_supplier_name M String 供应商名称
supplier_phone_num M String 供应商电话
purchaser_phone_num M String 采购员电话
purchaser M List<Dcit> 采购员数据列表
[
{
purchaser_id M Int 采购员 id
purchaser_name M String 采购员名称
},
...
]
},
...
]
示例:
请求:
{
"q_type": 1
"q": ""
"q_type": "2019-10-12 00:00:00"
"q_type": "2019-10-12 00:00:00"
"limit": 10
}
响应:
{
"code": 0,
"msg": "ok"
"data": [
{
"station_name":"[去采购报价单] 总仓",
"customer_id":"Qu07",
"tasks":[
{
"std_unit_name":"KG",
"address_count":1,
"addresses":[
{
"plan_purchase_amount":9.51,
"sort_id":"16",
"res_name":"来来aaa",
"sale_ratio":1,
"remark":"m3bKcq",
"sale_unit_name":"KG",
"address_id":"305301"
},
...
],
"suggest_purchase_num":3073.679999999999,
"sale_unit_name":"KG",
"category2_name":"水果",
"price":100,
"category1_name":"水果",
"sale_ratio":1,
"stock":-2786.22,
"pinlei_name":"水果",
"sku_name":"芒果"
},
...
],
"settle_supplier_id":"T28873",
"supplier_phone_num":"",
"settle_supplier_name":"综合供应商",
"purchaser_phone_num":"-,15666666666",
"purchaser":[
{
"purchaser_id":204210,
"purchaser_name":"去采购张三"
},
{
"purchaser_id":3581,
"purchaser_name":"张三"
}
]
},
...
]
}
说明:
请求不变,响应中 data -> task -> address 中增加字段
res_custom_code 商户自定义编码
Sorting 模块
/station/distribute/get_order_by_id 配送单打印
接口:
distribute/get_order_by_id
class:
website/station/views/distribute_task.py/GetOrderByIdView
方法:
GET
请求:
# 非全选的情况下,传订单列表
ids M List<String> 订单 id 列表
# 全选的情况下,传筛选条件
order_start_time O Date 下单开始日期,格式2019-05-01
order_end_time O Date 下单结束日期,格式2019-05-01
time_config_id O String 运营时间id
cycle_start_time O String 运营周期开始时间格式2017-01-01 09:30
cycle_end_time O String 运营周期结束时间格式2017-01-01 09:30
receive_start_time O Date 收货开始日期格式2019-05-01
receive_end_time O Date 收货开始日期格式2019-05-01
search_text O String 搜索关键字
carrier_id O Int 承运商id
driver_id O Int 过滤的司机id
route_id O Int 线路id(无线路为-1)
area_id O String 区域编码
area_level O Int 区级
order_status O Int 订单状态
is_print O Bool 是否打印
unassigned O Bool 未分配
receive_way O Int 收货方式 1配送 2自提
pick_up_st_id O Int 自提点id
响应:
code M Int 状态码
msg M String 状态消息
data M List<Dict> 响应消息
[
{
############## 本次改动涉及的字段 ##############
res_custom_code M String 商户自定义编码
receiver_phone M String 收货人电话
area_l2 M String 二级区域名称
sale_manager M Dict 销售经理信息
{
name M String 姓名
id M Int id
phone M String 手机号码
}
abnormals M List<Dict> 异常信息
[
{
type_text M String 异常原因文案
money_delta M Float 异常金额
detail_id M String 异常商品ID,非商品异常为"0"
text M String 描述
amount_delta M Float 异常数量
},
...
]
area_l2 M String 二级区域名称
remark M String 订单备注
cname M String 商户公司名
address M String 地理位置
total_pay M String 总支付金额
real_price M String 实际订单金额
source_origin_id M String 原始单号
address_route_name M String 线路名称
total_tax M String 税金
resname M String 商户名称
abnormal_money M String 异常金额
child_sort_id M String 子分拣号
coupon_amount M String 优惠券金额
id M String 订单 id
area_l1 M String 一级区域名称
details M List<Dict> 商品详情列表
[
{
tax_rate M Float 税率
is_set_tax M Int 设置税率
name M String 规格商品名称
real_weight M Float 实际重量
sale_price_without_tax
M String 销售价格
salemenu_id M String 报价单 id
remark M String 商品备注
life_time M DateTime 保质期
std_sale_price M Float 基本单位售价
outer_id M String 自定义 id
desc M String 商品描述
origin_item_price M Float 锁价前的价格
org_item_price M Float sku镜像原金额
org_std_sale_price M Float sku镜像原基本单位价格
org_sale_price M Float sku镜像原销售单位价格
pinlei_title M String 品类名称
sale_ratio M Int 销售规格
tax M Float 税金
saleunit_weighting_quantity
M Float 销售单位称重数
real_item_price_without_tax
M Float 不含税应付金额
supplier_name M String 供应商名称
category_title_1 M String 一级分类名称
quantity M Float 下单数量
spu_name M String 商品名称
std_unit_name M String 基本单位的名称
sale_price M Float 销售单位价格
id M String sku_id
real_is_weight M Bool 是否是称重商品
category_title_2 M String 二级分类名称
total_item_price M Float 该商品下单总价
union_dispatch M Bool 是否统配
purchase_station_id
M String 供应商 id
specs M String 规格
sale_unit_name M String 销售单位名称
real_item_price M Float 该商品实际金额
is_price_timing M Int 是否时价
supplier_id M String 供应商 id
production_time M DateTime 生产日期
},
...
]
freight M String 运费
sort_id M String 分拣序号
date_time M DateTime 下单时间
template_id M Int 打印模板 id
refund_money M String 订单退款金额
bill_address M String 账单地址
address_sign M String 地理标签名称
receive_begin_time M DateTime 收货开始时间
receive_end_time M DateTime 收货结束时间
pay_status M Int 订单支付状态
sales_name M String 销售经理名称
sid M String 帐户id
total_price M String 订单总金额
pay_method M Dict 结款周期相关信息
{
pay_method M String 订单支付方式
begin_day M Int 起始日
settle_day M Int 结算日
cycle_length M Int 自定义周期长度
}
receiver_name M String 收货人名称
driver_phone M String 配送司机电话
refunds M List<Dict> 退货列表
[
{
detail_id M String 退货商品 id
type_text M String 退货原因
text M String 退货备注
money_delta M Float 退货金额
amount_delta M Float 退货数量
},
...
]
address_sign M String 地理标签名称
address_sign_id M String 地理标签 id
username M String 帐户名称
create_user M String 订单创建人
origin_customer M Dict 原始订单信息
{
address_sign M String 地理标签名称
resname M String 商户名称
origin_order_id M String 原订单 id
child_sort_id M String 子分拣号
address_id M String 店铺 id
origin_address M String 原地址
origin_receiver_name M String 原收货人名称
origin_receiver_phone M String 原收货人电话
origin_area M String 原地区
origin_resname M String 原商户名称
}
receive_way M Int 收货方式
carrier M String 配送承运商
driver_name M String 司机名称
tax_number M Int 税号
city M String 城市名称
},
...
]
示例:
请求:
{
"ids": ["PL8882507"]
}
响应:
{
"code":0
"msg":"ok",
"data":[
{
"receiver_phone":"13978889876",
"area_l2":"华侨城",
"sale_manager":{
"name":null,
"id":null,
"phone":null
},
"abnormals":[
],
"remark":"hello world",
"cname":"测试店铺",
"address":"广东省深圳市福田区南园街道飞扬时代大厦",
"total_pay":"4.44",
"real_price":"4.44",
"source_origin_id":"",
"address_route_name":"人民路",
"total_tax":"0.00",
"resname":"测试店铺",
"abnormal_money":"0.00",
"child_sort_id":"",
"coupon_amount":"0.00",
"id":"PL8882507",
"area_l1":"南山区",
"res_custom_code": "hello2gm"
"details":[
{
"name":"兰花豆",
"real_weight":4.44,
"sale_price_without_tax":"1.00",
"salemenu_id":"S18665",
"remark":null,
"life_time":null,
"std_sale_price":1,
"outer_id":"",
"desc":"",
"org_item_price":4.44,
"pinlei_title":"坚果",
"sale_ratio":1,
"tax":"0.00",
"saleunit_weighting_quantity":4.44,
"real_item_price_without_tax":"4.44",
"supplier_name":"三只松鼠",
"category_title_1":"三只松鼠",
"origin_item_price":2.33,
"quantity":4.44,
"org_sale_price":1,
"spu_name":"兰花豆",
"std_unit_name":"包",
"sale_price":1,
"real_is_weight":true,
"id":"D13415925",
"is_weigh":false,
"tax_rate":0,
"category_title_2":"三只松鼠",
"total_item_price":4.44,
"union_dispatch":true,
"org_std_sale_price":1,
"purchase_station_id":"T10001",
"specs":"-",
"sale_unit_name":"包",
"production_time":null,
"real_item_price":4.44,
"is_price_timing":false,
"supplier_id":"T36221"
}
],
"freight":"0.00",
"sort_id":"人民路-1-1",
"date_time":"2019-09-20 15:56:44",
"template_id":732,
"refund_money":"0.00",
"bill_address":null,
"address_sign":"华侨城",
"receive_end_time":"2019-09-21 06:00",
"pay_status":1,
"sales_name":"",
"sid":"266603",
"total_price":"4.44",
"receive_begin_time":"2019-09-21 04:00",
"pay_method":{
"pay_method":1,
"settle_day":null,
"cycle_length":null,
"begin_day":null
},
"receiver_name":"刘一一",
"driver_phone":"",
"refunds":[
],
"address_sign_id":"30200200000",
"username":"test0802",
"create_user":"xjxc01",
"origin_customer":{
},
"receive_way":1,
"carrier":"",
"settle_way":1,
"bill_receiver":null,
"driver_name":"",
"tax_number":131472,
"city":"深圳市"
}
],
}
说明:
请求不变,响应中增加「商户自定义编码」的字段「res_custom_code」
调用方式:
1 供应链>配送任务>单据打印图标
2 供应链>订单列表>订单详情(点击订单号)>打印
从 mongo>order_new 中拉取订单数据,是真实的数据
/weight/skus 分拣数据
接口:
/weight/skus
class:
website/weight/views/sku_views.py/GetWeightSkusView
方法:
POST
请求:
time_config_id O String 运营时间 id
date M Date 分拣日期
is_weight O Int 是否称重
has_weighted O Int 是否完成称重
category1_ids O List 一级分类 id 列表
category2_ids O List 二级分类 id 列表
spu_ids O List spu_id 列表
group_ids O List 用户组 id 列表
out_of_group O Int 按未分组的spu筛选 1是 0否
sku_search O String 商品搜索
order_search O String 订单搜索
diff O String 差异打印[注1]
next O String 分页搜索起始节点
clean_food O Bool 是否是净菜
响应:
code M Int 状态码
msg M String 状态消息
data M Dict 响应消息
{
orders M Dict 订单数据
{
order_id M Dict 订单号
{
############# 本次改动新增的字段 #####################
res_custom_code M String 商户自定义编码
batch_remark M String 分拣备注
route_name M String 配送线路名称
generate_sort_num_rule M Int 分拣码生成规则
order_remark M String 订单备注
order_sort_num M Int 订单分拣号
sort_id M Int 分拣单号
address_name M String 商户名称
},
...
}
skus M List<Dict> 商品数据列表
[
{
spu_name M String 商品名
purchase_supplier_phone M String 采购供应商电话
category1_name M String 一级分类名称
category2_name M String 二级分类名称
remark M String 商品备注
spu_id M String spu_id
purchase_supplier_name M String 采购供应商名称
std_sale_price M Int 基本单位销售价格
out_of_stock M Bool 是否缺货
is_weight M Bool 是否称重
id M String sku_id
address_id M String 商户 id
order_id M String 订单 id
saleunit_weighting_quantity M Float 称重数(销售单位)
has_weighted M Bool 是否完成称重
std_unit_name M String 基本单位计量单位名称
real_quantity M Float 实际称重数量
route_name M String 配送线路名称
name M String 规格名称
img_url M String 图片链接
quantity M Float 重量
sort_way M Int 分拣渠道
last_print_time M DateTime 上次打印时间
order_status M Int 订单支付状态
sale_unit_name M String 销售单位计量单位名称
sale_unit_price M Int 销售单位价格
weighting_quantity M Int 称重数量
category_id_1 M String 一级分类 id
sale_ratio M Int 销售规格
},
...
]
pagination M Dict 分页数据字典
}
示例:
请求:
{
"time_config_id": "ST662",
"date": "2019-10-11"
}
响应:
{
"msg":"ok",
"code":0,
"data":{
"orders":{
"PL9399886":{
"batch_remark":"",
"route_name":"人民路",
"generate_sort_num_rule":1,
"order_remark":"",
"order_sort_num":44,
"sort_id":"44",
"address_name":"海底捞(南山店)"
},
...
},
"skus":[
{
"spu_name":"哈密瓜",
"purchase_supplier_phone":null,
"category1_name":"水果",
"remark":"6r0dIb",
"category2_name":"瓜果",
"category_id_2":"B18497",
"spu_id":"C1078024",
"purchase_supplier_name":"综合供应商",
"std_sale_price":100,
"out_of_stock":false,
"is_weight":true,
"id":"D16766982",
"address_id":"274223",
"order_id":"PL9399409",
"saleunit_weighting_quantity":12.9,
"has_weighted":false,
"std_unit_name":"斤",
"real_quantity":12.9,
"route_name":"人民路",
"name":"哈密瓜|不分投",
"img_url":"",
"quantity":12.9,
"sort_way":0,
"last_print_time":null,
"order_status":10,
"sale_unit_name":"斤",
"sale_unit_price":100,
"weighting_quantity":0,
"category_id_1":"A3835",
"sale_ratio":1
},
...
],
"pagination":{
"next":null
},
}
}
说明:
请求不变,在响应中 data -> orders -> 订单数中增加字段
res_custom_code 商户自定义编码
参数说明:
* 注1 diff 差异打印
all 全部 weight 重量差异 new 新增商品 remove 删除商品