CaiWuXiTong/app/Console/Commands/CheckCrawlerWarnings.php
WuYongJie 561c42d830 feat: 店铺主体期间与爬虫数据逻辑
- 店铺维度报表按期初数据+系统主体+爬虫新主体生成主体期间,一行一期间,修复流程历史重复行
- 变更日当天归新主体、老主体失效显示变更日前一天;关店和其他非正常状态两列显示 -
- 新增店铺维度报表逻辑配置页(R1-R8)、主体商标数据逻辑配置页和预警页面
- 爬虫店铺主体按税号归一,首次抓到的新主体写入期间变更表并自动生成新期间
- 店铺基础信息、商标展示按爬虫优先;新增爬虫数据质量检查与预警处理
2026-10-03 13:28:08 +08:00

39 lines
1.0 KiB
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Modules\EcommerceFinance\Services\CrawlerDataGuard;
use Throwable;
class CheckCrawlerWarnings extends Command
{
protected $signature = 'crawler:warnings:check {--quiet-summary : 只输出汇总}';
protected $description = '检查店铺主体、商标爬虫数据的更新和一致性,生成预警记录';
public function handle(CrawlerDataGuard $guard): int
{
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;
}
}