From 966ee0185bd07a82bc1905f5a387f24be7ecd07f Mon Sep 17 00:00:00 2001 From: zimoyin <2556608754@qq.com> Date: Sun, 8 Mar 2026 23:02:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(flow):=20=E6=B7=BB=E5=8A=A0=E5=86=85?= =?UTF-8?q?=E9=95=9C=E6=9C=AA=E5=8F=96=E5=87=BA=E6=97=B6=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在多个流程节点的 canHandle 方法中增加检测 isInStorage 状态的判断 - 当内镜未取出时设置预期下一步为提示刷出库卡语音信息 - 阻止流程节点处理,确保流程按正确顺序执行 - 统一改动覆盖消毒、干燥、终末、终末漂洗、机洗、晨洗、漂洗及清洗节点 --- app/flow/nodes/DisinfectNode.php | 6 ++++++ app/flow/nodes/DryNode.php | 6 ++++++ app/flow/nodes/EndNode.php | 6 ++++++ app/flow/nodes/FinalRinseNode.php | 6 ++++++ app/flow/nodes/MachineWashNode.php | 6 ++++++ app/flow/nodes/MorningWashNode.php | 6 ++++++ app/flow/nodes/RinseNode.php | 6 ++++++ app/flow/nodes/WashNode.php | 6 ++++++ 8 files changed, 48 insertions(+) diff --git a/app/flow/nodes/DisinfectNode.php b/app/flow/nodes/DisinfectNode.php index c7ce8a9..bf7c5be 100644 --- a/app/flow/nodes/DisinfectNode.php +++ b/app/flow/nodes/DisinfectNode.php @@ -33,6 +33,12 @@ class DisinfectNode extends AbstractProcessNode */ public function canHandle(ProcessContext $context): bool { + // 如果内镜未取出 + if ($context->isInStorage) { + $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_STORAGE_OUT; + return false; + } + if (!$this->isMatchReaderType($context)) { if ($context->currentStep === RinseNode::getName()) { $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_DISINFECT; diff --git a/app/flow/nodes/DryNode.php b/app/flow/nodes/DryNode.php index ebbeb9d..7bcf60b 100644 --- a/app/flow/nodes/DryNode.php +++ b/app/flow/nodes/DryNode.php @@ -37,6 +37,12 @@ class DryNode extends AbstractProcessNode */ public function canHandle(ProcessContext $context): bool { + // 如果内镜未取出 + if ($context->isInStorage) { + $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_STORAGE_OUT; + return false; + } + if (!$this->isMatchReaderType($context)) { if ($context->currentStep === FinalRinseNode::getName()) { if (!$context->success) Logger::debug("[DryNode] 刷卡错误,当前步骤是终末漂洗,但是刷的读卡器类型不是终末漂洗,对用户进行语音提示刷终末漂洗读卡器"); diff --git a/app/flow/nodes/EndNode.php b/app/flow/nodes/EndNode.php index 6aed2d8..91536b0 100644 --- a/app/flow/nodes/EndNode.php +++ b/app/flow/nodes/EndNode.php @@ -33,6 +33,12 @@ class EndNode extends AbstractProcessNode */ public function canHandle(ProcessContext $context): bool { + // 如果内镜未取出 + if ($context->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; diff --git a/app/flow/nodes/FinalRinseNode.php b/app/flow/nodes/FinalRinseNode.php index 779bf22..da09633 100644 --- a/app/flow/nodes/FinalRinseNode.php +++ b/app/flow/nodes/FinalRinseNode.php @@ -36,6 +36,12 @@ class FinalRinseNode extends AbstractProcessNode */ public function canHandle(ProcessContext $context): bool { + // 如果内镜未取出 + if ($context->isInStorage) { + $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_STORAGE_OUT; + return false; + } + if (!$this->isMatchReaderType($context)) { if ($context->currentStep === DisinfectNode::getName()) { if (!$context->success) Logger::debug("[FinalRinseNode] 刷卡错误,当前步骤是消毒,但是刷的读卡器类型不是消毒,对用户进行语音提示刷消毒读卡器"); diff --git a/app/flow/nodes/MachineWashNode.php b/app/flow/nodes/MachineWashNode.php index b8038f6..b7b8522 100644 --- a/app/flow/nodes/MachineWashNode.php +++ b/app/flow/nodes/MachineWashNode.php @@ -33,6 +33,12 @@ class MachineWashNode extends AbstractProcessNode */ public function canHandle(ProcessContext $context): bool { + // 如果内镜未取出 + if ($context->isInStorage) { + $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_STORAGE_OUT; + return false; + } + if (!$this->isMatchReaderType($context)) { if ($context->currentStep === WashNode::getName()) { $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_MACHINE_WASH; diff --git a/app/flow/nodes/MorningWashNode.php b/app/flow/nodes/MorningWashNode.php index 2fffa06..5ac5d69 100644 --- a/app/flow/nodes/MorningWashNode.php +++ b/app/flow/nodes/MorningWashNode.php @@ -34,6 +34,12 @@ class MorningWashNode extends AbstractProcessNode */ public function canHandle(ProcessContext $context): bool { + // 如果内镜未取出 + if ($context->isInStorage) { + $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_STORAGE_OUT; + return false; + } + // 只有需要晨洗且未完成晨洗时才处理 if (!$context->needMorningWash || $context->morningWashed) { return false; diff --git a/app/flow/nodes/RinseNode.php b/app/flow/nodes/RinseNode.php index 812b738..bb1d5a3 100644 --- a/app/flow/nodes/RinseNode.php +++ b/app/flow/nodes/RinseNode.php @@ -35,6 +35,12 @@ class RinseNode extends AbstractProcessNode */ public function canHandle(ProcessContext $context): bool { + // 如果内镜未取出 + if ($context->isInStorage) { + $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_STORAGE_OUT; + return false; + } + // 期望当前读卡器为漂洗 if (!$this->isMatchReaderType($context)) { // 当前步骤是清洗且读卡器不符:说明清洗完了应该刷漂洗 diff --git a/app/flow/nodes/WashNode.php b/app/flow/nodes/WashNode.php index ff06c00..a93715e 100644 --- a/app/flow/nodes/WashNode.php +++ b/app/flow/nodes/WashNode.php @@ -36,6 +36,12 @@ class WashNode extends AbstractProcessNode public function canHandle(ProcessContext $context): bool { + // 如果内镜未取出 + if ($context->isInStorage) { + $context->expectedNextStep = VoiceMessage::PLEASE_SWIPE_STORAGE_OUT; + return false; + } + // 读卡器不是本节点,不处理 if (!$this->isMatchReaderType($context)) { return false;