- 新增违规字典表 store_violation_rules 与推送日志表 store_violation_push_logs;统一表增加预警派生字段(迁移,全部可空带索引) - 预警计算:按平台+违规类型匹配字典(去括号后 相等/前缀/分词/宽松/关键词),匹配不到=不提醒;责任人取店铺账号镜像运营负责人并回退店铺档案;处理截止=申诉截止优先,否则级别天数(P0+1/P1+2/P2+3,当天23:59:59) - 页面:新增预警级别(红/橙/绿标签)、责任人、处理截止、是否超时、推送状态5列;级别/责任人(含我的待办)/超时筛选;默认视图(需提醒&未处理)与全部数据切换;行内 认领/完成/忽略(忽略必填原因) - 处理状态扩为 未处理/处理中/处理完成/已忽略,导入兼容旧值(已处理/无需处理) - 新增「预览统计」页面:平台Tab联动 + 4张KPI卡(今日新增/待处理/P0未处理/已超时)+ 需提醒未处理预览列表与认领 - 群推送先留接口:P0/P1 每天09:00起每5分钟即时推送(责任人、处理建议、去认领签名链接);P2每日10:00汇总(含超时未认领点名);防重与推送日志;新命令 push-instant/push-digest - 同步与导入自动计算派生字段;新增 store-violations:recalc-alerts 重算命令;生产 cron 已登记推送任务 - 测试:StoreViolation 系列 + 部署调度 + 导航 共42项/453断言通过
39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
||
|
||
namespace App\Console\Commands;
|
||
|
||
use App\Business\StoreViolationNotifier;
|
||
use Illuminate\Console\Command;
|
||
|
||
/**
|
||
* 店铺违规信息预警:P2 每日 10:00 汇总日报。
|
||
*/
|
||
class PushStoreViolationDigest extends Command
|
||
{
|
||
protected $signature = 'store-violations:push-digest';
|
||
|
||
protected $description = '推送店铺违规预警每日汇总(P2 汇总与超时未认领点名)';
|
||
|
||
public function handle(StoreViolationNotifier $notifier): int
|
||
{
|
||
if (! $notifier->enabled()) {
|
||
$this->line('推送未配置,跳过。');
|
||
|
||
return self::SUCCESS;
|
||
}
|
||
|
||
$summary = $notifier->pushDigest();
|
||
|
||
$this->info(sprintf(
|
||
'日报推送:%s;P0 %d / P1 %d / P2 %d,超时未认领 %d 条。',
|
||
$summary['sent'] ? '已发送' : '发送失败',
|
||
(int) ($summary['pending']['P0'] ?? 0),
|
||
(int) ($summary['pending']['P1'] ?? 0),
|
||
(int) ($summary['pending']['P2'] ?? 0),
|
||
(int) $summary['overdue'],
|
||
));
|
||
|
||
return self::SUCCESS;
|
||
}
|
||
}
|