isInStorage) { $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_STORAGE_OUT; return false; } if (!$this->isMatchReaderType($context)) { if ($context->currentStep === DryNode::getName() && $context->currentStep === FinalRinseNode::getName()) { $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_END; } return false; } // 上一个步骤必须是干燥、终末漂洗或机洗 $validSteps = ['干燥', '终末漂洗', '机洗']; if ($this->isRequiredNode($context->currentStep, ['干燥', '终末漂洗', '机洗'])) { if ($context->currentStep === FinalRinseNode::getName()) { $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_WASH; } return false; } return true; } /** * 具体处理逻辑 */ protected function doHandle(ProcessContext $context): ProcessContext { // 更新步骤 $context->currentStep = '结束'; $context->needDatabaseOperation = true; $context->dbOperation = DbOperationType::INSERT; $context->needWebSocketNotify = true; return $context; } }