| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Http\Controllers\api\thirdPart\haiq;
- use App\MaterialBox;
- use App\Services\CacheShelfService;
- use App\Services\ForeignHaiRoboticsService;
- use App\Services\StationCacheShelfGridService;
- use App\Station;
- use App\StationCacheShelfGrid;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\Http;
- class LightController
- {
- protected $request;
- /** @var ForeignHaiRoboticsService $service */
- private $service;
- public function __construct(){
- $this->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()];
- }
- }
|