| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Http\Controllers\api\thirdPart\syrius\beans;
- class Task extends \stdClass
- {
- const ORDER_PICKING = "ORDER_PICKING";
- const TOTAL_PICKING = "TOTAL_PICKING";
- const PUTAWAY = "PUTAWAY";
- public $id; //任务ID string
- //Optional
- public $batchId; //批次ID string
- //ENUM
- public $type; //任务类型 string
- //Optional:between(1,10) default:5
- public $priority; //优先级 string
- public $timestamp; //下达时间 int
- //Optional
- public $expectedExecutionTime; //预计执行时间 int
- //Optional
- public $expectedFinishTime; //预计完成时间 int
- public $warehouseId; //仓库ID string
- //Optional
- public $notifyUrl; //任务执行通知地址 string
- public $storages; //存储Storage对象示例:[{type:"",serialNo:""}] array
- public $attributes; //一些属性:{dischargeLocations:"",...},这里在初始传递时应为一个对象,通过内部转换为key-val数组
- public $items; //TaskItem array
- public function get(): Task
- {
- if (!$this->type)$this->type = self::TOTAL_PICKING;
- $this->timestamp = time();
- $this->notifyUrl = /*config("app.url")*/"https://was.baoshi56.com"."/api/thirdPart/syrius/order/notification";
- if (!$this->storages)$this->storages = [];
- if (!$this->priority)unset($this->priority);
- if (!$this->expectedExecutionTime)unset($this->expectedExecutionTime);
- if (!$this->expectedFinishTime)unset($this->expectedFinishTime);
- if (!$this->batchId)unset($this->batchId);
- return $this;
- }
- }
|