data["active_test"] = "active"; } public function method(Request $request, $method) { return call_user_func([$this, $method], $request); } public function test2(){ /* Station::query() ->where("id",11)->update(["status"=>0]); $a = new CacheShelfService(); $a->_stationCacheLightOff("HAIB1-01-01"); dd(1);*/ StationTaskMaterialBox::query()->get(); $task1 = StationTaskMaterialBox::query()->find(85010); $foreignHaiRoboticsService = new ForeignHaiRoboticsService(); $toLocation = collect(["HAIB1-01-01"]); $taskMaterialBoxes = collect([$task1]); $foreignHaiRoboticsService-> fetchGroup_multiLocation($toLocation, $taskMaterialBoxes, '', '立架出至缓存架',20); foreach ($toLocation as $value){ app("CacheShelfService")->lightUp($value,'3','0',["title"=>"机器人取箱中,禁止操作"]); Cache::forever("CACHE_SHELF_OCCUPANCY_11",true); } app("StationService")->locationOccupyMulti($toLocation->toArray()); dd("OK"); } public function test() { $code1 = "IDE0000224"; $code2 = "IDE0000176"; Station::query()->where("station_type_id",5)->whereNotNull("parent_id") ->where("id","!=",11)->update(["status"=>1]); Cache::forget("CACHE_SHELF_AVAILABLE"); Cache::forget("CACHE_SHELF_MAPPING"); $dateTime = date("Y-m-d H:i:s"); $materialBox1 = MaterialBox::query()->where("code",$code1)->first(); $materialBox2 = MaterialBox::query()->where("code",$code2)->first(); $task1 = StationTaskMaterialBox::query()->create([ 'station_id'=>11, 'material_box_id'=>$materialBox1->id, 'station_task_batch_id'=>1, 'status'=>'待处理' ]); $task2=StationTaskMaterialBox::query()->create([ 'station_id'=>6, 'material_box_id'=>$materialBox2->id, 'station_task_batch_id'=>1, 'status'=>'待处理' ]); TaskTransaction::query()->insert([[ "doc_code" => "test", "bar_code" => "test", "to_station_id" => 11, "material_box_id" => $materialBox1->id, "task_id" => $task1->id, "commodity_id" => 505012,//XUNI03 "amount" => 1, "type" => "出库", "status" => 0, "mark" => 2, "bin_number"=>1, "created_at"=>$dateTime, "updated_at"=>$dateTime, ],[ "doc_code" => "test", "bar_code" => "test", "to_station_id" => 6, "material_box_id" => $materialBox2->id, "task_id" => $task2->id, "commodity_id" => 505012,//XUNI03 "amount" => 1, "type" => "出库", "status" => 3, "mark" => 2, "bin_number"=>1, "created_at"=>$dateTime, "updated_at"=>$dateTime, ]]); $foreignHaiRoboticsService = new ForeignHaiRoboticsService(); $toLocation = collect(["HAIB1-01-01"]); $taskMaterialBoxes = collect([$task1]); $foreignHaiRoboticsService-> fetchGroup_multiLocation($toLocation, $taskMaterialBoxes, '', '立架出至缓存架',20); foreach ($toLocation as $value){ app("CacheShelfService")->lightUp($value,'3','0',["title"=>"机器人取箱中,禁止操作"]); Cache::forever("CACHE_SHELF_OCCUPANCY_11",true); } app("StationService")->locationOccupyMulti($toLocation->toArray()); } public function _stationCacheLightOff($locCode) { if (!$locCode) return null; $params = [ "areaCode" => "1004", 'locCode' => $locCode, 'PTLAction' => 0, ]; $response = Http::post(config('api.haiq.storage.light'), $params); return json_decode($response->body()); } }