package com.njcn.process.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.prepare.harmonic.pojo.dto.SuperviseDto;
import com.njcn.process.pojo.param.SuperviseParam;
import com.njcn.process.pojo.po.ThsSupervise;
import com.njcn.process.pojo.vo.SuperviceRunLogVo;
import com.njcn.process.pojo.vo.SuperviseVo;
import com.njcn.process.pojo.vo.ThsSuperviseVo;
import com.njcn.process.pojo.param.FileParam;
import com.njcn.process.pojo.param.ThsSuperviseParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;

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

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author lxp
 * @since 2023-03-16
 */
public interface ThsSuperviseService extends IService<ThsSupervise> {

    /**
     * 保存技术监督数据
     *
     * @param superviceRunLogVo
     */
    void saveOverRunLog(SuperviceRunLogVo superviceRunLogVo);

    /**
     * 查询技术监督列表
     *
     * @param superviseDto
     */
    Page<SuperviseVo> querySuperviseList(SuperviseDto superviseDto);

    /**
     * 删除技术监督
     *
     * @param superviseDto
     * @return
     */
    HttpResult deleteSupervise(SuperviseDto superviseDto);

    /**
     * 上传技术监督单据
     *
     * @param id
     * @param ticketType
     * @param files
     * @param response
     */
    void uploadSuperviseTicket(String id, String supIndex, Integer ticketType, MultipartFile[] files, HttpServletResponse response);

    /**
     * 查询流程状态枚举列表
     *
     * @return
     */
    List<Map<Integer, String>> queryProgressValues();

    /**
     * 上传单据模板
     *
     * @param type
     * @param formworkType
     * @param file
     * @param response
     */
    void uploadAlarmFormwork(Integer type, Integer formworkType, MultipartFile file, HttpServletResponse response);

    /**
     * 下载单据模板
     *
     * @param type
     * @param formworkType
     * @param response
     * @return
     */
    String dowloadAlarmFormwork(Integer type, Integer formworkType, String supIndex, HttpServletResponse response);

    /**
     * 技术监督首页
     *
     * @param superviseDto
     * @return
     */
    ThsSuperviseVo superviseIndex(SuperviseDto superviseDto);

    /**
     * 下载反馈文件
     *
     * @param fileParam
     * @param response
     * @return
     */
    HttpServletResponse downloadFeedBackFile(FileParam fileParam, HttpServletRequest request, HttpServletResponse response);



    /**
     * 生成预警单告警单
     * @author cdf
     * @date 2024/1/29
     */
    SuperviceRunLogVo initSupervise(@RequestBody @Validated SuperviseParam superviseParam);


    //SuperviceRunLogVo initSuperviseHand(@RequestBody @Validated SuperviseParam superviseParam);


    Page<ThsSupervise> queryPage(ThsSuperviseParam thsSuperviseParam);
}
