serialNo = $serialNo; $this->payload = $payload; } /** * Execute the job. */ public function handle(MachineService $machineService): void { $machine = Machine::withoutGlobalScopes()->where('serial_no', $this->serialNo)->first(); if (!$machine) { Log::warning("MQTT Error Report: Machine not found", ['serial_no' => $this->serialNo]); return; } // 使用 MachineService 統一處理硬體代碼映射與記錄 (B013 核心邏輯) $machineService->recordErrorLog($machine, $this->payload); } }