<?php

namespace app\api\controller\v1;

use app\api\business\TaskInformationBus;

class TaskInformation
{

    //获取任务详情
    public function getTaskDetail()
    {
        $data = [
            'pageNum' => request()->param('pageNum', 1, 'int'),
            'pageSize' => request()->param('pageSize', null, 'int'),
            'task_id' => request()->param('task_id', null, 'int'),
        ];
        $result = (new TaskInformationBus())->getTaskDetail($data['task_id'], $data['pageNum'], $data['pageSize']);
        return showSuccess($result);
    }

    //获取抽样任务列表
    public function getSampleTaskList()
    {
        $data = [
            'pageNum' => request()->param('pageNum', 1, 'int'),
            'pageSize' => request()->param('pageSize', null, 'int'),
            'task_id' => request()->param('task_id', null, 'int'),
        ];
        $result = (new TaskInformationBus())->getSampleTaskList($data['task_id'], $data['pageNum'], $data['pageSize']);
        return showSuccess($result);
    }

    //获取检测任务列表
    public function getCheckTaskList()
    {
        $data = [
            'pageNum' => request()->param('pageNum', 1, 'int'),
            'pageSize' => request()->param('pageSize', null, 'int'),
            'task_id' => request()->param('task_id', null, 'int'),
        ];
        $result = (new TaskInformationBus())->getCheckTaskList($data['task_id'], $data['pageNum'], $data['pageSize']);
        return showSuccess($result);

    }

    //获取报告上传任务列表
    public function getReportTaskList()
    {
        $data = [
            'pageNum' => request()->param('pageNum', 1, 'int'),
            'pageSize' => request()->param('pageSize', null, 'int'),
            'task_id' => request()->param('task_id', null, 'int'),
        ];
        $result = (new TaskInformationBus())->getReportTaskList($data['task_id'], $data['pageNum'], $data['pageSize']);
        return showSuccess($result);
    }

}