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

+ 2 - 2
app/Console/Kernel.php

@@ -43,8 +43,8 @@ class Kernel extends ConsoleKernel
         $schedule->command('createOwnerReport')->monthlyOn(1);
         $schedule->command('createOwnerBillReport')->monthlyOn(1);
         $schedule->command('createOwnerAreaReport')->monthlyOn(25);
-        $schedule->command('sync:batch')->everyMinute();
-        $schedule->command('sync:order')->everyMinute();
+//        $schedule->command('sync:batch')->everyMinute();
+//        $schedule->command('sync:order')->everyMinute();
     }
 
     /**

+ 4 - 19
app/Http/Controllers/TestController.php

@@ -1137,25 +1137,10 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
     }
     public function reNewBatches3()
     {
-        $batches=Batch::query()->where('id','>',324)->get('code');
-//        $batchCodes = $batches->map(function($batch){
-//            return $batch['code'];
-//        })->toArray();
-        $batchCodes = ['W201201000037',
-            'W201201000038',
-            'W201201000039',
-            'W201201000040',
-            'W201201000041',
-            'W201201000052',
-            'W201201000053',
-            'W201201000054',
-            'W201201000055',
-            'W201201000056',
-            'W201201000057',
-            'W201201000071',
-            'W201201000074',
-            'W201201000075',
-            'W201201000076',];
+        $batches=Batch::query()->where('id','>',5338)->get('code');
+        $batchCodes = $batches->map(function($batch){
+            return $batch['code'];
+        })->toArray();
         $requests=[];
 //        $logs=Log::query()->select('description')->where('CREATED_AT','>','2020-11-11')
 //            ->where('type',"issued_newBatch")

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

@@ -48,6 +48,27 @@ class StorageController
             "priority"      => 20,
             "sequenceFlag"  => -1,
         ]];
+        $this->lightOn = [
+            "areaCode"=> "1004",
+            "PTLAction"=> 1,
+            "PTLSettings"=> [
+                "color"=> 1,
+                "frequency"=> 1
+            ],
+            "displayInfo"=> [
+                "detail01"=> "detail01",
+                "detail02"=> "detail02",
+                "detail03"=> "detail03",
+                "qrCode"=> "qrCode",
+                "qty00"=> "qty00",
+                "qty01"=> 1,
+                "qty02"=> 2,
+                "title"=> "title",
+                "uomDesc01"=> "uo",
+                "uomDesc02"=> "uo"
+            ],
+            "locCode"=> "1004-BZ04-01-01"
+        ];
     }
 
     public function relocate(Request $request){
@@ -67,8 +88,28 @@ class StorageController
         app('LogService')->log(__METHOD__,"haiq-料箱出库成功","REQUEST:".json_encode($this->request)." | RESPONSE:".$response);
         return ["success"=>true];
     }
+    public function light(Request $request,$post){
+        $response = Http::post(config('api.haiq.storage.moveBin'),$post);
+        if (!$response->ok()){
+            app('LogService')->log(__METHOD__,"haiq-请求失败,路径异常","REQUEST:".json_encode($this->post)." | RESPONSE:".$response);
+            return ['success'=>false,"data"=>$response->body()];
+        }
+        if (($response["code"] ?? false) && $response["code"] != 200){
+            app('LogService')->log(__METHOD__,"haiq-料箱出库失败","REQUEST:".json_encode($this->post)." | RESPONSE:".$response);
+            return ['success'=>false,"data"=>$response["errMsg"]];
+        }
+       if (($response["status"] ?? false) && $response["status"] == 500){
+           app('LogService')->log(__METHOD__,"haiq-料箱出库失败","REQUEST:".json_encode($this->post)." | RESPONSE:".$response);
+           return ['success'=>false,"data"=>$response["msg"]];
+        }
+        app('LogService')->log(__METHOD__,"haiq-料箱出库成功","REQUEST:".json_encode($this->post)." | RESPONSE:".$response);
+        return ["success"=>true];
+    }
     public function moveBin(Request $request){
 
+    }
+    public function lightOn(Request $request){
+        return $this->relocate($request,$this->lightOn);
     }
     public function taskUpdate(Request $request){
         $this->service->taskUpdate();

+ 3 - 0
tests/webApi/thirdPart/haiq/storage.http

@@ -8,6 +8,9 @@
 POST http://bswas/api/thirdPart/haiq/storage/relocate
 
 
+###
+POST http://bswas/api/thirdPart/haiq/storage/moveBinIn
+
 ###