| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace App\Jobs;
- use App\Services\OwnerFeeTotalService;
- use App\Services\OwnerLogisticFeeReportService;
- use App\Services\OwnerStoreFeeReportService;
- use App\Services\OwnerStoreOutFeeReportService;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Queue\InteractsWithQueue;
- use Illuminate\Queue\SerializesModels;
- /**
- * 快递 出库 入库 总账单 统计报表生成任务
- * Class SettlementBillReportTask
- * @package App\Jobs
- */
- /**
- * @Deprecated 月度账单生成
- */
- class SettlementBillReportJob implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
- public $timeout = 3600;
- public $maxExceptions = 3;
- public $tries = 2;
- //生成报告的日期 2021-08-01 生成8月份的报告
- public $init_date;
- /**
- * 初始化的货主,填[]为全部
- * @var $ownerIds array
- */
- public $ownerIds;
- /**
- * @param $init_date
- * @param $ownerIds
- */
- public function __construct($init_date, $ownerIds)
- {
- $this->init_date = $init_date;
- $this->ownerIds = $ownerIds;
- }
- /**
- * Execute the job.
- *
- * @return void
- */
- public function handle()
- {
- //快递
- /** @var OwnerLogisticFeeReportService $expressFeeReportService */
- $expressFeeReportService = app('OwnerLogisticFeeReportService');
- $expressFeeReportService->recordReport($this->init_date, $this->ownerIds);
- //入库
- /** @var OwnerStoreFeeReportService $storeFeeReportService */
- $storeFeeReportService = app('OwnerStoreFeeReportService');
- $storeFeeReportService->recordReport($this->init_date, $this->ownerIds);
- //出库
- /** @var OwnerStoreOutFeeReportService $storeOutFeeReportService */
- $storeOutFeeReportService = app('OwnerStoreOutFeeReportService');
- $storeOutFeeReportService->recordReport($this->init_date, $this->ownerIds);
- //总账单
- /** @var OwnerFeeTotalService $feeTotal */
- $feeTotal = app('OwnerFeeTotalService');
- $feeTotal->record($this->init_date, $this->ownerIds);
- }
- }
|