package ink.wgink.module.activiti.service.oa;

import ink.wgink.module.activiti.pojo.pos.oa.OaNodeAssigneePO;
import ink.wgink.module.activiti.pojo.vos.oa.nodemanage.config.AssigneeVO;

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

/**
 * @ClassName: INodeAssigneeService
 * @Description: 节点代理人
 * @Author: wanggeng
 * @Date: 2022/4/4 15:08
 * @Version: 1.0
 */
public interface INodeAssigneeService {

    /**
     * 保存
     *
     * @param modelId
     * @param modelVersion
     * @param nodeId
     * @param nodeIndex
     * @param assignee
     */
    void save(String modelId, Integer modelVersion, String nodeId, int nodeIndex, AssigneeVO assignee);

    /**
     * 更新
     *
     * @param modelId
     * @param modelVersion
     * @param nodeId
     * @param nodeIndex
     * @param assignee
     */
    void update(String modelId, Integer modelVersion, String nodeId, int nodeIndex, AssigneeVO assignee);

    /**
     * 更新部署ID
     *
     * @param modelId
     * @param version
     * @param deploymentId
     */
    void updateDeploymentId(String modelId, Integer version, String deploymentId);

    /**
     * 删除部署ID
     *
     * @param deploymentId
     */
    void deleteDeploymentId(String deploymentId);

    /**
     * 删除
     *
     * @param modelId      模型ID
     * @param modelVersion 模型版本
     */
    void deleteByModelIdAndModelVersion(String modelId, Integer modelVersion);

    /**
     * 节点代理人列表
     *
     * @param params
     * @return
     */
    List<OaNodeAssigneePO> listPO(Map<String, Object> params);

    /**
     * 节点代理人列表
     *
     * @param modelId      模型ID
     * @param modelVersion 模型版本
     * @return
     */
    List<OaNodeAssigneePO> listPOByModelIdAndModelVersion(String modelId, Integer modelVersion);

    /**
     * 节点代理人列表
     *
     * @param deploymentId 部署ID
     * @return
     */
    List<OaNodeAssigneePO> listPOByDeploymentId(String deploymentId);

    /**
     * 节点代理人详情
     *
     * @param params
     * @return
     */
    OaNodeAssigneePO getPO(Map<String, Object> params);

    /**
     * 节点代理人详情
     *
     * @param nodeAssigneeId 主键
     * @return
     */
    OaNodeAssigneePO getPO(String nodeAssigneeId);

    /**
     * 节点代理人详情
     *
     * @param modelId      模型ID
     * @param modelVersion 模型版本
     * @param nodeId       节点ID
     * @return
     */
    OaNodeAssigneePO getPOByModelIdAndModelVersionAndNodeId(String modelId, Integer modelVersion, String nodeId);

    /**
     * 节点代理人详情
     *
     * @param deploymentId 部署ID
     * @param nodeId       节点ID
     * @return
     */
    OaNodeAssigneePO getPOByDeploymentIdAndNodeId(String deploymentId, String nodeId);

    /**
     * 用户任务代理人列表
     *
     * @param currentAssignee  当前处理人
     * @param oaNodeAssigneePO 节点配置
     * @return
     */
    List<String> listAssigneeUserId(String currentAssignee, OaNodeAssigneePO oaNodeAssigneePO);

    /**
     * @param processInstanceId 流程实例ID
     * @param currentAssignee   当前代理人
     * @param oaNodeAssigneePO  节点配置
     * @return
     */
    List<String> listAssigneeUserId(String processInstanceId, String currentAssignee, OaNodeAssigneePO oaNodeAssigneePO);

}
