ai-refactor(flow): 调整抽象流程节点实现和依赖路径

- 修改 AbstractProcessNode 中 ProcessContext 的命名空间引用为 app\flow\context\ProcessContext
- 引入 app\flow\vo\CanHandleResult 用于节点处理结果表示
- 更新前置策略执行后对成功状态的判断,改为调用 isSuccess() 方法
- 增加日志记录细节,便于调试策略执行中断时的错误信息
- 优化代码注释,提升代码可读性和维护性
This commit is contained in:
zimoyin
2026-03-11 02:40:45 +08:00
parent d5991813a6
commit 3471deb3f1
42 changed files with 1950 additions and 4418 deletions
+3 -19
View File
@@ -15,6 +15,7 @@ use app\flow\vo\StorageStatus;
use app\flow\vo\VoiceState;
use app\flow\enum\DbOperationType;
use app\flow\enum\VoiceMessage;
use app\flow\vo\BatchNo;
use app\model\EctActions;
use app\net\PacketContext;
use app\repository\EctActionsRepository;
@@ -316,28 +317,11 @@ class ProcessContextBuilder
/**
* 生成批次号
* @return string 批次号值
*/
private function generateBatchNo(): string
{
$existingBatchNo = null;
if (!$this->endoscope->isEmpty()) {
$existingBatchNo = EctActionsRepository::new()->findTodayActiveBatchNo($this->config->machineId);
}
$datePart = date('Ymd');
$sequence = 1;
if (!empty($existingBatchNo)) {
$existingDatePart = substr($existingBatchNo, 0, 8);
$existingSequence = substr($existingBatchNo, 10, 4);
if ($existingDatePart === $datePart && is_numeric($existingSequence)) {
$sequence = (int)$existingSequence + 1;
}
}
$sequencePart = str_pad($sequence, 4, '0', STR_PAD_LEFT);
return $datePart . $this->config->machineId . $sequencePart;
return BatchNo::generate($this->config->machineId)->value;
}
// ==================== 值对象设置方法 ====================