This commit is contained in:
zimoyin
2026-03-13 20:27:18 +08:00
parent 9ddec3dfb9
commit 18254d82f5
9 changed files with 102 additions and 10 deletions
+9 -2
View File
@@ -4,6 +4,7 @@ namespace tests\flow;
use app\flow\config\ProcessConfig;
use app\flow\context\ProcessContext;
use app\flow\enum\VoiceMessage;
use app\flow\ProcessEngine;
use app\flow\context\bean\EndoscopeInfo;
use app\flow\context\bean\OperatorInfo;
@@ -160,16 +161,22 @@ class VirtualityFlowProcessor
if (isset($this->operatorSessions[$readerData['id']])) {
$opData = $this->operatorSessions[$readerData['id']];
$builder->customOperator($opData['id'], $opData['name'], $opData['rfid']);
} else {
// 获取上一个记录的操作员
$opData = $currentState->getOperator();
$builder->customOperator($opData->id, $opData->name, $opData->rfid);
}
// 继承之前的流程状态
if ($currentState !== null) {
$st = strtotime($currentState->getActionStartTime());
$duration = time() - $st;
if (empty($st) || $duration <= 0) $duration = null;
if (empty($st) || $duration < 0) $duration = null;
$builder->currentStep($currentState->getCurrentStep())
->batchNo($currentState->getBatchNo())
->setDuration($duration)
->actionStartTime(date("Y-m-d H:i:s"))
->processType($currentState->getProcessType());
// 设置 previousAction:上一步骤名称就是当前状态的 currentStep
@@ -186,7 +193,7 @@ class VirtualityFlowProcessor
// 未刷人员卡检查
if (!$context->hasOperator() && !isset($this->operatorSessions[$readerData['id']])) {
$result = $context->createModifyBuilder()
->error(\app\flow\enum\VoiceMessage::PLEASE_SWIPE_OPERATOR)
->error(VoiceMessage::PLEASE_SWIPE_OPERATOR)
->build();
$this->history[] = $result;
return $result;