|
|
@ -250,24 +250,28 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit |
|
|
|
//数据分析还是沿用原来的
|
|
|
|
menuList = baseDao.getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value(), HttpContextUtils.getLanguage(),tableName); |
|
|
|
} |
|
|
|
Result<Boolean> isRootManager = epmetUserOpenFeignClient.getIsRootManager(tokenDto.getUserId()); |
|
|
|
if (!isRootManager.success()){ |
|
|
|
throw new EpmetException("getIsRootManager method is failure"); |
|
|
|
} |
|
|
|
if (isRootManager.getData()){ |
|
|
|
List<GovMenuDTO> govMenuDTOS = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); |
|
|
|
return TreeUtils.buildTree(govMenuDTOS); |
|
|
|
} |
|
|
|
/*for(GovMenuEntity m:menuList){ |
|
|
|
if("ic_resi_add".equals(m.getPermissions())){ |
|
|
|
logger.info("1、菜单返回了新增居民"); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
disposeGovMenu(menuList,tokenDto.getUserId()); |
|
|
|
Map<Boolean, List<GovMenuEntity>> groupByStatus = menuList.stream().collect(Collectors.groupingBy(GovMenuEntity::getRoleStatus)); |
|
|
|
List<GovMenuDTO> dtoList = ConvertUtils.sourceToTarget(CollectionUtils.isEmpty(groupByStatus.get(true)) ? new ArrayList<>() : groupByStatus.get(true), GovMenuDTO.class); |
|
|
|
List<GovMenuDTO> govMenuDTOS = TreeUtils.buildTree(dtoList); |
|
|
|
return govMenuDTOS; |
|
|
|
|
|
|
|
//TODO: rongchao 注释掉的 后面需要初始化
|
|
|
|
// Result<Boolean> isRootManager = epmetUserOpenFeignClient.getIsRootManager(tokenDto.getUserId());
|
|
|
|
// if (!isRootManager.success()){
|
|
|
|
// throw new EpmetException("getIsRootManager method is failure");
|
|
|
|
// }
|
|
|
|
// if (isRootManager.getData()){
|
|
|
|
// List<GovMenuDTO> govMenuDTOS = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class);
|
|
|
|
// return TreeUtils.buildTree(govMenuDTOS);
|
|
|
|
// }
|
|
|
|
// /*for(GovMenuEntity m:menuList){
|
|
|
|
// if("ic_resi_add".equals(m.getPermissions())){
|
|
|
|
// logger.info("1、菜单返回了新增居民");
|
|
|
|
// }
|
|
|
|
// }*/
|
|
|
|
// disposeGovMenu(menuList,tokenDto.getUserId());
|
|
|
|
// Map<Boolean, List<GovMenuEntity>> groupByStatus = menuList.stream().collect(Collectors.groupingBy(GovMenuEntity::getRoleStatus));
|
|
|
|
// List<GovMenuDTO> dtoList = ConvertUtils.sourceToTarget(CollectionUtils.isEmpty(groupByStatus.get(true)) ? new ArrayList<>() : groupByStatus.get(true), GovMenuDTO.class);
|
|
|
|
// List<GovMenuDTO> govMenuDTOS = TreeUtils.buildTree(dtoList);
|
|
|
|
// return govMenuDTOS;
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|