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("该单据已审批完成,不能再操作");
|
}
|
}
|
}
|