| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Jobs;
- use App\Components\ErrorPush;
- use App\OrderPackage;
- use App\Services\OrderService;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Queue\InteractsWithQueue;
- /**
- * @Deprecated 称重计费重置
- */
- class WeightUpdateInstantBill implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable, ErrorPush;
- /** @var \stdClass */
- protected $package;
- /**
- * Create a new job instance.
- *
- * @param OrderPackage|null|Model $package
- *
- * @return void
- */
- public function __construct(?OrderPackage $package)
- {
- $this->package = $package;
- }
- /**
- * Execute the job.
- *
- * @param OrderService $service
- *
- * @return void
- * @throws
- */
- public function handle(OrderService $service)
- {
- if (!$this->package)return;
- if (!$this->package->weight)return;
- $this->package->loadMissing("order");
- if (!$this->package->order)return;
- try {
- $service->reviseLogisticFee($this->package->order);
- }catch (\Exception $e){
- $this->push(__METHOD__."->".__LINE__,"称重重置订单计费",$e->getMessage()." | ".$this->package->toJson());
- throw $e;
- }
- }
- }
|