修复工单PHP CLI同步问题 系统设置可以设置并发阈值

This commit is contained in:
root
2026-07-02 19:03:06 +08:00
parent 638b3c4032
commit c3223f026e
20 changed files with 1087 additions and 241 deletions
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace app\common\service;
use app\common\library\scrm\AbstractScrmSpider;
use app\common\library\scrm\ScrmSpiderInterface;
use app\common\library\scrm\spider\A2cSpider;
use app\common\library\scrm\spider\ChatknowSpider;
@@ -59,6 +60,49 @@ class SplitScrmSpiderFactory
return array_keys(self::MAP);
}
/**
* 同步是否依赖 Node Headless(纯 PHP cURL 等为 false
*/
public static function requiresNode(string $ticketType): bool
{
$class = self::resolveClass($ticketType);
if ($class === null) {
return true;
}
return is_subclass_of($class, AbstractScrmSpider::class);
}
/**
* @return list<string>
*/
public static function listDirectSyncTypes(): array
{
$types = [];
foreach (self::listSupportedTypes() as $ticketType) {
if (!self::requiresNode($ticketType)) {
$types[] = $ticketType;
}
}
return $types;
}
/**
* @return list<string>
*/
public static function listNodeSyncTypes(): array
{
$types = [];
foreach (self::listSupportedTypes() as $ticketType) {
if (self::requiresNode($ticketType)) {
$types[] = $ticketType;
}
}
return $types;
}
/**
* @return ScrmSpiderInterface|null
*/