- 新增违规字典表 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断言通过
130 lines
4.5 KiB
PHP
130 lines
4.5 KiB
PHP
<?php
|
||
|
||
namespace App\Console;
|
||
|
||
use Illuminate\Console\Scheduling\Schedule;
|
||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||
|
||
class Kernel extends ConsoleKernel
|
||
{
|
||
/**
|
||
* The Artisan commands provided by your application.
|
||
*
|
||
* @var array
|
||
*/
|
||
protected $commands = [];
|
||
|
||
/**
|
||
* Define the application's command schedule.
|
||
*
|
||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||
* @return void
|
||
*/
|
||
protected function schedule(Schedule $schedule)
|
||
{
|
||
// Not installed yet
|
||
if (!config('app.installed')) {
|
||
return;
|
||
}
|
||
|
||
$schedule_time = config('app.schedule_time');
|
||
|
||
$schedule->command('reminder:invoice')->dailyAt($schedule_time);
|
||
$schedule->command('reminder:bill')->dailyAt($schedule_time);
|
||
$schedule->command('recurring:check')->dailyAt($schedule_time)->runInBackground();
|
||
$schedule->command('storage-temp:clear')->dailyAt('17:00');
|
||
$schedule->command('model:prune')->dailyAt('17:00');
|
||
|
||
// 线上代发价格:每天凌晨 05:00 刷新钉钉审批、采购单和订单关联镜像。
|
||
// 生产环境由 business-mirror:sync-tables 的 cron 持续增量覆盖,此处保证
|
||
// 一个固定的每日刷新入口;命令本身在非刷新环境会安全跳过。
|
||
$schedule->command('business-mirror:sync-ding-online-daifa-price')
|
||
->dailyAt('05:00')
|
||
->withoutOverlapping(60)
|
||
->runInBackground();
|
||
|
||
$schedule->command('business-mirror:sync-product-purchase-prices')
|
||
->dailyAt('05:00')
|
||
->withoutOverlapping(60)
|
||
->runInBackground();
|
||
|
||
$schedule->command('business-mirror:sync-tables operations_replica.rpt.jst_Orders')
|
||
->dailyAt('05:00')
|
||
->withoutOverlapping(60)
|
||
->runInBackground();
|
||
|
||
$schedule->command('business-mirror:sync-supplier-management')
|
||
->dailyAt('08:15')
|
||
->timezone('Asia/Shanghai')
|
||
->withoutOverlapping(60)
|
||
->runInBackground();
|
||
|
||
// 店铺违规信息预警:每天同步副本库抓取结果到统一表(本地补充字段不覆盖)。
|
||
$schedule->command('store-violations:sync')
|
||
->dailyAt('05:30')
|
||
->withoutOverlapping(60)
|
||
->runInBackground();
|
||
|
||
// 店铺违规预警推送:P0/P1 每天 09:00 起每 5 分钟检查;P2 每日 10:00 汇总。
|
||
$schedule->command('store-violations:push-instant')
|
||
->cron('*/5 9-21 * * *')
|
||
->withoutOverlapping(5)
|
||
->runInBackground();
|
||
|
||
$schedule->command('store-violations:push-digest')
|
||
->dailyAt('10:00')
|
||
->withoutOverlapping(30)
|
||
->runInBackground();
|
||
|
||
$schedule->command('business-mirror:sync-third-party-warehouse-storage --max-batches=0')
|
||
->dailyAt('00:00')
|
||
->withoutOverlapping(180)
|
||
->runInBackground();
|
||
|
||
if ((bool) config('services.esign.polling_enabled', false)) {
|
||
$schedule->command('esign:poll-signatures --quiet')
|
||
->cron('*/2 * * * *')
|
||
->withoutOverlapping(5)
|
||
->runInBackground();
|
||
}
|
||
|
||
// 聚水潭发货数据每日重拉最近三天,覆盖副本库迟到更新。
|
||
// 默认关闭(JST_SYNC_ENABLED=false);填好凭证并完成迁移后再打开。
|
||
if ((bool) env('JST_SYNC_ENABLED', false)) {
|
||
$schedule->command('jushuitan:sync-shipping --days=3')
|
||
->dailyAt('01:28')
|
||
->withoutOverlapping(120)
|
||
->runInBackground();
|
||
// 凌晨副本库最近一两天的订单/商品明细常未到齐(视图、订单商品表滞后),
|
||
// 早上再拉一次最近 3 天,补齐凌晨只写入单号、缺商品明细的包裹。
|
||
$schedule->command('jushuitan:sync-shipping --days=3')
|
||
->dailyAt('07:28')
|
||
->withoutOverlapping(120)
|
||
->runInBackground();
|
||
}
|
||
|
||
}
|
||
|
||
/**
|
||
* Register the Closure based commands for the application.
|
||
*
|
||
* @return void
|
||
*/
|
||
protected function commands()
|
||
{
|
||
require base_path('routes/console.php');
|
||
|
||
$this->load(__DIR__ . '/Commands');
|
||
}
|
||
|
||
/**
|
||
* Get the timezone that should be used by default for scheduled events.
|
||
*
|
||
* @return \DateTimeZone|string|null
|
||
*/
|
||
protected function scheduleTimezone()
|
||
{
|
||
return config('app.timezone');
|
||
}
|
||
}
|