@lina
2020-08-23T12:35:21.000000Z
字数 12791
阅读 287
列表项
新版货达人
1.1
后台
- 【测试url】http://api.volunteer.alpha.flashdiet.cn/api
- 【线上url】/api
X-auth-token
: [string] 登录后获取的token
信息, 取window.token 请求头带此字段X-org-code
: [string]https://www.zybuluo.com/mdeditor# 机构表识字段,所有请求均需要此字段,取window.orgCode 请求头带此字段X-location
: [string] 坐标 lng-lat 请求头带此字段X-unique-key
: [string] 服务端下发的标识,取window.uniqueKey 请求头带此字段X-city
: [string] 所在城市名称 请求头带此字段X-platform-code
: [string] 平台标识字段,所有请求均需要此字段,取window.platformCode 请求头带此字段
- POST请求Content-Type为:Content-Type:application/x-www-form-urlencoded
- 文件上传时Content-Type为:Content-Type:multipart/form-data
- 对于:Content-Type:application/json:Content-Type:application/xml不保证完全支持,请谨慎使用
- 【线上url】待定
- 【测试url】http://api.volunteer.alpha.flashdiet.cn/api/
- 【线上url】/api/
通用图片上传文件服务
请求URL
POST
/image
请求参数
file
: 文件
响应
{
error_code: 0,
data: {
url: 'http://xxx'
}
}
url
: [string] 文件的访问URL
注:请求图片时,需解析图片的cookie,不然无法认证
GET
/captcha
POST
/verifycode
请求参数
captcha_code
: [string] 图形验证码phone
: [string] 手机号
响应
{
error_code: 0,
data: {
}
}
error_code
: [int] 服务器状态码,0 为正常状态,异常状态待定。error_message
:[string] 错误信息,但error_code
不为 0 时返回
data
: [object] 数据字段,所有响应数据都在此字段中list
: [array],当返回数据为列表时会将数据放在该字段
page
: [int] 当前页码,默认为1total
: [int] 总页数pageSize
: [int]
每页数量:本项目常用page_size==10
示例
{
status: 0,
msg: '',
data: {
list: [{
key: value
}],
total: 23
}
}
sex
:[int]0: 未知
1: 男
2: 女
verify_status
:[int]0: 审核中
1: 通过
2: 驳回
status
: [int]0:未启用
1:启用
status
: [int]0:待抢单
1:已抢单
2:已拒绝
3:已完成
4:订单未完成
{
id: 123,
nick_name: '梦里花落知多少',
real_name: 'xx',
phone: '15500000000',
sex: 1,
avatars: 'http://image.com/1.jpeg',
id_number: 110101198803031321,
bank_number: '7112312321',
id_card_front: 'url',
id_card_back: 'url',
sign_photo: 'url',
company_id: 12,
region_id: 12,
bus_quarter_id: 23,
department_id: 12,
bus_depart_id: 12,
last_month_income: 0,
total_income: 0,
intro_courier_id: 12,
intro: @用户基本信息
user_remarks:'银行卡所属分行是 支行是'
}
id
: [int] 用户IDnick_name
: [string] 用户名phone
: [string] 用户手机avatars
: [string] 头像real_name
: [string] 姓名sex
: [integer] 性别id_number
: [string] 身份证号bank_number
: [string] 银行卡号bank_name
: [string] 银行名称id_card_front
: [string] 身份证正面照片urlid_card_back
: [string] 身份证反面照片urlsign_photo
: [string] 签字照片company_id
: [int] 快递公司idregion_id
: [int] 大区idbus_quarter_id
: [int] 营业区iddepartment_id
: [int] 分部id,可能为空bus_depart_id
: [int] 营业部idlast_month_income
: [int] 上月收入total_income
: [int] 总收入intro_courier_id
: [int] 被推荐人的courier_idintro
: [object] 被推荐人的基本用户信息,可能为空user_remarks
: [string] 用户备注
{
id: 12,
courier_id: 1232,
remark: '中关村南大街',
start_time: '7112312321',
end_time: 7777.23,
status: 0,
company:{
@快递公司
},
region: {
@大区
},
bus_quarter: {
@营业区
},
department: {
@分部
},
bus_depart: {
@营业部
}
}
id
: [int] 订单IDcourier_id
: [string] 快递员用户idremark
: [string] 线路备注start_time
: [date] 开始时间end_time
: [date] 结束时间status
: [integer] 订单状态company
: [obj] 快递公司信息region
: [obj] 大区信息bus_quarter
: [obj] 营业区信息department
: [obj] 分部信息(可能为null)bus_depart
: [obj] 营业部信息
公司
{
id: 12,
company_name: 1232,
contact_name: '中关村南大街',
contact_phone: '7112312321',
status: 0,
province_id: 0,
province_name: 0,
city_id: 0,
city_name: 0,
county_id: 0,
county_name: 0,
bus_quarter_num: 12,
region_num: 123,
addr: 0,
}
id
: [int] 公司IDcompany_name
: [string] 公司名称contact_name
: [string] 联系人姓名contact_phone
: [string] 联系人电话status
: [int] 启用弃用状态province_id
: [string] 省份idprovince_name
: [string] 省份名称city_id
: [string] 城市idcity_name
: [string] 城市名称county_id
: [string] 区县idcounty_name
: [string] 区县名称addr
: [string] 具体地址bus_quarter_num
: [int] 营业区数量region_num
: [int] 大区数量
其他的看数据库吧,就不一一写出来,字段基本都一样的
分部相对于公司等,多个一个后台管理用户对象
{
id: 12,
department_name: 1232,
contact_name: '中关村南大街',
contact_phone: '7112312321',
status: 0,
province_id: 0,
province_name: 0,
city_id: 0,
city_name: 0,
county_id: 0,
county_name: 0,
addr: 0,
user: {
username: 'xxx'
}
}
id
: [int] 分部IDdepartment_name
: [string] 分部名称contact_name
: [string] 联系人姓名contact_phone
: [string] 联系人电话status
: [int] 启用弃用状态province_id
: [string] 省份idprovince_name
: [string] 省份名称city_id
: [string] 城市idcity_name
: [string] 城市名称county_id
: [string] 区县idcounty_name
: [string] 区县名称addr
: [string] 具体地址user
: [obj] 后台管理对象
营业部就不列出来,字段基本都一样的
{
id: 12,
company_id: 1232,
region_id: 12,
bus_quarter_id: 12,
department_id: 0,
bus_depart_id: 12,
route: "路径1",
status: 1,
}
id
: [int] 分部IDroute
: [string] 路径名称(长度最大256)status
: [int] 0 禁用 1 启用
{
liability_compensation:有责赔偿
platform_award: 平台奖励,
}
liability_compensation
: [string] 有责赔偿platform_award
: [string] 平台奖励
{
company:公司名称
contact_name: 联系人
contact_phone: 联系人电话
business: 主营业务
courier_num: 合作伙伴人数
}
请求URL
PUT
/courier/${courier_id}
请求参数
- 除了之前的字段,还添加了下面两个字段
leader_id
: [string] 角色为队员时必填,为队长的courier_idrole_type
: [int] 0队长,1队员【必填】
响应
{
"status": 0,
"msg": "保存成功",
"data": null
}
请求URL
GET
/courier/${courier_id}
请求参数
无
响应
队员只会有leader对象,队长会有teammates
{
"status": 0,
"msg": "保存成功",
"data": {
@用户基本信息
teammates: [
{
id: 1,
real_name: 'xxx',
leader_id: 12,
}
],
leader: {
id: 1,
real_name: 'xxx',
leader_id: 12,
}
}
}
请求URL
GET
/courier/${courier_id}/teammates
请求参数
page
: [string] 当前页数 【必填】pageSize
: [string] 每页数量【非必填】
响应
{
"status": 0,
"msg": "保存成功",
"data": {
list: [
@用户基本信息
],
total: 122 // 总数
}
}
请求URL
GET
/courier/get_leader
请求参数
phone
: [string] 手机号必须是11位手机号 【必填】
响应
{
"status": 0,
"msg": "保存成功",
"data": [
{
"id": 1, // courier表对应的id
"real_name": "姚明",
}
]
}
请求URL
GET
/envelope
请求参数
page
: [string] 当前页数 【必填】pageSize
: [string] 每页数量【非必填】keyword
: [string] 关键字 【非必填】start_date
: [string] 筛选开始日期【非必填】end_date
: [string] 筛选结束日期【非必填】status
: [string] 红包状态筛选【非必填】
响应
{
"status": 0,
"msg": "保存成功",
"data": {
list: [
{
courier_id: 12
income_id: 12
courier: {},
income: {},
elp_date: '',//日期
amount: 012,// 金额
open_time: '',//红包打开领取时间
status: '',//红包领取状态 0 - 待领取 1 - 已领取 2 - 未领取
expire_time: '', //失效
}
],
total: 122 // 总数
}
}
请求URL
GET
/envelope/withdraw
请求参数
page
: [string] 当前页数 【必填】pageSize
: [string] 每页数量【非必填】keyword
: [string] 关键字 【非必填】start_date
: [string] 筛选开始日期【非必填】end_date
: [string] 筛选结束日期【非必填】asExcel
: [int] 1为导出【非必填】- company_id/bus_depart_id等大区id查询
响应
{
"status": 0,
"msg": "保存成功",
"data": {
'withdraw' : 122, // 已提现金额
'elp_num' => 122, // 红包个数
'total_amount' => 1222,// 总金额,
'unwithdraw' => 33,// 未提现金额
list: [
{
courier_id: 12
income_id: 12
courier: {},
start_date: '2019-09-01',
end_date: '2019-09-15',
bus_require: '业务需求方',
item_name: '费用项目',
amount: 1222,// 总金额
withdraw_amt: 111,// 提现金额
fee: 12,
draw_time: ''//提现时间,
sign_photo: ''
}
],
total: 122 // 总数
}
}
请求URL
GET
/income/withdraw
请求参数
page
: [string] 当前页数 【必填】pageSize
: [string] 每页数量【非必填】keyword
: [string] 关键字 【非必填】start_date
: [string] 筛选开始日期【非必填】end_date
: [string] 筛选结束日期【非必填】asExcel
: [int] 1为导出【非必填】- company_id/bus_depart_id等大区id查询
响应
{
"status": 0,
"msg": "保存成功",
"data": {
list: [
{
courier_id: 12
courier: {},
start_date: '2019-09-01',
end_date: '2019-09-15',
bus_require: '业务需求方',
item_name: '费用项目',
amount: 1222,// 总金额
withdraw_amt: 111,// 提现金额
fee: 12,
draw_time: ''//提现时间,
sign_photo: ''
}
],
total: 122 // 总数
}
}
请求URL
GET
/withdraw/export
请求参数
keyword
: [string] 关键字 【非必填】start_date
: [string] 筛选开始日期【非必填】end_date
: [string] 筛选结束日期【非必填】type
: [int] 1为财务提现凭证PDF导出,2为红包提现凭证PDF【非必填】默认为1
响应
导出的文件
请求URL
get
/courier/can_notice
请求参数
无
响应
{
"status": 0,
"msg": "操作成功",
"data": true // true单日可以点击提现,false单日不可以点击
}
请求URL
post
/courier/notice
请求参数
无
响应
{
"status": 0,
"msg": "操作成功",
"data": null
}
请求URL
GET
/t_income
请求参数
page
: [string] 当前页数 【必填】pageSize
: [string] 每页数量【非必填】keyword
: [string] 关键字 【非必填】phone
: [string] 手机号,右模糊 【非必填】customer_id
: [string] 用户编号,右模糊 【非必填】real_name
: [string] 姓名,右模糊 【非必填】start_date
: [string] 筛选开始日期【非必填】end_date
: [string] 筛选结束日期【非必填】asExcel
: [int] 1为导出【非必填】company_id/bus_depart_id等大区id查询
响应
{
"data": {
'list' => [{
courier: {} // 用户编号存在情况下不为空
其他信息见数据库t_income,
income_date: '2019-01-01', // 财务日期
}],
'total' => 100
}
}
请求URL
GET
/user_income
请求参数
page
: [string] 当前页数 【必填】pageSize
: [string] 每页数量【非必填】keyword
: [string] 关键字 【非必填】phone
: [string] 手机号,右模糊 【非必填】customer_id
: [string] 用户编号,右模糊 【非必填】real_name
: [string] 姓名,右模糊 【非必填】start_date
: [string] 筛选开始日期【非必填】end_date
: [string] 筛选结束日期【非必填】asExcel
: [int] 1为导出【非必填】- company_id/bus_depart_id等大区id查询
响应
{
"status": 0,
"msg": "保存成功",
"data": {
list: [
{
courier_id: 12
courier: {},
start_date: '2019-09-01',
end_date: '2019-09-15',
withdraw_amt: 111,// 提现金额
draw_time: ''//提现时间,
sign_photo: ''
}
],
total: 122 // 总数
}
}
请求URL
GET
/user_income/export
请求参数
keyword
: [string] 关键字 【非必填】start_date
: [string] 筛选开始日期【非必填】end_date
: [string] 筛选结束日期【非必填】
响应
导出的文件
请求URL
GET
/t_income_sts
请求参数
page
: [string] 当前页数 【必填】pageSize
: [string] 每页数量【非必填】keyword
: [string] 关键字 【非必填】phone
: [string] 手机号,右模糊 【非必填】customer_id
: [string] 用户编号,右模糊 【非必填】real_name
: [string] 姓名,右模糊 【非必填】start_date
: [string] 筛选开始日期【非必填】end_date
: [string] 筛选结束日期【非必填】asExcel
: [int] 1为导出【非必填】- company_id/bus_depart_id等大区id查询
响应
{
"data": {
'list' => [{
courier: {} // 用户编号存在情况下不为空
income_cnt: '订单数量',
income_amt: '订单总金额',
income_date: '财务日期',
liability_compensation: '有责赔偿',
platform_award decimal: '平台奖励',
remark: '备注',
其他信息见数据库t_income_daily_sts
}],
'total' => 100
}
}
请求URL
put
/t_income_sts/import
只更新有责赔偿和平台奖励以及金额
请求URL
POST/PUT 新建和编辑url以及方法不变
请求参数
- @原先的不变,新增如下
st_amount
[string] 设置预提现金额
响应
{
"status": 0,
"msg": "新建成功",
"data": null
}
请求URL
POST
/company/{id}/withdrawal/config
请求参数
id
: [integer] 公司id 【必填】config
: [object] 财务配置,详见下文描述 【必填】
按固定日期提现数据格式
{
"type": 1,//提现类型,1为固定日期提现
"config": [//提现配置
{
"begin": 1,//开始日期
"end": 10,//结束日期
"percent_wages": 70,//提现比例
"withdrawal_config": [//开发申请提现日期配置
{
"begin": {//开始配置配置
"month_type": 1,//月份类型 1当月 2次月
"day": 11//日期, 1~27, 月底用32表示
},
"end": {//结束日期配置
"month_type": 1,
"day": 15//日期, 1~27, 月底用32表示
},
"fee": 3//利率
},
...
]
},
{
"begin": 11,
"end": 20,
"percent_wages": 70,
"withdrawal_config": [
...//提现配置
]
}
]
}
按工资日期时间提现数据格式
{
"type": 2,//提现类型,2为按工资日期提现
"after_day": 5,//几天后可提现
"percent_wages": 5,//提现比例
"withdrawal_config": [//提现配置
{//当月15日及以前,费率3%
"month_type": 1,//月份类型 1当月 2次月
"day": 15,//日期 1~27 月底为32
"fee": 3//费用
},
{//次月3日及以前,费率1%
"month_type": 2,//月份类型 1当月 2次月
"day": 3,
"fee": 1
}
]
}
响应
{
"status": 0,
"msg": "",
"data": {
"type": 1,
"config": [
{
"begin": 1,
"end": 10,
"percent_wages": 70,
"withdrawal_config": [
{
"begin": {
"month_type": 1,
"day": 11
},
"end": {
"month_type": 1,
"day": 15
},
"fee": 3
},
{
"begin": {
"month_type": 2,
"day": 1
},
"end": {
"month_type": 2,
"day": 5
},
"fee": 1
},
{
"begin": {
"month_type": 2,
"day": 16
},
"end": {
"month_type": 2,
"day": 32
},
"fee": 2
}
]
},
{
"begin": 11,
"end": 20,
"percent_wages": 70,
"withdrawal_config": [
{
"begin": {
"month_type": 1,
"day": 1
},
"end": {
"month_type": 1,
"day": 10
},
"fee": 3
},
{
"begin": {
"month_type": 1,
"day": 11
},
"end": {
"month_type": 1,
"day": 21
},
"fee": 2
},
{
"begin": {
"month_type": 1,
"day": 22
},
"end": {
"month_type": 2,
"day": 5
},
"fee": 1
}
]
},
{
"begin": 21,
"end": 32,
"percent_wages": 70,
"withdrawal_config": [
{
"begin": {
"month_type": 2,
"day": 1
},
"end": {
"month_type": 2,
"day": 10
},
"fee": 2
},
{
"begin": {
"month_type": 2,
"day": 11
},
"end": {
"month_type": 2,
"day": 32
},
"fee": 1
}
]
}
]
}
}
请求URL
GET
/company/{id}/withdrawal/config
请求参数
id
: [integer] 公司id 【必填】
响应
{
"status": 0,
"msg": "",
"data": {
"type": 2,
"after_day": 5,
"percent_wages": 5,
"withdrawal_config": [
{
"month_type": 1,
"day": 15,
"fee": 3
},
{
"month_type": 1,
"day": 25,
"fee": 2
},
{
"month_type": 2,
"day": 3,
"fee": 1
},
{
"month_type": 2,
"day": 5,
"fee": 0.5
}
]
}
}
请求URL
GET
/company/{id}/withdrawal
请求参数
id
: [integer] 公司id 【必填】
响应
{
"status": 0,
"msg": "",
"data": {
"change": false,//是否与下月配置不一致
"config": {
"type": 2,
"after_day": 5,
"percent_wages": 5,
"withdrawal_config": [
{
"month_type": 1,
"day": 15,
"fee": 3
},
{
"month_type": 1,
"day": 25,
"fee": 2
}
]
}
}
}
请求URL
GET
/user/withdraw
请求参数
page
: [string] 当前页数 【必填】pageSize
: [string] 每页数量【非必填】keyword
: [string] 关键字 【非必填】start_date
: [string] 筛选开始日期【非必填】end_date
: [string] 筛选结束日期【非必填】asExcel
: [int] 1为导出【非必填】
响应
{
"status": 0,
"msg": "",
"data": {
"list": [
{
"id": 40,
"courier_id": 65,
"month_start": "2020-07",
"month_end": "",
"amount": "2000.00", //预支金额
"withdraw_amt": "1940.00", //实际到账金额
"fee": "3.00", //手续费
"draw_time": "2020-08-10 23:35:03",//申请时间
"sign_photo": "https://api.ane.huodaren.net/uploads/2020-06/223681591376047.png",
"order_sn": "11111",// 订单号
"status": 1,//状态 1提现中 2提现成功 3提现失败
"last_reply_state": "",
"withdrawal_config": null,
"created_at": "-0001-11-30 00:00:00",
"updated_at": "2020-08-11 23:42:21",
"month": "2020-07", //涉及月份
"courier": {
}
},
{
"id": 41,
"courier_id": 84,
"month_start": "2020-06",
"month_end": "2020-07",
"amount": "4000.00",
"withdraw_amt": "3880.00",
"fee": "3.00",
"draw_time": "2020-08-10 23:43:49",
"sign_photo": "https://api.ane.huodaren.net/uploads/2020-06/223681591376047.png",
"order_sn": "",
"status": 2,
"last_reply_state": "",
"withdrawal_config": null,
"created_at": "-0001-11-30 00:00:00",
"updated_at": "2020-08-12 23:04:31",
"month": "2020-06,2020-07",
"courier": {
}
}
],
"total": 2 //总数
}
}
请求URL
GET
/user/withdraw/export
请求参数
keyword
: [string] 关键字 【非必填】start_date
: [string] 筛选开始日期【非必填】end_date
: [string] 筛选结束日期【非必填】
响应
导出的文件
请求URL
GET
/user/withdraw/{id}/detail
请求参数
id
: [string] 预支id 【必填】
响应
{
"status": 0,
"msg": "",
"data": [
{
"id": 41,
"courier_id": 84,
"income_id": 98,
"user_withdrawal_id": 41,
"amount": "0.00", //收入
"platform_award": "2000.00", //平台奖励
"liability_compensation": "0.00",//惩罚
"fee_rate": "1.00",//费率
"percent_wages": "70",//体现比例
"created_at": "-0001-11-30 00:00:00",
"updated_at": "-0001-11-30 00:00:00",
"courier": {
//用户信息
},
"income": {
//关联的收入记录
}
},
{
"id": 42,
"courier_id": 84,
"income_id": 135,
"user_withdrawal_id": 41,
"amount": "0.00",
"platform_award": "2000.00",
"liability_compensation": "0.00",
"fee_rate": "3.00",
"percent_wages": "70",
"created_at": "-0001-11-30 00:00:00",
"updated_at": "-0001-11-30 00:00:00",
"courier": {
},
"income": {
}
}
]
}