- 聚水潭奇门客户端与发货同步器骨架:QimenClient(签名+POST)、ShippingDataSynchronizer(erp.sctrade.query 列表 + erp.sradesku.query 明细 + upsert + modified 水位) - 发货明细扁平展示表 jst_oms_shipping(对齐工作平台发货数据 47 列/顺序,用于快递运费核算);原始表 jst_sctrade/_items/_skus/_receiver + jst_sync_state - 快递应付新增「发货数据」页:Pages.contentForShippingData + 视图 + business_navigation 导航项(slug=shipping-data) - ShippingOrderRepository 读展示表;artisan jushuitan:sync-shipping + 每10分钟增量调度(JST_SYNC_ENABLED 默认关) - 落库连接 jushuitan_local(本地容器,env 可覆盖);演示 Seeder(6 条家具发货样例);.env.jushuitan.example Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014nvGZkg27YMEdhRy6EiUwf
91 lines
2.8 KiB
PHP
91 lines
2.8 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');
|
|
|
|
// 线上代发价格:每天凌晨 00:00 全量/增量同步一次钉钉线上代发业务报销流程。
|
|
// 生产环境由 business-mirror:sync-tables 的 cron 持续增量覆盖,此处保证
|
|
// 一个固定的每日零点刷新入口;命令本身在非刷新环境会安全跳过。
|
|
$schedule->command('business-mirror:sync-ding-online-daifa-price')
|
|
->dailyAt('00:00')
|
|
->withoutOverlapping(60)
|
|
->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();
|
|
}
|
|
|
|
// 聚水潭发货数据增量同步:每 10 分钟按 modified 水位拉销售出库单。
|
|
// 默认关闭(JST_SYNC_ENABLED=false);填好凭证并完成迁移后再打开。
|
|
if ((bool) env('JST_SYNC_ENABLED', false)) {
|
|
$schedule->command('jushuitan:sync-shipping')
|
|
->everyTenMinutes()
|
|
->withoutOverlapping(30)
|
|
->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');
|
|
}
|
|
}
|