|
|
@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\Http;
|
|
|
|
|
|
class StorageController
|
|
|
{
|
|
|
- protected $request;
|
|
|
+ protected $post;
|
|
|
|
|
|
/** @var ForeignHaiRoboticsService $service */
|
|
|
private $service;
|
|
|
@@ -36,15 +36,97 @@ class StorageController
|
|
|
"sequenceFlag" => -1,//是否需要有序 1:需要有序 0:不需要有序
|
|
|
"bins" => [$bin],//可执行货箱任务
|
|
|
]];*/
|
|
|
- $this->request = [[
|
|
|
+ $this->post = [[
|
|
|
"taskMode" => 2,
|
|
|
"bins"=>[[
|
|
|
- "taskCode" =>"TEST-BS2011160004",
|
|
|
- "binCode" => "IDE0000034",
|
|
|
+ "taskCode" =>"TEST-BS2011160007",
|
|
|
+ "binCode" => "IDE0000001",
|
|
|
+// "fromLocCode" => "BIN-IN1",
|
|
|
+ "toLocCode" => "BIN-OUT1",
|
|
|
+ ],[
|
|
|
+ "taskCode" =>"TEST-BS2011160008",
|
|
|
+ "binCode" => "IDE0000001",
|
|
|
+// "fromLocCode" => "BIN-IN1",
|
|
|
+ "toLocCode" => "BIN-OUT1",
|
|
|
+ ],[
|
|
|
+ "taskCode" =>"TEST-BS2011160009",
|
|
|
+ "binCode" => "IDE0000001",
|
|
|
// "fromLocCode" => "BIN-IN1",
|
|
|
"toLocCode" => "BIN-OUT1",
|
|
|
]],
|
|
|
- "groupCode" => 4,
|
|
|
+ "groupCode" => 21,
|
|
|
+ "priority" => 20,
|
|
|
+ "sequenceFlag" => -1,
|
|
|
+ ]];
|
|
|
+ $this->post2 = [[
|
|
|
+ "taskMode" => 2,
|
|
|
+ "bins"=>[[
|
|
|
+ "taskCode" =>"TEST-BS2011160016",
|
|
|
+ "binCode" => "IDE0000002",
|
|
|
+// "fromLocCode" => "BIN-IN1",
|
|
|
+ "toLocCode" => "BIN-OUT1",
|
|
|
+ ],[
|
|
|
+ "taskCode" =>"TEST-BS2011160017",
|
|
|
+ "binCode" => "IDE0000009",
|
|
|
+// "fromLocCode" => "BIN-IN1",
|
|
|
+ "toLocCode" => "BIN-OUT1",
|
|
|
+ ],[
|
|
|
+ "taskCode" =>"TEST-BS2011160018",
|
|
|
+ "binCode" => "IDE0000014",
|
|
|
+// "fromLocCode" => "BIN-IN1",
|
|
|
+ "toLocCode" => "BIN-OUT1",
|
|
|
+ ],[
|
|
|
+ "taskCode" =>"TEST-BS2011160019",
|
|
|
+ "binCode" => "IDE0000016",
|
|
|
+// "fromLocCode" => "BIN-IN1",
|
|
|
+ "toLocCode" => "BIN-OUT1",
|
|
|
+ ]],
|
|
|
+ "groupCode" => 'W12346',
|
|
|
+ "priority" => 20,
|
|
|
+ "sequenceFlag" => -1,
|
|
|
+ ]];
|
|
|
+ $this->backIn = [[
|
|
|
+ "taskMode" => 1,
|
|
|
+ "bins"=>[[
|
|
|
+ "taskCode" =>"TESTININ-BS2011160016",
|
|
|
+ "binCode" => "IDE0000052",
|
|
|
+ "fromLocCode" => "BIN-OUT1",
|
|
|
+ ],[
|
|
|
+ "taskCode" =>"TESTIN-BS2011160017",
|
|
|
+ "binCode" => "IDE0000004",
|
|
|
+ "fromLocCode" => "BIN-OUT1",
|
|
|
+ ],[
|
|
|
+ "taskCode" =>"TESTIN-BS2011160018",
|
|
|
+ "binCode" => "IDE0000054",
|
|
|
+ "fromLocCode" => "BIN-OUT1",
|
|
|
+ ],[
|
|
|
+ "taskCode" =>"TESTIN-BS2011160019",
|
|
|
+ "binCode" => "IDE0005683",
|
|
|
+ "fromLocCode" => "BIN-OUT1",
|
|
|
+ ]],
|
|
|
+ "groupCode" => 'W12346In',
|
|
|
+ "priority" => 20,
|
|
|
+ "sequenceFlag" => -1,
|
|
|
+ ]];
|
|
|
+ $this->move = [[
|
|
|
+ "taskMode" => 3,
|
|
|
+ "bins"=>[[
|
|
|
+ "taskCode" =>"TESTINM-BS2011160024",
|
|
|
+ "binCode" => "IDE0000054",
|
|
|
+ "fromLocCode" => "",
|
|
|
+ "toLocCode" => "HAIB2-01-02",
|
|
|
+ ],[
|
|
|
+ "taskCode" =>"TESTINM-BS2011160023",
|
|
|
+ "binCode" => "IDE0000004",
|
|
|
+ "fromLocCode" => "",
|
|
|
+ "toLocCode" => "HAIB2-01-01",
|
|
|
+ ],[
|
|
|
+ "taskCode" =>"TESTINM-BS2011160022",
|
|
|
+ "binCode" => "IDE0005683",
|
|
|
+ "fromLocCode" => "",
|
|
|
+ "toLocCode" => "HAIB2-02-03",
|
|
|
+ ]],
|
|
|
+ "groupCode" => 'WM12352',
|
|
|
"priority" => 20,
|
|
|
"sequenceFlag" => -1,
|
|
|
]];
|
|
|
@@ -71,21 +153,21 @@ class StorageController
|
|
|
];
|
|
|
}
|
|
|
|
|
|
- public function relocate(Request $request){
|
|
|
- $response = Http::post(config('api.haiq.storage.moveBin'),$this->request);
|
|
|
+ public function relocate(Request $request,$post){
|
|
|
+ $response = Http::post(config('api.haiq.storage.moveBin'),$post);
|
|
|
if (!$response->ok()){
|
|
|
- app('LogService')->log(__METHOD__,"haiq-请求失败,路径异常","REQUEST:".json_encode($this->request)." | RESPONSE:".$response);
|
|
|
+ app('LogService')->log(__METHOD__,"haiq-请求失败,路径异常","REQUEST:".json_encode($this->post)." | RESPONSE:".$response);
|
|
|
return ['success'=>false,"data"=>$response->body()];
|
|
|
}
|
|
|
if (($response["code"] ?? false) && $response["code"] != 200){
|
|
|
- app('LogService')->log(__METHOD__,"haiq-料箱出库失败","REQUEST:".json_encode($this->request)." | RESPONSE:".$response);
|
|
|
+ app('LogService')->log(__METHOD__,"haiq-料箱出库失败","REQUEST:".json_encode($this->post)." | RESPONSE:".$response);
|
|
|
return ['success'=>false,"data"=>$response["errMsg"]];
|
|
|
}
|
|
|
if (($response["status"] ?? false) && $response["status"] == 500){
|
|
|
- app('LogService')->log(__METHOD__,"haiq-料箱出库失败","REQUEST:".json_encode($this->request)." | RESPONSE:".$response);
|
|
|
+ app('LogService')->log(__METHOD__,"haiq-料箱出库失败","REQUEST:".json_encode($this->post)." | RESPONSE:".$response);
|
|
|
return ['success'=>false,"data"=>$response["msg"]];
|
|
|
}
|
|
|
- app('LogService')->log(__METHOD__,"haiq-料箱出库成功","REQUEST:".json_encode($this->request)." | RESPONSE:".$response);
|
|
|
+ app('LogService')->log(__METHOD__,"haiq-料箱出库成功","REQUEST:".json_encode($this->post)." | RESPONSE:".$response);
|
|
|
return ["success"=>true];
|
|
|
}
|
|
|
public function light(Request $request,$post){
|
|
|
@@ -106,7 +188,16 @@ class StorageController
|
|
|
return ["success"=>true];
|
|
|
}
|
|
|
public function moveBin(Request $request){
|
|
|
-
|
|
|
+ return $this->relocate($request,$this->post);
|
|
|
+ }
|
|
|
+ public function moveBin2(Request $request){
|
|
|
+ return $this->relocate($request,$this->post2);
|
|
|
+ }
|
|
|
+ public function moveBinIn(Request $request){
|
|
|
+ return $this->relocate($request,$this->backIn);
|
|
|
+ }
|
|
|
+ public function moveBinM(Request $request){
|
|
|
+ return $this->relocate($request,$this->move);
|
|
|
}
|
|
|
public function lightOn(Request $request){
|
|
|
return $this->relocate($request,$this->lightOn);
|