package com.njcn.process.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.process.pojo.param.TerminalParam;
import com.njcn.process.pojo.po.PmsTerminalDetection;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.process.pojo.vo.TerminalVO;
import org.springframework.core.io.InputStreamResource;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * <p>
 *  终端检测监督
 * </p>
 *
 * @author wr
 * @since 2023-02-27
 */
public interface PmsTerminalDetectionService extends IService<PmsTerminalDetection> {

    /***
     * 终端检测监督列表
     * @author wr
     * @date 2023-02-27 13:58
     * @param param
     * @return Page<?>
     */
    Page<TerminalVO> terminalPage(TerminalParam.TerminalPageParam param);

    /***
     * 导出模板
     * @author wr
     * @date 2023-02-27 16:14
     * @return  InputStreamResource
     */
    InputStreamResource exportTemplate() throws IOException;

    /***
     * 终端检测监督单条新增
     * @author wr
     * @date 2023-02-27 14:02
     * @param param
     * @return Boolean
     */
    Boolean insertTerminal(TerminalParam.TerminalInsertParam param) ;
    /***
     * 终端检测监督批量新增
     * @author wr
     * @date 2023-02-27 14:02
     * @param file
     * @param response
     * @return Boolean
     */
    void batchTerminal(MultipartFile file, HttpServletResponse response);

    /***
     * 终端检测监督修改
     * @author wr
     * @date 2023-02-27 14:02
     * @param param
     * @return Boolean
     */
    Boolean updateTerminal(TerminalParam.TerminalUpdateParam param);

    /***
     * 终端检测监督删除
     * @author wr
     * @date 2023-02-27 14:02
     * @param ids
     * @return Boolean
     */
    Boolean delTerminal(List<String> ids);

    /***
     * 批量导入检测报告
     * @author wr
     * @date 2023-02-28 9:55
     * @param files
     * @param type
     * @param response
     */
    void importReport(MultipartFile[] files,Integer type, HttpServletResponse response);

    /***
     * 检测报告下载
     * @author wr
     * @date 2023-03-15 10:47
     * @param param
     * @return MinIoUploadResDTO
     */
    InputStreamResource reportDownload(TerminalParam.DownloadParam param);

    /***
     * 终端入网检测台账统计
     * @author wr
     * @date 2023-02-28 11:03
     * @param param
     * @return TerminalVO.TerminalStatistics
     */
    TerminalVO.TerminalStatistics getStatistics(TerminalParam param);

    /***
     * 周期检测统计
     * @author wr
     * @date 2023-02-28 13:48
     * @param param
     * @return List<TerminalStatistics>
     */
    TerminalVO.TerminalStatistics getCycleStatistics(TerminalParam param);

    /***
     * 文件上传
     * @author wr
     * @date 2023-03-17 11:11
     * @param file
     * @return String
     */
    String url(MultipartFile file);
}
