吴羡
5 小时以前 2f07589b54d56085af77b50d580890cd4130b444
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.ruoyi.device.util;
 
import com.ruoyi.common.exception.ServiceException;
 
/**
 * 设备流程权限校验
 */
public final class DeviceFlowPermissionUtils {
 
    private DeviceFlowPermissionUtils() {
    }
 
    /**
     * 校验当前用户是否为指定环节责任人,历史单据未指定责任人时放行
     */
    public static void checkResponsible(Integer expectedUserId, Integer currentUserId) {
        if (expectedUserId != null && !expectedUserId.equals(currentUserId)) {
            throw new ServiceException("您不是当前环节责任人,无权操作");
        }
    }
 
    /**
     * 流程结束后禁止再次操作
     */
    public static void checkFinished(Integer isFinish) {
        if (isFinish != null && isFinish == 1) {
            throw new ServiceException("该单据已审批完成,不能再操作");
        }
    }
}