service=app('ForeignHaiRoboticsService'); } public function lightOn($post){ $response = Http::post(config('api.haiq.storage.light'),$post); return $response->body(); } public function lightOff(Request $request){ // $locCode = $request['locCode']; // $PTLAction = $request['PTLAction']; // list($stationCode, $gridId, $x, $y) = StationCacheShelfGrid::getGridByCode($locCode); // $station = Station::query()->where('code',$stationCode)->first(); // $grid = StationCacheShelfGrid::query()->where('station_id',$station['id'])->where('grid_id',$gridId)->first(); // $materialBox = MaterialBox::query()->where('id',$grid['material_box_id'])->first(); // $cacheShelfService = app(CacheShelfService::class); // $cacheShelfService->putBinToStore($station,$materialBox,$grid); } /** * @param Request $request {"areaCode":"1004","locCode":"HAIB2-02-03","displayInfo":null,"PTLAction":0,"PTLSettings":null} * @param StationCacheShelfGridService $gridService * @return array */ public function update(Request $request,StationCacheShelfGridService $gridService){// 拍灯以后的消息发至此处 $gridService->lightOff($request['locCode'],$request['PTLAction']); $success = $request->input('success'); $location = $success?200:0; app('LogService')->log(__METHOD__,__FUNCTION__,json_encode($request->all())); return ['location'=>$location,'errMsg'=>'','data'=>$request->all()]; } }