fix -- 重写前端选择审批用户模块,添加候选组功能(目前支持"角色"和"部门")。流程图不兼容之前版本!
This commit is contained in:
@@ -60,11 +60,6 @@ public class ProcessConstants {
|
||||
*/
|
||||
public static final String PROCESS_CUSTOM_USER_TYPE = "userType";
|
||||
|
||||
/**
|
||||
* 初始化人员
|
||||
*/
|
||||
public static final String PROCESS_INITIATOR = "INITIATOR";
|
||||
|
||||
|
||||
/**
|
||||
* 流程跳过
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.flowable.common.constant;
|
||||
|
||||
/**
|
||||
* @author konbai
|
||||
* @createTime 2022/4/24 13:24
|
||||
*/
|
||||
public class TaskConstants {
|
||||
|
||||
/**
|
||||
* 流程发起人
|
||||
*/
|
||||
public static final String PROCESS_INITIATOR = "initiator";
|
||||
|
||||
/**
|
||||
* 角色候选组前缀
|
||||
*/
|
||||
public static final String ROLE_GROUP_PREFIX = "ROLE";
|
||||
|
||||
/**
|
||||
* 部门候选组前缀
|
||||
*/
|
||||
public static final String DEPT_GROUP_PREFIX = "DEPT";
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.ruoyi.flowable.utils;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.flowable.common.constant.TaskConstants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工作流任务工具类
|
||||
*
|
||||
* @author konbai
|
||||
* @createTime 2022/4/24 12:42
|
||||
*/
|
||||
public class TaskUtils {
|
||||
|
||||
public static String getUserId() {
|
||||
return String.valueOf(LoginHelper.getUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户组信息
|
||||
*
|
||||
* @return candidateGroup
|
||||
*/
|
||||
public static List<String> getCandidateGroup() {
|
||||
List<String> list = new ArrayList<>();
|
||||
LoginUser user = LoginHelper.getLoginUser();
|
||||
if (ObjectUtil.isNotNull(user)) {
|
||||
if (ObjectUtil.isNotEmpty(user.getRoles())) {
|
||||
user.getRoles().forEach(role -> list.add(TaskConstants.ROLE_GROUP_PREFIX + role.getRoleId()));
|
||||
}
|
||||
if (ObjectUtil.isNotNull(user.getDeptId())) {
|
||||
list.add(TaskConstants.DEPT_GROUP_PREFIX + user.getDeptId());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user