57 lines
1.6 KiB
PHP
57 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace PdWms;
|
|
|
|
class WmsStrategy
|
|
{
|
|
public $wmsClient;
|
|
|
|
public function __construct($warehouseId)
|
|
{
|
|
$config = require(dirname(dirname(__FILE__)) . '/config/wms.php');
|
|
switch ($warehouseId)
|
|
{
|
|
case $config['xinyi']['warehouse_id']:
|
|
$this->wmsClient = new XinyiWms($config['xinyi']);
|
|
break;
|
|
case $config['fineex']['warehouse_id']:
|
|
$this->wmsClient = new FineexWms($config['fineex']);
|
|
break;
|
|
default:
|
|
throw new \Exception('仓库不存在');
|
|
}
|
|
}
|
|
|
|
public function deliveryOrderCreate($params) {
|
|
return $this->wmsClient->deliveryOrderCreate($params);
|
|
}
|
|
|
|
public function inventoryQuerySingle($wmsCode, $inventoryType = 'ZP') {
|
|
return $this->wmsClient->inventoryQuerySingle($wmsCode, $inventoryType);
|
|
}
|
|
|
|
public function inventoryQuery($params, $inventoryType = 'ZP') {
|
|
return $this->wmsClient->inventoryQuery($params, $inventoryType);
|
|
}
|
|
|
|
public function goodsSkuSync($params) {
|
|
return $this->wmsClient->goodsSkuSync($params);
|
|
}
|
|
|
|
public function orderCancel($params) {
|
|
return $this->wmsClient->orderCancel($params);
|
|
}
|
|
|
|
public function returnOrderCreate($params) {
|
|
return $this->wmsClient->returnOrderCreate($params);
|
|
}
|
|
|
|
public function stockInCreate($params, $type = 0) {
|
|
return $this->wmsClient->stockInCreate($params, $type);
|
|
}
|
|
|
|
public function stockOutCreate($params) {
|
|
return $this->wmsClient->stockOutCreate($params);
|
|
}
|
|
}
|