更新
This commit is contained in:
@@ -15,7 +15,7 @@ use think\console\Output;
|
||||
* 使用方法:
|
||||
* php think express:auto-update
|
||||
*
|
||||
* 配置crontab(每10分钟执行一次):
|
||||
* 配置 crontab(每 10 分钟):拉快递 100 + 按履约「已发货/已签收」核对释放诊单医助(与是否甘草单无关)
|
||||
* 0,10,20,30,40,50 * * * * cd /path/to/server && php think express:auto-update >> /dev/null 2>&1
|
||||
*/
|
||||
class ExpressAutoUpdate extends Command
|
||||
@@ -34,6 +34,7 @@ class ExpressAutoUpdate extends Command
|
||||
|
||||
try {
|
||||
$result = ExpressTrackingService::autoUpdateBatch(200);
|
||||
$recon = ExpressTrackingService::reconcileAssistantReleaseForShippedPrescriptionOrders(200);
|
||||
|
||||
$duration = round(microtime(true) - $startTime, 2);
|
||||
|
||||
@@ -41,9 +42,9 @@ class ExpressAutoUpdate extends Command
|
||||
$output->writeln("总数: {$result['total']}");
|
||||
$output->writeln("成功: {$result['success']}");
|
||||
$output->writeln("失败: {$result['failed']}");
|
||||
$output->writeln("医助已移除: " . (int) ($result['assistant_cleared'] ?? 0));
|
||||
$output->writeln("医助保留(有指派记录): " . (int) ($result['assistant_skipped_assign_log'] ?? 0));
|
||||
$lines = $result['assistant_lines'] ?? [];
|
||||
$output->writeln("医助已移除(物流任务+指派日志): " . (int) ($result['assistant_cleared'] ?? 0));
|
||||
$output->writeln("医助已移除(履约已发货/签收核对): " . (int) ($recon['cleared'] ?? 0) . " (扫描 " . (int) ($recon['scanned'] ?? 0) . " 单)");
|
||||
$lines = array_merge($result['assistant_lines'] ?? [], $recon['lines'] ?? []);
|
||||
if ($lines === []) {
|
||||
$output->writeln('医助明细: (无)');
|
||||
} else {
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\command;
|
||||
|
||||
use app\common\service\ExpressTrackingService;
|
||||
use app\common\service\gancao\GancaoLogisticsRouteService;
|
||||
use app\common\service\gancao\GancaoScmRecipelService;
|
||||
use think\console\Command;
|
||||
@@ -60,6 +61,10 @@ class GancaoSyncLogisticsRoute extends Command
|
||||
|
||||
try {
|
||||
$stats = GancaoLogisticsRouteService::syncBatch($limit, $onlyOrderId);
|
||||
$recon = ExpressTrackingService::reconcileAssistantReleaseForShippedPrescriptionOrders(200);
|
||||
$stats['reconcile_cleared'] = (int) ($recon['cleared'] ?? 0);
|
||||
$stats['reconcile_scanned'] = (int) ($recon['scanned'] ?? 0);
|
||||
$stats['reconcile_lines'] = $recon['lines'] ?? [];
|
||||
} catch (\Throwable $e) {
|
||||
$output->error('同步异常:' . $e->getMessage());
|
||||
return 1;
|
||||
@@ -94,9 +99,9 @@ class GancaoSyncLogisticsRoute extends Command
|
||||
$output->writeln('总数:' . $stats['total']);
|
||||
$output->writeln('成功:' . $stats['success']);
|
||||
$output->writeln('失败:' . $stats['failed']);
|
||||
$output->writeln('医助已移除:' . (int) ($stats['assistant_cleared'] ?? 0));
|
||||
$output->writeln('医助保留(有指派记录):' . (int) ($stats['assistant_skipped_assign_log'] ?? 0));
|
||||
$lines = $stats['assistant_lines'] ?? [];
|
||||
$output->writeln('医助已移除(甘草同步+指派日志):' . (int) ($stats['assistant_cleared'] ?? 0));
|
||||
$output->writeln('医助已移除(履约已发货/签收核对):' . (int) ($stats['reconcile_cleared'] ?? 0) . '(扫描 ' . (int) ($stats['reconcile_scanned'] ?? 0) . ' 单)');
|
||||
$lines = array_merge($stats['assistant_lines'] ?? [], $stats['reconcile_lines'] ?? []);
|
||||
if ($lines === []) {
|
||||
$output->writeln('医助明细:(无)');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user