- 店铺主体商标数据逻辑配置新增编辑页:多商标分隔符、同日主体冲突口径、 商标号缺失处理、爬虫断更开关与天数、四类预警责任人 - 店铺维度报表逻辑配置新增期初数据编辑页:114 家变更店铺可增删改, 期初生效日随设置保存 - 规则与期初数据改存系统库 settings(扁平键),首次打开自动从 config/store_report_initial_periods.php 固化,之后不再依赖代码文件 - 控制台任务通过 bootCompanyContext() 读取同一份公司级配置 - 新增迁移清理早期嵌套设置键 - 新增 2 个测试覆盖配置保存与期初店铺增删
42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Illuminate\Console\Command;
|
|
use Modules\EcommerceFinance\Services\CrawlerDataGuard;
|
|
use Modules\EcommerceFinance\Services\DataLogicSettings;
|
|
use Throwable;
|
|
|
|
class CheckCrawlerWarnings extends Command
|
|
{
|
|
protected $signature = 'crawler:warnings:check {--quiet-summary : 只输出汇总}';
|
|
|
|
protected $description = '检查店铺主体、商标爬虫数据的更新和一致性,生成预警记录';
|
|
|
|
public function handle(CrawlerDataGuard $guard): int
|
|
{
|
|
DataLogicSettings::bootCompanyContext();
|
|
|
|
try {
|
|
$summary = $guard->check();
|
|
} catch (Throwable $exception) {
|
|
$this->error('预警检查失败:' . $exception->getMessage());
|
|
|
|
return self::FAILURE;
|
|
}
|
|
|
|
if ($summary === []) {
|
|
$this->info('预警检查完成:没有发现需要处理的记录。');
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
|
|
$this->table(
|
|
['预警类型', '本次检查命中'],
|
|
collect($summary)->map(fn (int $count, string $type): array => [$type, $count])->values()->all(),
|
|
);
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|