package com.qmth.distributed.print.business.service;

import com.qmth.distributed.print.business.bean.result.FlowTaskApprovePeopleAllResult;
import com.qmth.distributed.print.business.bean.result.FlowTaskResult;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.web.multipart.MultipartFile;

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

/**
 * @Description: activiti service
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/7/12
 */
public interface ActivitiService {

    /**
     * 创建流程
     *
     * @param processFileName
     */
    void createDeployment(String processFileName);

    /**
     * 上传流程文件
     *
     * @param file
     */
    void uploadDeployment(MultipartFile file) throws IOException;

    /**
     * 启动流程
     *
     * @param processKey
     * @param map
     */
    public ProcessInstance startActivity(String processKey, Map<String, Object> map);

    /**
     * 流程终止
     *
     * @param flowId
     */
    public void flowEnd(String flowId);

    /**
     * 审批任务
     *
     * @param map
     */
    public Map<String, Object> taskApprove(Map<String, Object> map);

    /**
     * 获取所有流程节点
     *
     * @param flowId
     * @return
     */
    public List<FlowTaskResult> getTaskAll(String flowId);

    /**
     * 流程删除
     *
     * @param id
     * @return
     */
    public Boolean flowDelete(Long id);

    /**
     * 获取所有流程节点待审批人
     *
     * @param courseCode
     * @param taskId
     * @return
     */
    public FlowTaskApprovePeopleAllResult taskApproverPeopleAll(String courseCode, String taskId);

    /**
     * 流程节点转他人审批
     *
     * @param userId
     * @param taskId
     * @return
     */
    public boolean taskApproverExchange(String userId, String taskId);

    /**
     * 获取转他人审批人
     *
     * @param taskId
     * @param realName
     * @return
     */
    public FlowTaskApprovePeopleAllResult taskApproverExchangePeople(String taskId, String realName);
}
