package com.casic.missiles.modular.alarm.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.casic.missiles.core.datascope.DataScope;
import com.casic.missiles.modular.alarm.model.JobListParam;
import com.casic.missiles.modular.system.dto.UserClientView;
import com.casic.missiles.modular.system.model.AlarmJob;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 报警工单表 服务类
 * </p>
 *
 * @author casic123
 * @since 2019-05-17
 */
public interface IAlarmJobService extends IService<AlarmJob> {
    List<Map<String, Object>> jobList(Page<Map<String, Object>> page, String keywords, String beginTime, String endTime, String jobStatus, String alarmType, String alarmContent, DataScope dataScope, Long userId);

    List<Map<String, Object>> jobListApp(Page<Map<String, Object>> page, String keywords, String beginTime, String endTime, String jobStatus, String alarmType, String alarmContent, Long deptId, Long userId, Long leaderId);
    // List<AlarmJob> jobListExport( Page<AlarmJob> page, String keywords, String beginTime,  String endTime,  String jobStatus, String alarmType,String alarmContent, DataScope dataScope);

    List<Map<String, Object>> jobListDelayRe(Page<Map<String, Object>> page, String keywords, String beginTime, String endTime, String alarmType, String alarmContent, DataScope dataScope, Long userId);

    List<Map<String, Object>> jobListDelayReApp(Page<Map<String, Object>> page, String keywords, String beginTime, String endTime, String alarmType, String alarmContent, Long deptId, Long userId, Long leaderId);

    List<Map<String, Object>> jobListDelayPro(Page<Map<String, Object>> page, String keywords, String beginTime, String endTime, String alarmType, String alarmContent, DataScope dataScope, Long userId);

    List<Map<String, Object>> jobListDelayProApp(Page<Map<String, Object>> page, String keywords, String beginTime, String endTime, String alarmType, String alarmContent, Long deptId, Long userId, Long leaderId);

    List<Map<String, Object>> jobListSearch(Page<Map<String, Object>> page, JobListParam jobListParam, DataScope dataScope, Long userId);

    List<Map<String, Object>> jobListSearchApp(Page<Map<String, Object>> page, JobListParam jobListParam, Long deptId, Long userId, Long leaderId);

    List<Map<String, Object>> jobInfo(Long id, DataScope dataScope, Long personId);

    boolean getJob(Long id, long personId);

    boolean confirmJob(Long id, long personId, String firstState, String firstStatePhotos, String needHandle);

    boolean transferJob(Long id, long transferPerson, String flowRec);

    boolean saveJob(Long id, String handleMessage, String handlePhotos);

    boolean overJob(Long id, long personId, String handleMessage, String handlePhotos);

    boolean overAlarm(Long id);

    boolean handleJob(Long id, long personId);

    Map<String, Object> countByJobStatus(long deptId, int spanDays);

    Map<String, Object> countMyJob(long userId, long deptId, int spanDays);

    boolean checkJobStatus(String jobStatus);

    boolean checkPcRole(Set<String> roleTips);

    Integer countByDataScope(DataScope dataScope, String alarmType, String jobStatus, String beginTime, String endTime);

    Integer countByResponse(String alarmType, String jobStatus, Long deptId, String beginTime, String endTime);

    Integer countByUser(String alarmType, String jobStatus, Long userId, String beginTime, String endTime);

    void updateSinkJob(String id, String msg, String wellCode);

    List<UserClientView> selectUserByWellCode(String wellCode);

    String selectClientIdByUser(Long userId);
}
