| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- namespace App\Http\Controllers\api\thirdPart\syrius\producer;
- class BinLocation extends Controller
- {
- /**
- * 建立新库位
- *
- * @param string $locationId
- * @param \stdClass $warehouse {id:"",name:""}
- * @param \stdClass $attribute {id:"",layer:0,num:0}
- *
- */
- public function createBinLocation(string $locationId, \stdClass $warehouse, \stdClass $attribute)
- {
- $this->method = "post";
- $this->url = config("api.syrius.request.bin_location");
- $this->data = [[
- "binLocationId" => $locationId, //库位ID
- "warehouseId" => $warehouse->id, //仓库ID
- "warehouseName" => $warehouse->name,//仓库名
- "attributes" => [
- "shelfId" => $attribute->id, //架ID
- "shelfLayer" => $attribute->layer, //架层
- "numOfLayer" => $attribute->num, //架层数
- ],
- ]];
- $this->response();
- }
- /**
- * 获取库位
- *
- * @param string|array $locationId
- * @param string $warehouseId
- * @param int $page
- * @param int $paginate
- */
- public function getBinLocation($locationId, string $warehouseId, int $page = 0, int $paginate= 1)
- {
- if (!is_array($locationId))$locationId = [$locationId];
- $this->method = "get";
- $this->url = config("api.syrius.request.find_all_bin_location");
- $this->data = [
- "pageIndex" => $page, //页数
- "pageSize" => $paginate, //行数
- "warehouseId"=> $warehouseId, //仓库ID
- "binLocationIds"=> $locationId, //库位ID数组
- ];
- $this->response();
- }
- /**
- * 删除库位
- *
- * @param string|array $locationId
- * @param string $warehouseId
- */
- public function delBinLocation($locationId, string $warehouseId)
- {
- if (!is_array($locationId))$locationId = [$locationId];
- $this->method = "delete";
- $this->url = config("api.syrius.request.delete_bin_location");
- $this->data = [
- "warehouseId" => $warehouseId,
- "binLocationIds" => $locationId
- ];
- $this->response();
- }
- }
|