d5991813a6
- 修改 AbstractProcessNode 中 ProcessContext 的命名空间引用为 app\flow\context\ProcessContext - 引入 app\flow\vo\CanHandleResult 用于节点处理结果表示 - 更新前置策略执行后对成功状态的判断,改为调用 isSuccess() 方法 - 增加日志记录细节,便于调试策略执行中断时的错误信息 - 优化代码注释,提升代码可读性和维护性
59 lines
1.1 KiB
PHP
59 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace app\flow\vo;
|
|
|
|
/**
|
|
* 内镜信息值对象
|
|
* 封装内镜的基础信息,不可变对象
|
|
*/
|
|
readonly class EndoscopeInfo
|
|
{
|
|
public function __construct(
|
|
/** 内镜ID */
|
|
public string $id = '',
|
|
/** 内镜名称 */
|
|
public string $name = '',
|
|
/** 内镜RFID卡号 */
|
|
public string $cardNo = '',
|
|
/** 内镜类型(胃镜/肠镜等) */
|
|
public string $type = '',
|
|
) {}
|
|
|
|
/**
|
|
* 创建空的内镜信息
|
|
*/
|
|
public static function empty(): self
|
|
{
|
|
return new self();
|
|
}
|
|
|
|
/**
|
|
* 判断内镜信息是否为空
|
|
*/
|
|
public function isEmpty(): bool
|
|
{
|
|
return empty($this->id);
|
|
}
|
|
|
|
/**
|
|
* 判断内镜信息是否有效
|
|
*/
|
|
public function isValid(): bool
|
|
{
|
|
return !empty($this->id) && !empty($this->cardNo);
|
|
}
|
|
|
|
/**
|
|
* 转换为数组
|
|
*/
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'name' => $this->name,
|
|
'cardNo' => $this->cardNo,
|
|
'type' => $this->type,
|
|
];
|
|
}
|
|
}
|