endoscope; } public function getReader(): ReaderInfo { return $this->reader; } public function getOperator(): OperatorInfo { return $this->operator; } public function getStorage(): StorageStatus { return $this->storage; } public function getMorningWash(): MorningWashStatus { return $this->morningWash; } public function getVoice(): VoiceState { return $this->voice; } public function getResult(): ExecutionResult { return $this->result; } public function getProcessStatus(): ProcessStatus { return $this->processStatus; } public function getReminder(): ReminderStatus { return $this->reminder; } public function getPacketContext(): ?PacketContext { return $this->packetContext; } public function getEngineConfig(): ?ProcessConfig { return $this->engineConfig; } public function getRawData(): array { return $this->rawData; } public function isOperatorCard(): bool { return $this->isOperatorCard; } public function getStepDurations(): array { return $this->stepDurations; } // ==================== 便捷查询方法(带数据来源标注) ==================== /** * 获取当前步骤 * @return string 当前步骤名称 (来源: ProcessStatus) */ public function getCurrentStep(): string { return $this->processStatus->currentStep; } /** * 获取流程类型 * @return string 流程类型 (来源: ProcessStatus) */ public function getProcessType(): string { return $this->processStatus->processType; } /** * 获取批次号 * @return string 批次号 (来源: ProcessStatus) */ public function getBatchNo(): string { return $this->processStatus->batchNo; } /** * 获取操作开始时间 * @return string 操作开始时间 (来源: ProcessStatus) */ public function getActionStartTime(): string { return $this->processStatus->actionStartTime; } /** * 获取操作时长 * @return int|null 操作时长(秒)(来源: ProcessStatus) */ public function getDuration(): ?int { return $this->processStatus->duration; } /** * 获取上一个操作记录 * @return \app\model\EctActions|null 上一个操作记录 (来源: ProcessStatus) */ public function getPreviousAction(): ?\app\model\EctActions { return $this->processStatus->previousAction; } /** * 获取完整语音 * @return string 完整语音内容 (来源: VoiceState) */ public function getFullVoice(): string { return $this->voice->getFullVoice(); } /** * 流程是否成功 * @return bool 是否成功 (来源: ExecutionResult) */ public function isSuccess(): bool { return $this->result->success; } /** * 是否需要操作数据库 * @return bool 是否需要数据库操作 (来源: ExecutionResult) */ public function isDatabaseOperationNeeded(): bool { return $this->result->needDatabaseOperation; } /** * 是否需要WebSocket通知 * @return bool 是否需要通知 (来源: ExecutionResult) */ public function isWebSocketNotifyNeeded(): bool { return $this->result->needWebSocketNotify; } /** * 获取数据库操作列表 * @return array 数据库操作列表 (来源: ExecutionResult) */ public function getDbOperations(): array { return $this->result->dbOperations; } /** * 检查是否可以开始新流程 * @return bool 是否可以开始新流程 (来源: ProcessStatus) */ public function canStartNewProcess(): bool { return $this->processStatus->canStartNewProcess(); } /** * 检查是否已完成清洗流程 * @return bool 是否已完成 (来源: ProcessStatus) */ public function isWashProcessCompleted(): bool { return $this->processStatus->isWashProcessCompleted(); } /** * 是否有操作员 * @return bool 是否有有效操作员 (来源: OperatorInfo) */ public function hasOperator(): bool { return $this->operator->isValid(); } /** * 获取步骤时长(从缓存或返回0) */ public function getStepDuration(string $stepCode): int { return $this->stepDurations[$stepCode] ?? 0; } /** * 是否需要增强洗 * @return bool 是否需要增强洗 (来源: ReminderStatus) */ public function isEnhanceWashNeeded(): bool { return $this->reminder->needEnhanceWash; } /** * 是否需要测漏提醒 * @return bool 是否需要测漏提醒 (来源: ReminderStatus) */ public function isLeakTestRemindNeeded(): bool { return $this->reminder->needLeakTestRemind; } /** * 是否需要存储提醒 * @return bool 是否需要存储提醒 (来源: ReminderStatus) */ public function isStorageRemindNeeded(): bool { return $this->reminder->needStorageRemind; } /** * 是否已测漏 * @return bool 是否已测漏 (来源: ReminderStatus) */ public function isLeakTestDoneByReminder(): bool { return $this->reminder->leakTestDone; } /** * 获取测漏结果 * @return string 测漏结果 (来源: ReminderStatus) */ public function getLeakTestResultByReminder(): string { return $this->reminder->leakTestResult; } // ==================== 序列化方法 ==================== /** * 转换为数组 */ public function toArray(): array { return [ 'endoscope' => $this->endoscope->toArray(), 'reader' => $this->reader->toArray(), 'operator' => $this->operator->toArray(), 'storage' => $this->storage->toArray(), 'morningWash' => $this->morningWash->toArray(), 'voice' => $this->voice->toArray(), 'result' => $this->result->toArray(), 'processStatus' => $this->processStatus->toArray(), 'reminder' => $this->reminder->toArray(), 'isOperatorCard' => $this->isOperatorCard, 'stepDurations' => $this->stepDurations, ]; } /** * 转换为 JSON 字符串 */ public function toJson(int $flags = JSON_UNESCAPED_UNICODE): string { return json_encode($this->toArray(), $flags); } }