use of com.paascloud.provider.model.vo.ViewMenuVo in project paascloud-master by paascloud.
the class UacMenuServiceImpl method getViewVoById.
@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ViewMenuVo getViewVoById(Long id) {
Preconditions.checkArgument(id != null, "菜单ID不能为空");
UacMenu menu = uacMenuMapper.selectByPrimaryKey(id);
if (menu == null) {
logger.error("找不到菜单信息id={}", id);
throw new UacBizException(ErrorCodeEnum.UAC10013003, id);
}
// 获取父级菜单信息
UacMenu parentMenu = uacMenuMapper.selectByPrimaryKey(menu.getPid());
ModelMapper modelMapper = new ModelMapper();
ViewMenuVo menuVo = modelMapper.map(menu, ViewMenuVo.class);
if (parentMenu != null) {
menuVo.setParentMenuName(parentMenu.getMenuName());
}
return menuVo;
}
Aggregations