package com.ruoyi.web.work.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.work.domain.Statement;
import com.ruoyi.web.work.domain.StatementDetail;
import com.ruoyi.web.work.domain.dto.GenerateDto;
import com.ruoyi.web.work.domain.dto.RejectDto;
import com.ruoyi.web.work.domain.dto.StatementDto;
import com.ruoyi.web.work.domain.dto.StatementExportDto;
import com.ruoyi.web.work.domain.vo.StatementExportListVo;

import java.rmi.ServerException;
import java.util.List;

/**
 * @author lsw
 * @date 2024-04-20
 */
public interface IStatementService extends IService<Statement> {
    List<Statement> selectList(Statement statement);

    List<Statement> selectPayList(Statement statement);

    /**
     * 平台导出网银助手表单
     *
     * @param dto
     * @return
     */
    List<StatementExportListVo> exportList(StatementExportDto dto);

    /**
     * 创建结算单
     *
     * @param list
     * @param statement
     * @return
     */
    AjaxResult makeAdd(List<StatementDetail> list, Statement statement);

    /**
     * 生成结算单
     *
     * @param id
     * @return
     */
    AjaxResult makeGenerate(Long id);

    /**
     * 点击项目生成结算单
     *
     * @param dto
     * @return
     */
    AjaxResult makeGenerateByProject(GenerateDto dto);


    /**
     * 编辑结算单明细
     *
     * @param detail
     * @return
     */
    AjaxResult makeStatementDetailEdit(StatementDetail detail);

    /**
     * 提交结算单审核
     *
     * @param id
     * @return
     */
    AjaxResult manageSubmit(Long id);

    /**
     * 撤回结算单审核
     *
     * @param id
     * @return
     */
    AjaxResult manageCancel(Long id);

    /**
     * 结算单审核通过
     *
     * @param id
     * @return
     */
    AjaxResult auditSuccess(Long id);

    /**
     * 结算单审核驳回
     *
     * @param dto
     * @return
     */
    AjaxResult auditReject(RejectDto dto);

    /**
     * 删除结算单(只有未生成的才能删除)
     *
     * @param id
     * @return
     */
    AjaxResult makeRemove(Long id);


    /**
     * 发放业务费
     *
     * @param dto
     * @return
     */
    AjaxResult giveSend(StatementDto dto) throws ServerException;

    /**
     * 平台确认发放业务费
     *
     * @param id
     * @return
     * @throws ServerException
     */
    AjaxResult payOk(Long id) throws ServerException;

    /**
     * 平台删除发放业务费
     *
     * @param id
     * @return
     * @throws ServerException
     */
    AjaxResult payDelete(Long id) throws ServerException;

    /**
     * 删除结算单明细
     *
     * @param id
     * @return
     */
    AjaxResult makeStatementDetailRemove(Long id);
}
