|
|
@ -169,7 +169,8 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit |
|
|
|
|
|
|
|
// //系统管理员,拥有最高权限
|
|
|
|
// if(govUserDTOResult.getData().getSuperAdmin() == SuperAdminEnum.YES.value()){
|
|
|
|
menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); |
|
|
|
//目前不支持角色 菜单
|
|
|
|
menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage(), null); |
|
|
|
// }else {
|
|
|
|
// menuList = baseDao.getUserMenuList(tokenDto.getUserId(), type, HttpContextUtils.getLanguage());
|
|
|
|
// }
|
|
|
@ -180,8 +181,11 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<GovMenuDTO> getMenuList(Integer type) { |
|
|
|
List<GovMenuEntity> menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); |
|
|
|
public List<GovMenuDTO> getMenuList(Integer type, String tableName) { |
|
|
|
if (StringUtils.isBlank(tableName)){ |
|
|
|
tableName = "gov_menu"; |
|
|
|
} |
|
|
|
List<GovMenuEntity> menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage(), tableName); |
|
|
|
|
|
|
|
List<GovMenuDTO> dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); |
|
|
|
|
|
|
@ -189,7 +193,7 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<GovMenuDTO> getUserMenuNavList(TokenDto tokenDto) { |
|
|
|
public List<GovMenuDTO> getUserMenuNavList(TokenDto tokenDto, String tableName) { |
|
|
|
// List<GovMenuDTO> menuList = govMenuRedis.getUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient());
|
|
|
|
// if(menuList == null){
|
|
|
|
// menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value());
|
|
|
@ -198,7 +202,10 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit |
|
|
|
// }
|
|
|
|
// PC端 每个客户的菜单信息,不放入缓存,每次登陆重新查询。
|
|
|
|
// 或者 你可以选择,在给每个客户 配置可见菜单的时候, 在saveCustomerMenu方法中,增加更新缓存的逻辑
|
|
|
|
return getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); |
|
|
|
if (StringUtils.isBlank(tableName)){ |
|
|
|
tableName = "gov_menu"; |
|
|
|
} |
|
|
|
return getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value(),tableName); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -206,19 +213,20 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit |
|
|
|
* |
|
|
|
* @param customerId |
|
|
|
* @param type |
|
|
|
* @param tableName |
|
|
|
* @return java.util.List<com.epmet.dto.GovMenuDTO> |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 15:51 2021-03-16 |
|
|
|
**/ |
|
|
|
private List<GovMenuDTO> getCustomerMenuList(String customerId, Integer type) { |
|
|
|
List<GovMenuDTO> govMenuDTOS = govCustomerMenuRedis.getCustomerMenuList(customerId,type); |
|
|
|
private List<GovMenuDTO> getCustomerMenuList(String customerId, Integer type, String tableName) { |
|
|
|
List<GovMenuDTO> govMenuDTOS = govCustomerMenuRedis.getCustomerMenuList(customerId,type,tableName); |
|
|
|
if (!CollectionUtils.isEmpty(govMenuDTOS)){ |
|
|
|
return govMenuDTOS; |
|
|
|
} |
|
|
|
List<GovMenuEntity> menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage()); |
|
|
|
List<GovMenuEntity> menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage(),tableName); |
|
|
|
List<GovMenuDTO> dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); |
|
|
|
govMenuDTOS = TreeUtils.buildTree(dtoList); |
|
|
|
govCustomerMenuRedis.setCustomerMenuList(customerId,type,govMenuDTOS); |
|
|
|
govCustomerMenuRedis.setCustomerMenuList(customerId,type,govMenuDTOS,tableName); |
|
|
|
return govMenuDTOS; |
|
|
|
} |
|
|
|
|
|
|
@ -235,7 +243,8 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit |
|
|
|
//超级管理员,拥有最高权限
|
|
|
|
List<GovMenuEntity> menuList; |
|
|
|
// if(govUserDTOResult.getData().getSuperAdmin() == SuperAdminEnum.YES.value()){
|
|
|
|
menuList = baseDao.getMenuList(MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); |
|
|
|
//目前不支持角色 菜单
|
|
|
|
menuList = baseDao.getMenuList(MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage(), null); |
|
|
|
// }else{
|
|
|
|
// menuList = baseDao.getUserMenuList(tokenDto.getUserId(), MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage());
|
|
|
|
// }
|
|
|
|