海外仓WMS开发实战——入库、上架、出库全流程
适用场景
当国内商品采购完成后,需要集中发往海外仓(如洛杉矶、杜伊斯堡),再由海外仓分拣、打包、贴单出库。Taocarts系统内置了轻量级海外仓管理系统。
一、数据库设计(Laravel Migration)
Schema::create('warehouse_inbounds', function (Blueprint $table) {
$table->id();
$table->string('tracking_no'); // 国内快递单号
$table->foreignId('order_id');
$table->enum('status', ['pending', 'received', 'shelved']);
$table->json('items'); // 商品明细SKU
$table->timestamp('received_at');
});
Schema::create('shelves', function (Blueprint $table) {
$table->id();
$table->string('code', 20); // 货架编号 A-01
$table->foreignId('warehouse_id');
$table->integer('capacity');
});
二、入库PDA扫码(React Native模拟)
海外仓员工使用React Native App扫描国内快递单号,系统自动匹配入库单:
// ScanInboundScreen.js
const handleScan = async (barcode) => {
const inbound = await api.get(`/warehouse/inbound/${barcode}`);
if (inbound.status === 'pending') {
await api.post(`/warehouse/inbound/${inbound.id}/receive`, {
received_at: new Date(),
operator: user.name
});
Alert.alert('入库成功,请上架');
}
};
三、智能上架推荐算法
根据商品体积、重量、品类,推荐最优货架:
# 伪代码 - 推荐逻辑
def recommend_shelf(product):
# 热门商品 -> 靠近打包台的货架
if product.sales_velocity > 100:
return 'A区近出口货架'
# 重货 -> 底层货架
if product.weight > 10:
return 'C区底层'
# 默认轮询
return get_least_loaded_shelf()
四、出库波次策略
将多个订单合并为一个波次(Batch),减少拣货路径:
// 每30分钟执行一次
$orders = Order::where('status', 'ready_to_ship')->limit(50)->get();
$batch = WaveBatch::create(['orders' => $orders->pluck('id')]);
foreach ($orders as $order) {
$pickingTask = PickingTask::create(['order_id' => $order->id, 'wave_batch_id' => $batch->id]);
}
结语
Taocarts的海外仓模块让代购企业轻松管理海外仓存货。这套设计已被多家华人代购系统采用,关键词海外仓代购系统、转运系统建站可找到更多技术细节。