package com.dxhy.core.job.service;

import java.util.Map;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dxhy.common.utils.PageUtils;
import com.dxhy.core.job.entity.ScheduleJobEntity;

/**
 * 定时任务
 *
 * @author user
 */

public interface ScheduleJobService extends IService<ScheduleJobEntity> {
    /**
     * 翻页查询
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param params
     * @return com.dxhy.common.utils.PageUtils
     */
    PageUtils queryPage(Map<String, Object> params);

    /**
     * 保存定时任务
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param scheduleJob
     * @return void
     */
    void saveJob(ScheduleJobEntity scheduleJob);

    /**
     * 更新定时任务
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param scheduleJob
     * @return void
     */
    void update(ScheduleJobEntity scheduleJob);

    /**
     * 批量删除定时任务
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param jobId
     * @return void
     */
    void deleteBatch(Long jobId);

    /**
     * 批量更新定时任务状态
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param jobId
     * @param status
     * @return int
     */
    int updateBatch(Long jobId, int status);

    /**
     * 立即执行
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param jobId
     * @return void
     */
    void run(Long jobId);

    /**
     * 暂停运行
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param jobId
     * @return void
     */
    void pause(Long jobId);

    /**
     * 恢复运行
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param jobId
     * @return void
     */
    void resume(Long jobId);

    /**
     * 根据id查询
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param jobId
     * @return com.dxhy.core.job.entity.ScheduleJobEntity
     */
    ScheduleJobEntity queryById(Long jobId);

    ScheduleJobEntity queryByBeanName(String beanName, String methodName);

    /**
     * 获取用户扫描识别类型
     *
     * @param userId
     * @return
     */
    String getUserScanType(Long userId);

    Map<String, String> getUserApplyKey(String loginName);

}
