LD 5 سال پیش
والد
کامیت
5593e9a819
2فایلهای تغییر یافته به همراه14 افزوده شده و 7 حذف شده
  1. 4 3
      app/Services/ForeignHaiRoboticsService.php
  2. 10 4
      app/Services/StationTaskMaterialBoxService.php

+ 4 - 3
app/Services/ForeignHaiRoboticsService.php

@@ -140,10 +140,11 @@ class ForeignHaiRoboticsService
             })()){
                 throw new ErrorException('该料箱没有安排在处理队列中');
             }
-            $this->stationTaskMaterialBoxService->markProcessed($stationTaskMaterialBox);
+            $this->stationTaskMaterialBoxService
+                ->markProcessed($stationTaskMaterialBox);
         }catch (\Exception $e){
-            $this->materialBoxService
-                ->excepted($materialBox);
+            $this->stationTaskMaterialBoxService
+                ->excepted($stationTaskMaterialBox??$materialBox??null);
             return false;
         }
     }

+ 10 - 4
app/Services/StationTaskMaterialBoxService.php

@@ -6,6 +6,7 @@ namespace App\Services;
 
 use App\Batch;
 use App\Exceptions\ErrorException;
+use App\MaterialBox;
 use App\OrderCommodity;
 use App\StationTask;
 use App\StationTaskMaterialBox;
@@ -118,8 +119,10 @@ class StationTaskMaterialBoxService
     function markTaken($stationTaskMaterialBox){
 
     }
-    function markProcessed($stationTaskMaterialBox){
-
+    function markProcessed(StationTaskMaterialBox $stationTaskMaterialBox){
+        $stationTaskMaterialBox['status'] = '完成';
+        $stationTaskMaterialBox->save();
+        $this->stationService->broadcastBinMonitor($stationTaskMaterialBox['station_id'],$stationTaskMaterialBox['stationTask']);
     }
 
     function markProcessing($stationTaskMaterialBox)
@@ -135,8 +138,11 @@ class StationTaskMaterialBoxService
                 data_get($stationTaskMaterialBox, '*.station_id')
             );
     }
-    function excepted($stationTaskMaterialBox){
-
+    function excepted($stationTaskMaterialBox_orBox){
+        switch (get_class($stationTaskMaterialBox_orBox)){
+//            case MaterialBox::class:
+//            case StationTaskMaterialBox::class:
+        }
     }
 
     function getServingTaskType(StationTaskMaterialBox $stationTaskMaterialBox): string