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


import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.project.business.domain.flow.FlowUserPerm;
import com.ruoyi.project.business.enums.AuditFlowEnum;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * 流程数据权限表(用于列表数据筛选，处理审批过程中的用户权限关系，审批通过后删除) 服务类
 * </p>
 *
 * @author CAC
 * @since 2023-10-18
 */
public interface IFlowUserPermService extends IService<FlowUserPerm> {
    /**
     * 数据新增时添加提交人的数据权限
     */
    void addPerm(@NotNull AuditFlowEnum auditFlowEnum, @NotNull Integer businessId);

    void addPermBatch(@NotNull AuditFlowEnum auditFlowEnum, @NotNull List<Integer> businessIds);
    /****************************/

    /**
     * 数据审批时添加审批人的数据权限
     */
    void addPerm(@NotEmpty List<Long> userIds, @NotNull AuditFlowEnum auditFlowEnum, @NotNull Integer businessId);

    void addPermBatch(@NotEmpty List<Long> userIds, @NotNull AuditFlowEnum auditFlowEnum, @NotNull List<Integer> businessId);

    /****************************/

    void removePerm(@NotNull AuditFlowEnum auditFlow, @NotNull Long businessId);

    boolean hasPerm(@NotNull AuditFlowEnum auditFlow, @NotNull Long businessId);
}
