From c9484deaec386818e16f31279899fd2d16cba1f5 Mon Sep 17 00:00:00 2001 From: hongwenwu Date: Sat, 9 Sep 2023 13:16:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 ++++++++++++++++++++-- src/OrderActions/Order.php | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e468dea..fc5bad9 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,27 @@ $w = new Order($secretKey); // 获取工单数据 $response = $w->getProductOrder('SN5436745676543'); +// 加工工单原木材种 +$w->getWoodTypeOptions([ + 'company_id' => 1 + ]); + +// 加工工单加工等级 +$w->getProductionLevelOptions([ + 'company_id' => 1 + ]); + // 创建加工工单 $response = $w->createProductOrder([ - 'cube_plan' => 32.23, - 'owner' => 'ykxiao' + 'company_id' => 1, + 'wood_type_id' => 1, + 'wood_level_id' => 1, + 'spec_thickness' => 12, + 'spec_width' => 22, + 'spec_length' => 38, + 'number_width' => 12, + 'number_height' => 22, + 'number_pcs' => 10, + 'owner' => 'ykxiao' ]); ``` diff --git a/src/OrderActions/Order.php b/src/OrderActions/Order.php index 5ac38b2..232c781 100644 --- a/src/OrderActions/Order.php +++ b/src/OrderActions/Order.php @@ -115,6 +115,29 @@ class Order return $this->baseFun($data, 'production.status'); } + /** + * 加工工单原木材种 + * @return mixed|string + * @throws GuzzleException + * @throws HttpException + * @throws InvalidArgumentException + */ + public function getWoodTypeOptions($data) + { + return $this->baseFun($data, 'Wood.types'); + } + /** + * 加工等级 + * @return mixed|string + * @throws GuzzleException + * @throws HttpException + * @throws InvalidArgumentException + */ + public function getProductionLevelOptions($data) + { + return $this->baseFun($data, 'production.levels'); + } + /** * 加工工单创建 * @return mixed|string