<?php

namespace App\Console\Commands;

use App\Models\DrugReportInfo;
use App\Servers\SyncDrugReportService;
use Carbon\Carbon;
use Illuminate\Console\Command;

class SyncDrugReportAssCommand extends Command
{
    protected $signature = 'sync-drug-report-ass';

    protected $description = '同步药检报告数据';
    public function __construct()
    {
        parent::__construct();
    }
    public function handle(SyncDrugReportService $service): int
    {
        echo "开始同步药检报告数据...", PHP_EOL;
        $isFull     = true;
        $source     = 'querydrugreportass';
        $startTime  = '2025-12-01 00:00:00';
        $endTime    = '2025-12-17 00:00:00';
        $page       = 1;
        $pageSize   = 20;
        $data       = $service->syncDrugReport($source, $isFull, $startTime, $endTime, $page, $pageSize);

        echo $isFull ? "全量同步结束" : "增量同步结束", "，共{$data['count']}，处理 {$data['total']} 条记录！", PHP_EOL;

        return 0;
    }

}
