仓内调拨
数据库
inventory - inner_tansfer_sheet 移库单
CREATE TABLE `inner_inner_transfer_sheet` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`station_id` varchar(16) NOT NULL,
`group_id` varchar(16) NOT NULL,
`sheet_no` varchar(64) NOT NULL COMMENT '单号',
`modify_time` datetime NOT NULL,
`create_time` datetime NOT NULL,
`submit_time` datetime NOT NULL COMMENT '提交时间',
`delete_time` datetime DEFAULT '0001-01-01 00:00:00' NOT NULL,
`status` int(11) NOT NULL COMMENT '1未移库 2未移库待审核 3审核不通过 4已移库 5已删除',
`creator_id` int(11) NOT NULL COMMENT '调出建单人',
`operator_id` int(11) NOT NULL COMMENT '操作人',
`remark` varchar(64) NOT NULL DEFAULT '' COMMENT '备注',
`pstatus` tinyint(4) DEFAULT '0',
`extra1` int(11) DEFAULT '0' COMMENT '备份字段',
`extra2` int(11) DEFAULT '0' COMMENT '备份字段',
`extra3` int(11) DEFAULT '0' COMMENT '备份字段',
`extra4` varchar(128) DEFAULT '' COMMENT '备份字段',
`extra5` varchar(128) DEFAULT '' COMMENT '备份字段',
`extra6` varchar(128) DEFAULT '' COMMENT '备份字段',
`extra7` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '备份字段',
`extra8` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '备份字段',
`extra9` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '备份字段',
`extra10` decimal(15,4) DEFAULT '0.0000' COMMENT '备份字段',
PRIMARY KEY (`id`),
);
inventory - inner_transfer_detail 移库单明细
CREATE TABLE `inner_transfer_detail` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`station_id` varchar(16) NOT NULL,
`group_id` varchar(16) NOT NULL,
`sheet_id` varchar(64) NOT NULL COMMENT '单号',
`spu_id` varchar(16) NOT NULL COMMENT 'SPU',
`out_batch_num` varchar(64) NOT NULL COMMENT '调出批次号',
`origin_batch_num` varchar(64) NOT NULL COMMENT '原入库批次号',
`in_batch_num` varchar(64) NOT NULL COMMENT '调入批次号',
`amount` decimal(15,4) NOT NULL COMMENT '调出数量',
`remain` decimal(15,4) NOT NULL COMMENT '剩余数量',
`out_shelf_id` unsigned COMMENT '转出货位',
`in_shelf_id` unsigned COMMENT '转入货位',
`price` decimal(15,4) NOT NULL COMMENT '总价',
`modify_time` datetime NOT NULL,
`create_time` datetime NOT NULL,
`delete_time` datetime DEFAULT '0001-01-01 00:00:00' NOT NULL,
`remark` varchar(64) NOT NULL DEFAULT '' COMMENT '备注',
`pstatus` tinyint(4) DEFAULT '0',
`extra1` int(11) DEFAULT '0' COMMENT '备份字段',
`extra2` int(11) DEFAULT '0' COMMENT '备份字段',
`extra3` int(11) DEFAULT '0' COMMENT '备份字段',
`extra4` varchar(128) DEFAULT '' COMMENT '备份字段',
`extra5` varchar(128) DEFAULT '' COMMENT '备份字段',
`extra6` varchar(128) DEFAULT '' COMMENT '备份字段',
`extra7` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '备份字段',
`extra8` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '备份字段',
`extra9` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '备份字段',
`extra10` decimal(15,4) DEFAULT '0.0000' COMMENT '备份字段',
PRIMARY KEY (`id`),
);
接口
移库单列表 /stock/inner_transfer_sheet/list 新
Method GET
请求:
begin M date 开始时间
end M date 结束时间
status O int 状态 1未移库(保存) 2未移库待审核 3审核不通过(审核不通过) 4已移库(确认移库) 5已删除(冲销)
q O 调拨单单号
limit M int 分页
page_obj O string 起始页(不包含),默认第0页
limit O int 返回条数,默认10。传0表示返回所有数据。
offset O int 查询起点偏移条数,默认 0 [注1]
peek O int 是否需要 peek,默认不需要 peek。peek 必须大于 limit。
count O bool 是否需要 count,默认不需要 count。(部分接口可能不实现本功能, 因为如果数据量极大,count 会很耗时)
响应:
{
"code": 0,
"msg": "ok",
"data":[
{
create_time M datetime 建单时间
sheet_no M str 移库单号
creator M str 建单人
status M int 状态
}
],
"pagination": { M dict
"peek": 100, O int 前端传 peek 的话,后端就会返回这个字段
"more": true, M bool 是否有更多数据
"page_obj": "gtyuhbgyhbvgyhgvgy", M string
"count": 2000 O int 前端传 count 的话,后端就会返回这个字段
}
}
移库单列表导出 /stock/inner_transfer_sheet/export 新
Method GET
请求:
begin M date 开始时间
end M date 结束时间
status O int 状态 1未移库(保存) 2未移库待审核 3审核不通过(审核不通过) 4已移库(确认移库) 5已删除(冲销)
q O 调拨单单号
响应:
表格字段需要产品确认,异步接口
移库单详情 /stock/inner_transfer_sheet/detail 新
Method GET
请求:
sheet_no M str 调拨单号
响应:
{
"code": 0,
"msg": "ok",
"data":
{
create_time M datetime 建单时间
submit_time M datetime 提交时间
sheet_no M str 调拨单号
remark M str 备注
creator M str 建单人
status M int 状态
details: [{ M list 详情
spu_name M str 商品名称
spu_id M str 商品ID
category_1_name M str 一级分类
category_2_name M str 二级分类
out_batch_num M str 调出批次
out_shelf M list 调出货位
[{id M str 货位id
name M str 货位名字
}
]
in_shelf M list 调入货位
[{id M str 货位id
name M str 货位名字
}
]
unit_name M str 基本单位
remain M float 剩余库存
out_amount M float 调出数量
in_batch_num O str 调入批次
remark M str 备注
}]
}
}
移库单创建 /stock/inner_transfer_sheet/create 新
Method POST
请求:
remark O str 备注
details: [{ M list 详情
spu_id M str 商品ID
out_batch_num M str 调出批次
out_amount M float 调出数量
in_shelf_id C str 调入货位
remark M str 备注
}]
status int 1未移库(保存) 2未移库待审核 4已移库(确认移库)
响应:
{
"code": 0,
"msg": "ok",
"data":
{
sheet_no M str 移库单号
}
}
移库单编辑 /stock/inner_transfer_sheet/update 新
Method POST
请求:
sheet_no M str 调拨单号
remark O str 备注
details: [{ M list 详情
spu_id M str 商品ID
out_batch_num M str 调出批次
out_amount M float 调出数量
in_shelf_id C str 调入货位
remark M str 备注
}]
status int 1未移库(保存) 2未移库待审核 3审核不通过(审核不通过) 4已移库(确认移库) 5已删除(冲销)
响应:
{
"code": 0,
"msg": "ok",
"data": null
}
逻辑
ps:更新调拨在途库存
移库记录 /stock/inner_transfer_sheet/log/list 新
Method GET
请求:
q O str 搜索
supplier_id O str 供应商
begin M date 开始时间
end M date 结束时间
limit M int 分页
page_obj O string 起始页(不包含),默认第0页
limit O int 返回条数,默认10。传0表示返回所有数据。
offset O int 查询起点偏移条数,默认 0 [注1]
peek O int 是否需要 peek,默认不需要 peek。peek 必须大于 limit。
count O bool 是否需要 count,默认不需要 count。(部分接口可能不实现本功能, 因为如果数据量极大,count 会很耗时)
响应:
{
"code": 0,
"msg": "ok",
"data":[
{
spu_id M str spuid
submit_time M datetime 移库时间
spu_name M str spu名字
category_1_name M str 一级分类名
category_2_name M str 二级分类名
sheet_no M str 移库单号
supplier_name M str 供应商
out_amount M float 调出数量
out_batch_num M str 调出批次号,
in_batch_num M str 调入批次号,
unit_price M float 单价
price M float zsjd
operator M str 操作人
remark O str 备注
}
],
"pagination": { M dict
"peek": 100, O int 前端传 peek 的话,后端就会返回这个字段
"more": true, M bool 是否有更多数据
"page_obj": "gtyuhbgyhbvgyhgvgy", M string
"count": 2000 O int 前端传 count 的话,后端就会返回这个字段
}
}
移库记录 /stock/inner_transfer_sheet/log/export 新
Method GET
请求:
q O str 搜索
supplier_id O str 供应商
begin M date 开始时间
end M date 结束时间
响应:
表格字段需要产品确认,异步接口
获取货位 /stock/shelf/tree 新
Method GET
请求:
响应:
data:{
id int M 货位ID
name str M 货位名
children list [{
id int M 货位ID
name str M 货位名
children []
}
]
}
spu简单查询 /merchandise/spu/simple_search
Method GET
请求:
q
响应
"std_unit_name": "KG",
"p_type": 0,
"desc": null,
"name": "哈密瓜",
"id": "C1975973",
"rank": 0
商品盘点-变动明细 stock/change_log/list 老
添加返回调拨类型
查询批次 /stock/check/batch_number/list 老
Method GET
请求:
'spu_id' str M
'q': str O
'shelf_id' int O
'page_obj': Param(str, optional=True, default=''),
'reverse': Param(bool, optional=True, default=False),
'limit': Param(int, optional=True, default=10),
'offset': Param(int, optional=True, default=0),
'peek': Param(int, optional=True, default=0),
'count': Param(bool, optional=True, default=False),
响应:
'batch_number':
'remain':
'settle_supplier_id': s
'create_time':
'supplier_name':
'life_time' 保质期
'production_time' 生产日期
'shelf_name' 货位名