This commit is contained in:
zimoyin
2026-03-18 13:27:48 +08:00
parent 885b856baa
commit defe163190
7 changed files with 33 additions and 61 deletions
+14 -4
View File
@@ -173,6 +173,7 @@ class VirtualityFlowProcessor
$st = strtotime($currentState->getActionStartTime());
$duration = time() - $st;
if (empty($st) || $duration < 0) $duration = null;
if ($duration == 0) $duration = 1;
$builder->currentStep($currentState->getCurrentStep())
->batchNo($currentState->getBatchNo())
->setDuration($duration)
@@ -228,10 +229,19 @@ class VirtualityFlowProcessor
public function swipe(string $operatorName, string $endoscopeName, string $readerType): ProcessContext
{
Logger::info("测试刷卡:{$operatorName}, {$endoscopeName}, {$readerType}");
// 刷人员
$result = $this->swipeOperatorCard($operatorName, $readerType);
// 当前语音
Logger::info("当前语音:{$result->getFullVoice()}");
// 如果当前流程中不存在人员卡就刷卡
$endoscopeData = $this->environment['endoscopes'][$endoscopeName]
?? throw new \InvalidArgumentException("未找到内镜: {$endoscopeName}");
// 获取内镜当前状态
/** @var ProcessContext $currentState */
$currentState = $this->endoscopeStates[$endoscopeData['id']] ?? null;
if ($currentState === null){
// 刷人员卡
$result = $this->swipeOperatorCard($operatorName, $readerType);
// 当前语音
Logger::info("当前语音:{$result->getFullVoice()}");
}
// 刷内镜卡
Logger::info("测试刷卡:{$endoscopeName}, {$readerType}");
+4 -1
View File
@@ -2,6 +2,7 @@
namespace tests\flow\cases;
use app\config\Config;
use app\flow\config\ProcessConfig;
use app\flow\ProcessEngine;
use tests\flow\TestCase;
@@ -23,6 +24,7 @@ class ManualWashTest extends TestCase
{
parent::setUp();
$this->processor = VirtualityFlowProcessor::createStandard();
Config::getInstance()->setBlockMode(false);
}
protected function tearDown(): void
@@ -31,6 +33,7 @@ class ManualWashTest extends TestCase
$this->processor->reset();
}
// ==================== 1. 正常完整手工洗流程 ====================
/**
@@ -76,7 +79,7 @@ class ManualWashTest extends TestCase
// 验证最终步骤成功
$this->assertTrue($result5->isSuccess(), '干燥步骤 isSuccess() 应为 true');
}
/**
* 测试使用便捷方法执行完整手工洗流程
*/