LD 5 лет назад
Родитель
Сommit
e73c783ec2

+ 0 - 1
app/Http/Controllers/api/thirdPart/haiq/StorageController.php

@@ -243,7 +243,6 @@ class StorageController
         return $this->light($request,$this->lightOff);
     }
     public function taskUpdate(ForeignHaiRobotic_taskUpdateRequest $request){
-        return $request->method();
         try{
             $this->service->taskUpdate(
                 $request['groupCode'],

+ 1 - 1
app/Http/Requests/ForeignHaiRobotic_taskUpdateRequest.php

@@ -28,7 +28,7 @@ class ForeignHaiRobotic_taskUpdateRequest extends FormRequest
         return [
            'groupCode'=>'required',
            'taskCode'=>'required',
-           'updateEventType'=>'required',
+           'updateEventType'=>'required|in:0,1',
            'status'=>'required|in:0,1',
            'binCode'=>'required',
            'kubotId'=>'required',

+ 12 - 3
app/Services/ForeignHaiRoboticsService.php

@@ -113,14 +113,23 @@ class ForeignHaiRoboticsService
         $robotId,
         $description
     ):bool{
-        if($status==1){
+        if(($failed
+                =$status)==1){
             return $this->excepted();
         }
+        if(($isPut
+                =$updateEventType)==0){
+            return $this->markHasPut();
+        }
+        if(($isGet
+                =$updateEventType)==1){
+            return $this->markHasGot();
+        }
         switch ($updateEventType){
             case 0:
             case 1:
         }
-        $this->markHasGet();
+        $this->markHasGot();
 
     }
     public function markHasPut(
@@ -135,7 +144,7 @@ class ForeignHaiRoboticsService
 
 
     }
-    public function markHasGet(
+    public function markHasGot(
         $groupCode,
         $taskCode,
         $updateEventType,   //0:task_begin(取货)1:task_end(放货)

+ 1 - 1
resources/lang/cn/validation.php

@@ -57,7 +57,7 @@ return [
         'array' => ':attribute must have :value items or more.',
     ],
     'image' => ':attribute must be an image.',
-    'in' => 'selected :attribute is invalid.',
+    'in' => ' :attribute 不在合法值内.',
     'in_array' => ':attribute field does not exist in :other.',
     'integer' => ':attribute must be an integer.',
     'ip' => ':attribute must be a valid IP address.',

+ 1 - 1
tests/webApi/thirdPart/haiq/storage.http

@@ -39,7 +39,7 @@ Content-Type: application/json
 POST http://bswas/api/thirdPart/haiq/storage/taskUpdate
 Content-Type: application/json
 
-{"taskUpdate":"1"}
+{"status":0}
 ###
 
 POST http://bswas/api/thirdPart/haiq/storage/exception