platform = $platform; $this->shopAuthId = $shopAuthId; $this->orderData = $orderData; } public function handle(OrderPullService $orderPullService) { $orderNo = $this->orderData['platform_order_sn'] ?? 'unknown'; try { $result = $orderPullService->processSingleOrder( $this->platform, $this->shopAuthId, $this->orderData ); if ($result['status'] === 'success') { Log::info("订单处理成功", [ 'order_no' => $orderNo, 'order_id' => $result['order_id'] ?? null, ]); } elseif ($result['status'] === 'skipped') { Log::debug("订单跳过", [ 'order_no' => $orderNo, 'reason' => $result['reason'] ?? 'unknown', ]); } } catch (\Exception $e) { Log::error("订单处理失败", [ 'order_no' => $orderNo, 'platform' => $this->platform, 'shop_id' => $this->shopAuthId, 'error' => $e->getMessage(), ]); throw $e; } } public function failed(\Throwable $exception) { Log::error("订单处理最终失败", [ 'platform' => $this->platform, 'shop_id' => $this->shopAuthId, 'order_no' => $this->orderData['platform_order_sn'] ?? 'unknown', 'error' => $exception->getMessage(), ]); } }