| | |
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.stream.Collectors;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.util.CollectionUtils;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.exception.ServiceException;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | |
| | | public String selectUserRoleGroup(String userName)
|
| | | {
|
| | | List<SysRole> list = roleMapper.selectRolesByUserName(userName);
|
| | | StringBuffer idsStr = new StringBuffer();
|
| | | for (SysRole role : list)
|
| | | if (CollectionUtils.isEmpty(list))
|
| | | {
|
| | | idsStr.append(role.getRoleName()).append(",");
|
| | | return StringUtils.EMPTY;
|
| | | }
|
| | | if (StringUtils.isNotEmpty(idsStr.toString()))
|
| | | {
|
| | | return idsStr.substring(0, idsStr.length() - 1);
|
| | | }
|
| | | return idsStr.toString();
|
| | | return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public String selectUserPostGroup(String userName)
|
| | | {
|
| | | List<SysPost> list = postMapper.selectPostsByUserName(userName);
|
| | | StringBuffer idsStr = new StringBuffer();
|
| | | for (SysPost post : list)
|
| | | if (CollectionUtils.isEmpty(list))
|
| | | {
|
| | | idsStr.append(post.getPostName()).append(",");
|
| | | return StringUtils.EMPTY;
|
| | | }
|
| | | if (StringUtils.isNotEmpty(idsStr.toString()))
|
| | | {
|
| | | return idsStr.substring(0, idsStr.length() - 1);
|
| | | }
|
| | | return idsStr.toString();
|
| | | return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
|
| | | }
|
| | |
|
| | | /**
|