ajun пре 4 година
родитељ
комит
e2a9d255df

+ 6 - 6
app/Http/Controllers/api/thirdPart/haiq/LightController.php

@@ -31,12 +31,12 @@ class LightController
      */
      */
     public function update(Request $request){// 拍灯以后的消息发至此处
     public function update(Request $request){// 拍灯以后的消息发至此处
 
 
-//        if($request['PTLAction'] == 0){  // 拍灯 推送任务
-//            /** @var CacheShelfService $cacheShelfService */
-//            $cacheShelfService = app(CacheShelfService::class);
-//            $result =   $cacheShelfService->lightOffTask($request['locCode'],$request['PTLAction']);
-//            return ['location'=>$result['success'] ? 200 :0,'errMsg'=>$result['errMsg'] ?? null,'data'=>$request->all()];
-//        }
+        if($request['PTLAction'] == 0){  // 拍灯 推送任务
+            /** @var CacheShelfService $cacheShelfService */
+            $cacheShelfService = app(CacheShelfService::class);
+            $result =   $cacheShelfService->lightOffTask($request['locCode'],$request['PTLAction']);
+            return ['location'=>$result['success'] ? 200 :0,'errMsg'=>$result['errMsg'] ?? null,'data'=>$request->all()];
+        }
         $success = $request->input('success');
         $success = $request->input('success');
         $location = $success?200:0;
         $location = $success?200:0;
         app('LogService')->log(__METHOD__,__FUNCTION__,'拍灯:'.json_encode($request->all()));
         app('LogService')->log(__METHOD__,__FUNCTION__,'拍灯:'.json_encode($request->all()));

+ 1 - 0
app/Services/CacheShelfService.php

@@ -107,6 +107,7 @@ class CacheShelfService
         $stationTask = $this->stationTaskService->create(1);                                                    // 生成站任务
         $stationTask = $this->stationTaskService->create(1);                                                    // 生成站任务
         $stationTaskMaterialBox = $this->stationTaskMaterialBoxService->createByStationAndMaterialBox($station,$materialBox);     // 创建料箱任务
         $stationTaskMaterialBox = $this->stationTaskMaterialBoxService->createByStationAndMaterialBox($station,$materialBox);     // 创建料箱任务
         $this->stationTaskService->registerStations($stationTask,[$station['id']]);                                            // 注册站任务站
         $this->stationTaskService->registerStations($stationTask,[$station['id']]);                                            // 注册站任务站
+        $stationTaskMaterialBox->update(['station_task_id'=>$stationTask['id']]);
         $params = [[
         $params = [[
                 'station_task_id'=>$stationTask->first()['id'],
                 'station_task_id'=>$stationTask->first()['id'],
                 'station_taskable_type'=>StationTaskMaterialBox::class,
                 'station_taskable_type'=>StationTaskMaterialBox::class,