42 lines
1.1 KiB
Java
42 lines
1.1 KiB
Java
package com.klp.flowable.utils;
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.klp.common.core.domain.model.LoginUser;
|
|
import com.klp.common.helper.LoginHelper;
|
|
import com.klp.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;
|
|
}
|
|
}
|