WasSyncWmsAsnInformation.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Services\LogService;
  4. use App\Services\OrderTrackingService;
  5. use App\Services\StoreService;
  6. use Illuminate\Console\Command;
  7. use Illuminate\Support\Carbon;
  8. use Illuminate\Support\Facades\Auth;
  9. class WasSyncWmsAsnInformation extends Command
  10. {
  11. /**
  12. * The name and signature of the console command.
  13. *
  14. * @var string
  15. */
  16. protected $signature = 'WasSyncWmsAsnInformation';
  17. /**
  18. * The console command description.
  19. *
  20. * @var string
  21. */
  22. protected $description = '同步WMS的入库信息';
  23. /**
  24. * Create a new command instance.
  25. *
  26. * @return void
  27. */
  28. public function __construct()
  29. {
  30. parent::__construct();
  31. }
  32. /**
  33. * Execute the console command.
  34. *
  35. * @return int
  36. */
  37. public function handle()
  38. {
  39. $this->WasSyncWmsAsn();
  40. }
  41. public function WasSyncWmsAsn(){
  42. /** @var StoreService $storeService */
  43. $storeService = app('storeService');
  44. $dataInterval = intval(data_get(config('sync'), 'asn_sync.interval')) * 60 + 5;
  45. $startDate = Carbon::now()->subSeconds($dataInterval);
  46. $syncStartDate = data_get(config('sync'), 'asn_sync.start_at');
  47. if($syncStartDate ?? false){
  48. $syncStartDate = Carbon::parse($syncStartDate);
  49. if ($startDate->lt($syncStartDate)) {
  50. $startDate = $syncStartDate;
  51. }
  52. }
  53. //$storeService->syncWmsAsnData($startDate);
  54. }
  55. }