Quellcode durchsuchen

快递路由同步定时任务

ANG YU vor 5 Jahren
Ursprung
Commit
f8af49c2bd

+ 43 - 0
app/Console/Commands/SyncOrderPackageLogisticRouteTask.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Services\OrderPackageReceivedSyncService;
+use Illuminate\Console\Command;
+
+class SyncOrderPackageLogisticRouteTask extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'syncOrderPackageLogisticRouteTask';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @throws \Exception
+     */
+    public function handle()
+    {
+        (new OrderPackageReceivedSyncService)->syncLogisticRoute();
+    }
+}

+ 3 - 0
app/Console/Kernel.php

@@ -8,6 +8,7 @@ use App\Console\Commands\LogExpireDelete;
 use App\Console\Commands\MakeServiceCommand;
 use App\Console\Commands\SyncBatchTask;
 use App\Console\Commands\SyncLogCacheTask;
+use App\Console\Commands\SyncOrderPackageLogisticRouteTask;
 use App\Console\Commands\SyncUserVisitMenuLogsCacheTask;
 use App\Console\Commands\SyncWMSOrderTask;
 use App\Console\Commands\TestTemp;
@@ -34,6 +35,7 @@ class Kernel extends ConsoleKernel
         TestTemp::class,
         SyncBatchTask::class,
         SyncWMSOrderTask::class,
+//        SyncOrderPackageLogisticRouteTask::class,
     ];
 
     /**
@@ -54,6 +56,7 @@ class Kernel extends ConsoleKernel
         $schedule->command('createOwnerAreaReport')->monthlyOn(25);
         $schedule->command('sync:batch')->everyMinute();
         $schedule->command('sync:order')->everyMinute();
+//        $schedule->command('syncOrderPackageLogisticRouteTask')->dailyAt('00:00')();//同步快递信息到orderPackage
     }
 
     /**