|
|
@ -30,6 +30,7 @@ import com.yxt.anrui.portal.biz.sysstaffinfo.SysStaffinfoService; |
|
|
|
import com.yxt.anrui.portal.biz.sysstafforg.SysStaffOrgService; |
|
|
|
import com.yxt.anrui.portal.biz.sysstaffpost.SysStaffPostService; |
|
|
|
import com.yxt.anrui.portal.biz.sysuserdefaultorg.SysUserDefaultOrgService; |
|
|
|
import com.yxt.anrui.portal.biz.sysuserrole.SysUserRoleService; |
|
|
|
import com.yxt.anrui.portal.config.DictCommonType; |
|
|
|
import com.yxt.anrui.portal.utils.MsgWs; |
|
|
|
import com.yxt.common.base.config.RedisUtil; |
|
|
@ -114,6 +115,8 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
private SysMenuService sysMenuService; |
|
|
|
@Autowired |
|
|
|
private SysMobileMenuService sysMobileMenuService; |
|
|
|
@Autowired |
|
|
|
private SysUserRoleService sysUserRoleService; |
|
|
|
|
|
|
|
|
|
|
|
public PagerVo<SysUser> listPage(PagerQuery<SysUserQuery> pq) { |
|
|
@ -1408,16 +1411,18 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
} else { |
|
|
|
String menuSid = sysMenuList.get(0).getSid(); |
|
|
|
//根据层级查找角色
|
|
|
|
List<String> stringList = Arrays.asList(query.getOrgPath().split("/")); |
|
|
|
// List<String> stringList = Arrays.asList(query.getOrgPath().split("/"));
|
|
|
|
//最后一级的sid所属层级
|
|
|
|
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(stringList.get(stringList.size() - 1)); |
|
|
|
// SysOrganization sysOrganization = sysOrganizationService.fetchBySid(stringList.get(stringList.size() - 1));
|
|
|
|
List<String> roleSidList = sysUserRoleService.selectRoleSid(query.getUserSid()); |
|
|
|
roleSidList.removeAll(Collections.singleton(null)); |
|
|
|
//查询层级对应的角色权限id
|
|
|
|
List<String> roleSid = sysRoleService.selectByRole(sysOrganization.getOrgLevelKey(), menuSid,query.getUserSid()); |
|
|
|
roleSid.removeAll(Collections.singleton(null)); |
|
|
|
if (!roleSid.isEmpty()) { |
|
|
|
for (int i = 0; i < roleSid.size(); i++) { |
|
|
|
if (StringUtils.isNotBlank(roleSid.get(i))) { |
|
|
|
defalutId = roleSid.get(i); |
|
|
|
List<String> roleIdList = sysRoleService.selectByRole(roleSidList, menuSid,query.getUserSid()); |
|
|
|
roleIdList.removeAll(Collections.singleton(null)); |
|
|
|
if (!roleIdList.isEmpty()) { |
|
|
|
for (int i = 0; i < roleIdList.size(); i++) { |
|
|
|
if (StringUtils.isNotBlank(roleIdList.get(i))) { |
|
|
|
defalutId = roleIdList.get(i); |
|
|
|
break; |
|
|
|
} else { |
|
|
|
continue; |
|
|
@ -1427,12 +1432,14 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
} |
|
|
|
} else { |
|
|
|
String menuSid = query.getMenuSid(); |
|
|
|
//根据层级查找角色
|
|
|
|
/* //根据层级查找角色
|
|
|
|
List<String> stringList = Arrays.asList(query.getOrgPath().split("/")); |
|
|
|
//最后一级的sid所属层级
|
|
|
|
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(stringList.get(stringList.size() - 1)); |
|
|
|
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(stringList.get(stringList.size() - 1));*/ |
|
|
|
List<String> roleSidList = sysUserRoleService.selectRoleSid(query.getUserSid()); |
|
|
|
roleSidList.removeAll(Collections.singleton(null)); |
|
|
|
//查询层级对应的角色权限id
|
|
|
|
List<String> roleSid = sysRoleService.selectByMobileRole(sysOrganization.getOrgLevelKey(), menuSid,query.getUserSid()); |
|
|
|
List<String> roleSid = sysRoleService.selectByMobileRole(roleSidList, menuSid,query.getUserSid()); |
|
|
|
roleSid.removeAll(Collections.singleton(null)); |
|
|
|
if (!roleSid.isEmpty()) { |
|
|
|
for (int i = 0; i < roleSid.size(); i++) { |
|
|
|