|
@@ -5,6 +5,7 @@ import com.diagbot.client.AuthServiceClient;
|
|
import com.diagbot.dto.BasHospitalInfoDTO;
|
|
import com.diagbot.dto.BasHospitalInfoDTO;
|
|
import com.diagbot.dto.JwtDTO;
|
|
import com.diagbot.dto.JwtDTO;
|
|
import com.diagbot.dto.LoginDTO;
|
|
import com.diagbot.dto.LoginDTO;
|
|
|
|
+import com.diagbot.dto.SysUserPermissionDTO;
|
|
import com.diagbot.dto.UserLoginDTO;
|
|
import com.diagbot.dto.UserLoginDTO;
|
|
import com.diagbot.entity.BasHospitalInfo;
|
|
import com.diagbot.entity.BasHospitalInfo;
|
|
import com.diagbot.entity.JWT;
|
|
import com.diagbot.entity.JWT;
|
|
@@ -227,10 +228,12 @@ public class SysUserFacade extends SysUserServiceImpl {
|
|
|
|
|
|
//添加菜单信息
|
|
//添加菜单信息
|
|
List<SysMenuWrapper> menuList = sysMenuFacade.getByRole(user.getId());
|
|
List<SysMenuWrapper> menuList = sysMenuFacade.getByRole(user.getId());
|
|
|
|
+ List<SysUserPermissionDTO> sysUserPermissionDTOList = sysMenuFacade.getByRolePermission(user.getId());
|
|
Map<Long, List<SysMenuWrapper>> menuMap = EntityUtil.makeEntityListMap(menuList, "parentId");
|
|
Map<Long, List<SysMenuWrapper>> menuMap = EntityUtil.makeEntityListMap(menuList, "parentId");
|
|
|
|
+ Map<Long, List<SysUserPermissionDTO>> menuPermissionMap = EntityUtil.makeEntityListMap(sysUserPermissionDTOList, "menuId");
|
|
List<SysMenuWrapper> menuRes = menuMap.get(-1L);
|
|
List<SysMenuWrapper> menuRes = menuMap.get(-1L);
|
|
for (SysMenuWrapper bean : menuRes) {
|
|
for (SysMenuWrapper bean : menuRes) {
|
|
- getSonMenu(bean, menuMap);
|
|
|
|
|
|
+ getSonMenu(bean, menuMap, menuPermissionMap);
|
|
}
|
|
}
|
|
data.setMenuWrappers(menuRes);
|
|
data.setMenuWrappers(menuRes);
|
|
return data;
|
|
return data;
|
|
@@ -244,13 +247,19 @@ public class SysUserFacade extends SysUserServiceImpl {
|
|
* @param menuMap 菜单集
|
|
* @param menuMap 菜单集
|
|
* @return 菜单结构
|
|
* @return 菜单结构
|
|
*/
|
|
*/
|
|
- public List<SysMenuWrapper> getSonMenu(SysMenuWrapper menu, Map<Long, List<SysMenuWrapper>> menuMap) {
|
|
|
|
|
|
+ public List<SysMenuWrapper> getSonMenu(SysMenuWrapper menu,
|
|
|
|
+ Map<Long, List<SysMenuWrapper>> menuMap,
|
|
|
|
+ Map<Long, List<SysUserPermissionDTO>> menuPermissionMap) {
|
|
List<SysMenuWrapper> res = new ArrayList<>();
|
|
List<SysMenuWrapper> res = new ArrayList<>();
|
|
List<SysMenuWrapper> list = menuMap.get(menu.getId());
|
|
List<SysMenuWrapper> list = menuMap.get(menu.getId());
|
|
|
|
+ List<SysUserPermissionDTO> listPermission = menuPermissionMap.get(menu.getId());
|
|
|
|
+ if (ListUtil.isNotEmpty(listPermission)){
|
|
|
|
+ menu.setSysUserPermissionDTOList(listPermission);
|
|
|
|
+ }
|
|
if (ListUtil.isNotEmpty(list)) {
|
|
if (ListUtil.isNotEmpty(list)) {
|
|
menu.setSubMenuList(list);
|
|
menu.setSubMenuList(list);
|
|
for (SysMenuWrapper bean : list) {
|
|
for (SysMenuWrapper bean : list) {
|
|
- getSonMenu(bean, menuMap);
|
|
|
|
|
|
+ getSonMenu(bean, menuMap, menuPermissionMap);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return res;
|
|
return res;
|