|
|
|
@ -132,7 +132,7 @@ public class AuthController extends CoreBaseController {
|
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
|
|
|
List<SysMenu> menuList = memTreeService.packTreeSysMenuByUserId(getSessionUser().getUser().getId());
|
|
|
|
|
Long menuSelectTime = System.currentTimeMillis();
|
|
|
|
|
LOGGER.info("第一段耗时:{}",menuSelectTime-startTime);
|
|
|
|
|
LOGGER.info("第一段耗时:{}", menuSelectTime - startTime);
|
|
|
|
|
List<SysMenu> list = memTreeService.packTreeSysMenuByParentIdAndMenuType(menuList, CommonConstWords.SYSTEM_MENU_ROOT_ID, CommonEnumUtil.METHOD_LEVEL.PLUGIN.getValue());
|
|
|
|
|
LOGGER.info("第二段耗时:{}", System.currentTimeMillis() - menuSelectTime);
|
|
|
|
|
|
|
|
|
@ -157,10 +157,14 @@ public class AuthController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "获取登录用户功能权限信息", notes = "获取首页权限信息")
|
|
|
|
|
public ResultBean findMenuModuleList(@PathVariable("parentId") String parentId) {
|
|
|
|
|
try {
|
|
|
|
|
ValidatorBean.checkIsNumber(parentId,"父节点不能为空");
|
|
|
|
|
ValidatorBean.checkIsNumber(parentId, "父节点不能为空");
|
|
|
|
|
|
|
|
|
|
List<SysMenu> result = memTreeService.packTreeSysMenuByUserIdAndParentId(getSessionUser().getUser().getId(), Long.parseLong(parentId));
|
|
|
|
|
result=sysMenuService.setLanguageSysMenuName(AuthUtil.getSessionUser().getLanguageCode(),result);
|
|
|
|
|
for (SysMenu sysMenu : result) {
|
|
|
|
|
sysMenu.setChildList(sysMenu.getChildList().stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList()));
|
|
|
|
|
}
|
|
|
|
|
result = result.stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList());
|
|
|
|
|
result = sysMenuService.setLanguageSysMenuName(AuthUtil.getSessionUser().getLanguageCode(), result);
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(result);
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
LOGGER.error(busExcep.getErrorMsg() + ":{}", busExcep.getErrorDetail(), busExcep);
|
|
|
|
@ -182,11 +186,11 @@ public class AuthController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "获取登录用户功能权限信息", notes = "获取首页权限信息")
|
|
|
|
|
public ResultBean findModuleList(@PathVariable("parentId") String parentId) {
|
|
|
|
|
try {
|
|
|
|
|
ValidatorBean.checkIsNumber(parentId,"父节点不能为空");
|
|
|
|
|
ValidatorBean.checkIsNumber(parentId, "父节点不能为空");
|
|
|
|
|
|
|
|
|
|
List<SysMenu> result = memTreeService.packTreeSysMenuByUserIdAndParentId(getSessionUser().getUser().getId(), Long.parseLong(parentId));
|
|
|
|
|
// 国际化
|
|
|
|
|
result = sysMenuService.setLanguageSysMenuName(getSessionUser().getLanguageCode(),result);
|
|
|
|
|
result = sysMenuService.setLanguageSysMenuName(getSessionUser().getLanguageCode(), result);
|
|
|
|
|
result = findChildList(result);
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功")
|
|
|
|
@ -203,11 +207,11 @@ public class AuthController extends CoreBaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<SysMenu> findChildList(List<SysMenu> findList){
|
|
|
|
|
private List<SysMenu> findChildList(List<SysMenu> findList) {
|
|
|
|
|
List<SysMenu> result = new ArrayList<>();
|
|
|
|
|
if(CollectionUtils.isNotEmpty(findList)){
|
|
|
|
|
if (CollectionUtils.isNotEmpty(findList)) {
|
|
|
|
|
for (SysMenu menu : findList) {
|
|
|
|
|
if(CollectionUtils.isNotEmpty(menu.getChildList())){
|
|
|
|
|
if (CollectionUtils.isNotEmpty(menu.getChildList())) {
|
|
|
|
|
result.addAll(findChildList(menu.getChildList()));
|
|
|
|
|
}
|
|
|
|
|
result.add(menu);
|
|
|
|
|