作业单
字段可选
M:must 必填
O:optional 选填
C: conditional 某些条件下必选
搜索作业单
接口名
/business/additional_task
Method
GET
请求
start_date M datetime 开始查询日期
end_date M datetime 结束查询日期
date_type M string 查询日期类型('operate_date'或'create_time')
offset O int 分页缩进,默认0
limit O int 分页每页数量,默认10
status O int 作业单状态(1:待提交;2:待审核;3:审核通过;4:审核未通过;5:已冲销)
query_data O string 查询内容,支持客户ID(K001或者1)和作业单号(ZY001)
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回json数据
[
{
"status" M 作业单状态码(1:待提交;2:待审核;3:审核通过;4:审核未通过;5:已冲销)
"customer_cellphone" M 客户手机号
"customer_name" M 客户名
"create_time" M 'YYYY-MM-DD' 作业单创建时间
"id" M 作业单ID
"operate_date" M 'YYYY-MM-DD' 作业时间
"customer_id" M 客户ID
"type" M 作业单类型(1:入库;2:出库;3:其他)
}
]
示例
request
http://localhost:8888/business/additional_task?start_date=2016-08-04&end_date=2016-09-21&date_type=create_time&offset=0&limit=10&query_data=K001
response
{
"code": 0,
"pagination": {
"count": 1,
"limit": 10,
"offset": 0
},
"data": [
{
"status": 3,
"customer_cellphone": "1111111111",
"customer_name": "test1111",
"create_time": "2016-08-21",
"id": "ZY00001",
"operate_date": "2016-08-10",
"customer_id": 1,
"type": 1
}
],
"msg": "ok"
}
作业单明细
接口名
/business/additional_task/detail
Method
GET
请求
id M string 作业单ID
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回json数据
"operate_date" M YYYY-MM-DD 作业日期
"customer_cellphone" string M 客户电话
"id" M 作业单ID
"should_pay" M float 作业单应付金额
"type" M int 作业单类型(1:入库;2:出库;3:其他)
"status" M int 作业单状态
"customer_id" M 客户ID
"details": [ O list 作业单详情
{
"follower_name" M string 跟进人名
"follower_id" M int 跟进人ID
"remark" M string 备注
"real_count" M float 实际数量
"name" M string 作业费用名
"fee_id" M int 作业费用ID
"charge_count" M float 计费数量
"unit_name" M string 单位名
"department_name" M string 跟进人部门名
"department_id" M int 跟进人部门ID
"unit_price" M float 单价
}
],
"customer_name" M string 客户名
"handwriting_id" M string 手写单号
"stock_io_receipt_id" M 绑定的出入库单号
示例
request
http://teststation.guanmai.cn:8888/business/additional_task/detail?id=ZY00123
response
{
"data": {
"should_pay": 2400.0,
"details": [{
"department_id": 23,
"name": "低温作业费",
"remark": "12",
"follower_name": "北京员工002",
"charge_count": 12.0,
"real_count": 12.0,
"department_name": "北京部门1",
"unit_name": "吨",
"follower_id": 50,
"fee_id": 2,
"unit_price": 200.0
}],
"handwriting_id": "",
"customer_cellphone": "12312312312",
"customer_id": "K00084",
"customer_name": "北京客户001",
"type": 1,
"status": 3,
"id": "ZY00150",
"stock_io_receipt_id": "RK00129",
"operate_date": "2016-06-08"
},
"code": 0,
"msg": "ok"
}
创建作业单
接口名
/business/additional_task/create
Method
POST
请求
customer_id M string 客户ID(K001)
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回作业单ID
示例
request
http://teststation.guanmai.cn:8888/business/additional_task/create
form-data
customer_id:K001
response
{
"data": "ZY0001",
"code": 0,
"msg": "ok"
}
提交作业单
接口名
/business/additional_task/submit
Method
POST
请求
id M string 作业单号
operate_date M datetime 作业日期
type M int 作业单类型(1:入库;2:出库;3:其他)
remark O string 备注
stock_io_receipt_id C string 绑定的出入库单号
handwriting_id O string 手写单号
details M list 作业单信息
fee_id M int 费用ID
real_count M int 实际数量
follower_id M int 跟进人ID
remark M string 备注
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 空
示例
request
127.0.0.1:8888/business/additional_task/submit
form-data
id: ZY00001
operate_date: 2016-08-05
type: 1
"stock_io_receipt_id": "RK00129"
details:[{"fee_id":"1","real_count":100,"follower_id":20,"remark":"WD205"}]
response
{
"msg": "ok",
"code": 0,
"data": ""
}
拒绝作业单
接口名
/business/additional_task/reject
Method
POST
请求
id M string 作业单号
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 空
示例
request
127.0.0.1:8888/business/additional_task/reject
form-data
id: ZY000001
response
{
"msg": "ok",
"code": 0,
"data": null
}
通过作业单
接口名
/business/additional_task/adopt
Method
POST
请求
id M string 作业单号
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 空
示例
request
127.0.0.1:8888/business/additional_task/adopt
form-data
id: ZY000001
response
{
"msg": "ok",
"code": 0,
"data": null
}
冲销作业单
接口名
/business/additional_task/delete
Method
POST
请求
id M string 作业单号
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 空
示例
request
127.0.0.1:8888/business/additional_task/delete
form-data
id: ZY000001
response
{
"msg": "ok",
"code": 0,
"data": null
}
作业单基础信息
接口名
/business/additional_task/base_info
Method
GET
请求
无
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 基础信息
示例
request
127.0.0.1:8888/business/additional_task/base_info
response
{
"data": {
"calculate_method": {
"HALF_PLUS": 1,
"REAL": 3,
"ONE_PLUS": 2
},
"task_type": [{
"calculate_method": 1,
"name": "\u9ad8\u6e29\u4f5c\u4e1a\u8d39",
"is_active": 1,
"unit_name": "\u5440",
"unit_price": 100.0,
"fee_id": 1
}, {
"calculate_method": 2,
"name": "\u4f4e\u6e29\u4f5c\u4e1a\u8d39",
"is_active": 1,
"unit_name": "\u5428",
"unit_price": 200.0,
"fee_id": 2
}],
"status": {
"VERIFYING": 2,
"WAIT_FOR_SUBMIT": 1,
"FAIL": 4,
"DELETED": 5,
"PASSED": 3
},
"type": {
"STOCK_OUT": 2,
"STOCK_IN": 1,
"OTHERS": 3
}
},
"code": 0,
"msg": "ok"
}