@@ -43,8 +43,11 @@ public class MenuBarServiceImpl implements IMenuBarService {
|
||||
|
||||
@Override
|
||||
public List<MenuBar> findMenuBarById(Integer userId) {
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleService.findById(userId)
|
||||
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> userCurrentRoleOpt = userCurrentRoleService.findById(userId);
|
||||
if (!userCurrentRoleOpt.isPresent()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleOpt.get();
|
||||
List<MenuBar> list = getMenuBarList(userCurrentRole.getSchId());
|
||||
List<MenuBar> result = list.stream().filter(MenuBar::getIsShow).collect(Collectors.toList());
|
||||
result = result.stream().sorted(Comparator.comparing(MenuBar::getOrderNum, Comparator.nullsLast(Integer::compareTo))).collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user