package com.yingpaipay.business.service;

import com.yingpaipay.business.domain.Document;
import com.yingpaipay.business.domain.bo.*;
import com.yingpaipay.business.domain.excel.ProjectExcel;
import com.yingpaipay.business.domain.vo.*;
import jakarta.servlet.http.HttpServletResponse;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;

import java.io.IOException;
import java.util.Collection;
import java.util.List;

/**
 * 文档Service接口
 *
 * @author Huanyi
 * @date 2025-12-11
 */
public interface IDocumentService {

    /**
     * 查询文档
     *
     * @param id 主键
     * @return 文档
     */
    DocumentVo queryById(Long id);

    /**
     * 分页查询文档列表
     *
     * @param bo        查询条件
     * @param pageQuery 分页参数
     * @return 文档分页列表
     */
    TableDataInfo<DocumentVo> queryPageList(DocumentBo bo, PageQuery pageQuery);

    /**
     * 查询符合条件的文档列表
     *
     * @param bo 查询条件
     * @return 文档列表
     */
    List<DocumentVo> queryList(DocumentBo bo);

    /**
     * 新增文档
     *
     * @param bo 文档
     * @return 是否新增成功
     */
    Boolean insertByBo(DocumentBo bo);

    /**
     * 修改文档
     *
     * @param bo 文档
     * @return 是否修改成功
     */
    Boolean updateByBo(DocumentBo bo);

    /**
     * 校验并批量删除文档信息
     *
     * @param ids     待删除的主键集合
     * @param isValid 是否进行有效性校验
     * @return 是否删除成功
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    boolean mark(DocumentMarkBo bo);

    boolean submit(DocumentSubmitBo bo);

    boolean audit(DocumentAuditBo bo);

    boolean confirmSubmit(Long id);

    TableDataInfo<DocumentAuditLogVo> logAudit(DocumentAuditLogBo bo, PageQuery pageQuery);

    boolean filing(DocumentFilingBo bo);

    TableDataInfo<TaskCenterSubmissionListVo> listOnSubmission(TaskCenterSubmissionListBo bo, PageQuery pageQuery);

    TableDataInfo<TaskCenterAuditListVo> listOnAudit(TaskCenterAuditListBo bo, PageQuery pageQuery);

    void download(Long ossId, HttpServletResponse response) throws IOException;

    TableDataInfo<DocumentVo> listOnSearch(DocumentSearchBo bo, PageQuery pageQuery);

    boolean send(DocumentSendBo bo);

    TableDataInfo<TaskCenterFilingListVo> listOnFiling(TaskCenterFilingListBo bo, PageQuery pageQuery);

    AppletMineCountVo getCount();

    TableDataInfo<AppletRecentDocumentVo> listRecentOnApplet(AppletRecentDocumentBo bo, PageQuery pageQuery);

    TableDataInfo<AppletMyTaskDocumentVo> listDocument(AppletMyTaskDocumentBo bo, PageQuery pageQuery);

    TableDataInfo<AppletDocumentScanSubmitVo> listToSubmit(AppletDocumentScanSubmitBo bo, PageQuery pageQuery);

    boolean uploadOnSubmit(AppletUploadOnSubmitBo bo);

    boolean uploadNew(AppletUploadNewBo bo);

    AppletGetRejectionVo getRejection(Long documentId);

    boolean upload(AppletUploadBo bo);

    long countTemp(Long projectId);

    boolean removeTemp(Long documentId);

    boolean specify(DocumentSpecifyBo bo);

    TableDataInfo<DocumentListOnSpecifyVo> listOnSpecify(DocumentListOnSpecifyBo bo, PageQuery pageQuery);

    List<ProjectExcel> getListByProjectId(Long projectId);

    List<Document> listOnWorkbench();
}
