foreignHaiRoboticsService=null; } public function lightOn($post){ } public function lightOff(Request $request){ } /** * @param Request $request {"areaCode":"1004","locCode":"HAIB2-02-03","displayInfo":null,"PTLAction":0,"PTLSettings":null} * @return array */ public function update(Request $request){// 拍灯以后的消息发至此处 app('LogService')->log(__METHOD__,__FUNCTION__,'拍灯:'.json_encode($request->all())); $this->instant($this->foreignHaiRoboticsService, 'ForeignHaiRoboticsService'); $success = $request->input('success'); $location = $success?200:0; /** @var Station $station */ $station = Station::query()->with('stationType')->where('code',$request['locCode'])->first(); $response = ['location' => $location, 'errMsg' => '', 'data' => $request->all()]; if(empty($station) ||empty($station->stationType->name))return $response; switch ($station->stationType->name) { case '缓存架': // 拍灯 推送任务 if($request['PTLAction'] !== 0){ $response['errMsg']='灯条未开启';return $response; } /** @var CacheShelfService $cacheShelfService */ $cacheShelfService = app(CacheShelfService::class); $result = $cacheShelfService->lightOffTask($request['locCode'],$request['PTLAction']); $response['location']=$result['success']; $response['errMsg']=$result['errMsg']; return $response; case 'U型线拍灯': $this->foreignHaiRoboticsService->uLineLightPat($station); } return $response; } }