package com.qmth.sop.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.sop.business.bean.result.TaskListResult;
import com.qmth.sop.business.entity.TBTask;
import com.qmth.sop.common.enums.TaskResultEnum;
import com.qmth.sop.common.enums.TaskStatusEnum;
import com.qmth.sop.common.enums.TaskTypeEnum;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * <p>
 * 导入导出任务表 服务类
 * </p>
 *
 * @author wangliang
 * @since 2023-07-17
 */
public interface TBTaskService extends IService<TBTask> {

    /**
     * 保存任务
     *
     * @param file
     * @param taskTypeEnum
     * @return
     */
    Map<String, Object> saveTask(MultipartFile file, TaskTypeEnum taskTypeEnum) throws Exception;

    /**
     * 保存任务
     *
     * @param taskTypeEnum
     * @return
     */
    Map<String, Object> saveTask(TaskTypeEnum taskTypeEnum) throws Exception;

    /**
     * 查询任务列表
     *
     * @param iPage
     * @param status
     * @param type
     * @param result
     * @return
     */
    public IPage<TaskListResult> query(IPage<Map> iPage,
                                       TaskStatusEnum status,
                                       TaskTypeEnum type,
                                       TaskResultEnum result);
}
