| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?php
- declare(strict_types=1);
- namespace SixShop\Wangdian\Services;
- use SixShop\Wangdian\Response\ApiResponse;
- /**
- * Stock service for inventory management, transfers, etc.
- */
- class StockService extends BaseService
- {
- /**
- * Query stock information
- */
- public function query(array $params = []): ApiResponse
- {
- return $this->call('stock_query.php', $this->filterParams($params));
- }
- /**
- * Push stock transfer
- */
- public function pushTransfer(array $transferData): ApiResponse
- {
- $this->validateRequired($transferData, ['transfer_info']);
- return $this->call('stock_transfer_push.php', [
- 'transfer_info' => $this->encodeIfArray($transferData['transfer_info']),
- ]);
- }
- /**
- * Query stock transfer
- */
- public function queryTransfer(array $params = []): ApiResponse
- {
- return $this->call('stock_transfer_query.php', $this->filterParams($params));
- }
- /**
- * Push stockin order
- */
- public function pushStockinOrder(array $orderData): ApiResponse
- {
- $this->validateRequired($orderData, ['stockin_info']);
- return $this->call('stockin_order_push.php', [
- 'stockin_info' => $this->encodeIfArray($orderData['stockin_info']),
- ]);
- }
- /**
- * Query stockin order
- */
- public function queryStockinOrder(array $params = []): ApiResponse
- {
- return $this->call('stockin_order_query.php', $this->filterParams($params));
- }
- /**
- * Push stockout order
- */
- public function pushStockoutOrder(array $orderData): ApiResponse
- {
- $this->validateRequired($orderData, ['stockout_info']);
- return $this->call('stockout_order_push.php', [
- 'stockout_info' => $this->encodeIfArray($orderData['stockout_info']),
- ]);
- }
- /**
- * Query stockout order
- */
- public function queryStockoutOrder(array $params = []): ApiResponse
- {
- return $this->call('stockout_order_query.php', $this->filterParams($params));
- }
- /**
- * Push stockin transfer
- */
- public function pushStockinTransfer(array $transferData): ApiResponse
- {
- return $this->call('stockin_transfer_push.php',
- $this->filterParams($transferData)
- );
- }
- /**
- * Push stockout transfer
- */
- public function pushStockoutTransfer(array $transferData): ApiResponse
- {
- return $this->call('stockout_transfer_push.php',
- $this->filterParams($transferData)
- );
- }
- /**
- * Sync stock by PD (盘点)
- */
- public function syncByPd(array $pdData): ApiResponse
- {
- return $this->call('stock_sync_by_pd.php',
- $this->filterParams($pdData)
- );
- }
- /**
- * Query stock PD order
- */
- public function queryPdOrder(array $params = []): ApiResponse
- {
- return $this->call('stock_pd_order_query.php', $this->filterParams($params));
- }
- }
|