package com.chinaweal.aiccs.aiccs.abnormal.service;

import com.alibaba.excel.metadata.BaseRowModel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaweal.aiccs.aiccs.abnormal.dto.PYRequestDTO;
import com.chinaweal.aiccs.aiccs.abnormal.entity.TSAttachment;
import com.chinaweal.aiccs.aiccs.abnormal.entity.Toincludeabn;
import com.chinaweal.aiccs.aiccs.revoke.Vo.DisableListVo;
import com.chinaweal.aiccs.aiccs.revoke.entity.dto.AttachmentWritDto;
import com.chinaweal.youfool.framework.springboot.mybatis.plus.BaseService;

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

/**
 * <p>
 * 监管附件上传信息表 服务类
 * </p>
 *
 * @author <a href="https://blog.lroyia.top">lroyia</a>
 * @since 2021-01-19
 */
public interface TSAttachmentService extends BaseService<TSAttachment> {

    /**
     * 查询附件列表
     * @param tsWritModel 查询阐述
     * @return 查询结果
     * @author lroyia
     * @since 2021年1月26日 15:04:28
     */
    List<TSAttachment> selectwritByPage(TSAttachment tsWritModel);

    /**
     * 通过pripid和bizseq获取文件信息
     * @param pripid
     * @param bizseq
     * @return
     */
    List<TSAttachment> getByPripidAndBizseq(String pripid,String bizseq);

    void exportExcel(HttpServletRequest request, HttpServletResponse response, String fileName, List<DisableListVo> list);

    void exportExcel2(HttpServletRequest request, HttpServletResponse response, String fileName, List<?> list, Class<? extends BaseRowModel> clazz);


    /**
     * 通过业务号获取列异业务相关附件
     * @param bizseq
     * @return
     */
    List<TSAttachment> getAbnIncFileList(String bizseq);
    /**
     * 通过业务号获取列严业务相关附件
     * @param bizseq
     * @return
     */
    List<TSAttachment> getIllegalIncFileList(String bizseq);

    boolean saveClueFile(String files, String bizseq);

    /**
     * 批量保存
     * @param list
     * @return
     */
    boolean saveBatchWithList(List<TSAttachment> list);

    IPage<AttachmentWritDto> selectWritsList(IPage<AttachmentWritDto> page, AttachmentWritDto attachmentWritDto);

    List<TSAttachment> queryFileByHistory(String SAPPROVECODE);

    TSAttachment queryHistoryFileById(String sevidencecode);

    boolean saveYMLCClueFile(List<PYRequestDTO.Attachment> files,Toincludeabn toincludeabn);

    IPage<AttachmentWritDto> selectWritsListzx(Page<AttachmentWritDto> page, AttachmentWritDto dto);

    void getMaterial(HttpServletResponse response, String id, String bizSeqNo, String attachType) throws IOException;

    /**
     * 通过bizseq和attachtype获取文件信息
     * @param bizseq
     * @param attachtype
     * @return
     */
    TSAttachment getByBizseqAndType(String bizseq, String attachtype);
}
