package com.qmth.distributed.print.business.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qmth.distributed.print.business.bean.dto.*;
import com.qmth.teachcloud.common.bean.dto.SchoolDto;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

public interface ClientService {
    IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize);

    List<Map<String, Object>> getPaperUrl(List<JSONObject> objects);

    Boolean tagPass(Long printPlanId, String courseCode, String courseName, String paperNumber, String machineCode, Boolean isPass, Long userId);

    Boolean updatePrintProgress(Long examDetailId, String machineCode, Integer printProgress, Boolean isPrint);

    IPage<ClientExamStudentDto> listStudent(Long examDetailId, String ticketNumber, String studentName, String courseCode, Integer pageNumber, Integer pageSize);

    Map<String, Object> getReprintData(Long examDetailId, String ticketNumber, String type);

    IPage<ClientPrintTaskDto> listClientPrintTask(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Integer pageNumber, Integer pageSize);

    List<Map<String, Object>> getPrintData(String examDetailId, String machineCode, Boolean isPrint, String printUser);

    List<Map<String, Object>> getPrintDataBatch(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate);

    Map<String, Object> getUrlByExamDetailId(Long examDetailId);

    Boolean updateDownload(Long examDetailId, String machineCode, Boolean isDownload);

    Boolean validateData(Long examDetailId, String packageCode, String lastCode);

    List<Map<String, Object>> getBatchUrl(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass);

    void exportClientPrintTask(HttpServletResponse response, String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) throws Exception;

    ClientPrintTaskTotalDto taskTotalData(Long semesterId, Long examId, String printPlanId, Long orgId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, String machineCode);

    IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Long orgId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize);

    ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber);

    void checkPrivilege(Long id);

    boolean updatePassword(Long userId, String password);

    List<SchoolDto> listSchool();
}
