package com.ruoyi.project.business.service.flow;

import com.ruoyi.project.business.domain.flow.*;
import com.ruoyi.project.business.dto.TaskGenerateParams;
import com.ruoyi.project.business.enums.AuditFlowEnum;

import java.util.List;
import java.util.Map;

/**
 * 【请填写功能名称】Service接口
 *
 * @author generator
 * @date 2021-09-28
 */
public interface IFlowService {

    /************************************ ↓流程配置相关接口↓ *******************************************/

    /**
     * 保存审批流程配置
     *
     * @param flowConfig
     * @return
     */
    int saveConfig(FlowConfig flowConfig);

    /**
     * 获取审批流程配置
     *
     * @param flowConfig
     * @return
     */
    FlowConfig getConfig(FlowConfig flowConfig);

    /**
     * 清除自定义审批流程
     *
     * @param flowConfig
     * @return
     */
    int removeConfig(FlowConfig flowConfig);

    /************************************ ↓流程生成相关接口↓ *******************************************/

    /**
     * 审批任务生成
     *
     * @param taskGenerateParams 流程生成参数
     */
    boolean generateTasks(TaskGenerateParams taskGenerateParams);


    /************************************ ↓流程审批相关接口↓ *******************************************/
    Map<Long, Flow> getFlowMap(List<Long> ids, AuditFlowEnum auditFlow);

    Map<Long, Flow> getFlowMap(List<Long> ids, List<AuditFlowEnum> auditFlows);

    int remove(AuditFlowEnum auditFlow, List<Long> businessIds);

    boolean audit(FlowAuditParam auditParam);

    boolean auditBatch(FlowAuditParam auditParam);

    boolean rollback(FlowAuditParam auditParam);

    List<FlowTaskUser> getAuditHistory(List<AuditFlowEnum> auditFlows, Integer businessId);

    List<FlowVO> getTodoList(FlowTodoListParam params);

    /************************************ ↓(审批时)动态变更流程节点相关接口↓ *******************************************/
    /**
     * 直接通过并结束当前流程
     * @param auditParam
     * @return
     */
    boolean finish(FlowAuditParam auditParam);

    boolean insertCopy(FlowAuditParam auditParam, List<Integer> statusCodes);

    boolean alertAudit(Long taskId);
}
