30 lines
1.0 KiB
PHP
30 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\EcommerceFinance\Console;
|
|
|
|
use Illuminate\Console\Command;
|
|
use Modules\EcommerceFinance\Services\Jushuitan\ShippingReplicaSynchronizer;
|
|
|
|
/**
|
|
* 只读诊断发货数据:按快递单号列出出库单、发货视图、发货明细、订单、订单商品、运费明细里的记录。
|
|
*
|
|
* php artisan jushuitan:diagnose-package 435386819017109 YT7653398473314
|
|
*/
|
|
class DiagnoseJushuitanPackage extends Command
|
|
{
|
|
protected $signature = 'jushuitan:diagnose-package {tracking* : 快递单号,可多个}';
|
|
|
|
protected $description = '只读诊断:快递单号在聚水潭各上游表中的记录(不写任何数据)';
|
|
|
|
public function handle(): int
|
|
{
|
|
$synchronizer = ShippingReplicaSynchronizer::make();
|
|
foreach ((array) $this->argument('tracking') as $tracking) {
|
|
$result = $synchronizer->diagnosePackage((string) $tracking);
|
|
$this->line(json_encode($result, JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_SUBSTITUTE));
|
|
}
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|