php-wms-client/src/WmsStrategy.php

57 lines
1.6 KiB
PHP
Raw Normal View History

2020-03-19 09:05:29 +00:00
<?php
namespace PdWms;
class WmsStrategy
{
public $wmsClient;
public function __construct($warehouseId)
{
2020-03-25 06:16:20 +00:00
$config = require(dirname(dirname(__FILE__)) . '/config/wms.php');
2020-03-19 09:05:29 +00:00
switch ($warehouseId)
{
2020-03-25 06:16:20 +00:00
case $config['xinyi']['warehouse_id']:
$this->wmsClient = new XinyiWms($config['xinyi']);
2020-03-19 09:05:29 +00:00
break;
2020-07-13 02:44:15 +00:00
case $config['fineex']['warehouse_id']:
$this->wmsClient = new FineexWms($config['fineex']);
2020-03-19 09:05:29 +00:00
break;
default:
throw new \Exception('仓库不存在');
}
}
2020-03-30 02:51:11 +00:00
public function deliveryOrderCreate($params) {
return $this->wmsClient->deliveryOrderCreate($params);
2020-03-19 09:05:29 +00:00
}
2020-03-30 02:51:11 +00:00
public function inventoryQuerySingle($wmsCode, $inventoryType = 'ZP') {
return $this->wmsClient->inventoryQuerySingle($wmsCode, $inventoryType);
2020-03-19 09:05:29 +00:00
}
2020-03-30 02:51:11 +00:00
public function inventoryQuery($params, $inventoryType = 'ZP') {
return $this->wmsClient->inventoryQuery($params, $inventoryType);
2020-03-19 09:05:29 +00:00
}
2020-03-30 02:51:11 +00:00
public function goodsSkuSync($params) {
return $this->wmsClient->goodsSkuSync($params);
2020-03-19 09:05:29 +00:00
}
public function orderCancel($params) {
return $this->wmsClient->orderCancel($params);
}
2020-03-30 02:51:11 +00:00
public function returnOrderCreate($params) {
return $this->wmsClient->returnOrderCreate($params);
2020-03-19 09:05:29 +00:00
}
public function stockInCreate($params, $type = 0) {
return $this->wmsClient->stockInCreate($params, $type);
}
public function stockOutCreate($params) {
return $this->wmsClient->stockOutCreate($params);
}
}