Commit 332eb49b authored by luzhuang's avatar luzhuang

getAllRole

parent 5d837bcf
......@@ -219,7 +219,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
" and u.del_flag !=1 " +
" and u.flag = 1 " +
" and r.r_status = 1 ")
String queryAllRoleById(@Param("userId") String userId);
List<String>queryAllRoleById(@Param("userId") String userId);
@Select("<script>select " +
" (select count(1) from " +
......
......@@ -246,7 +246,19 @@ public class SysUserServiceImpl implements SysUserService {
@Override
public String queryAllRoleById(String userId) {
return sysUserMapper.queryAllRoleById(userId);
List<String> roles = sysUserMapper.queryAllRoleById(userId);
StringBuffer sb = new StringBuffer();
for(String role : roles){
sb.append(role+",");
}
String str1 = sb.toString().substring(0,sb.toString().length() - 1);
String [] strs = str1.split(",");
Set roleSet = new HashSet();
for(String s : strs){
roleSet.add(s);
}
String allRole = StringUtils.join(roleSet.toArray(), ",");
return allRole;
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment