use of com.paascloud.provider.model.domain.UacMenu in project paascloud-master by paascloud.
the class UacMenuServiceImpl method buildParentNote.
/**
* 递归获取菜单的父菜单
*/
private List<UacMenu> buildParentNote(List<UacMenu> uacMenuList, UacMenu uacMenu) {
List<UacMenu> uacMenuQueryList = mapper.select(uacMenu);
UacMenu uacMenuQuery;
for (UacMenu menu : uacMenuQueryList) {
if (UacMenuStatusEnum.DISABLE.getType().equals(menu.getStatus()) && !MenuConstant.MENU_LEVEL_ROOT.equals(menu.getLevel())) {
// 禁用状态
uacMenuList.add(menu);
}
uacMenuQuery = new UacMenu();
uacMenuQuery.setId(menu.getPid());
buildParentNote(uacMenuList, uacMenuQuery);
}
return uacMenuList;
}
use of com.paascloud.provider.model.domain.UacMenu in project paascloud-master by paascloud.
the class UacMenuServiceImpl method buildNode.
/**
* 递归获取菜单的子菜单
*/
private List<UacMenu> buildNode(List<UacMenu> uacMenuList, UacMenu uacMenu, String menuStatus) {
List<UacMenu> uacMenuQueryList = mapper.select(uacMenu);
UacMenu uacMenuQuery;
for (UacMenu menu : uacMenuQueryList) {
// 启用状态
if (menuStatus.equals(menu.getStatus()) && !MenuConstant.MENU_LEVEL_ROOT.equals(menu.getLevel())) {
uacMenuList.add(menu);
}
uacMenuQuery = new UacMenu();
uacMenuQuery.setPid(menu.getId());
buildNode(uacMenuList, uacMenuQuery, menuStatus);
}
return uacMenuList;
}
use of com.paascloud.provider.model.domain.UacMenu in project paascloud-master by paascloud.
the class UacMenuServiceImpl method checkMenuHasChildMenu.
@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public boolean checkMenuHasChildMenu(Long pid) {
Preconditions.checkArgument(pid != null, "菜单pid不能为空");
UacMenu uacMenu = new UacMenu();
uacMenu.setStatus(UacMenuStatusEnum.ENABLE.getType());
uacMenu.setPid(pid);
return mapper.selectCount(uacMenu) > 0;
}
use of com.paascloud.provider.model.domain.UacMenu in project paascloud-master by paascloud.
the class UacMenuServiceImpl method getMenuVo.
private List<MenuVo> getMenuVo(List<UacMenu> list) {
List<MenuVo> menuVoList = Lists.newArrayList();
for (UacMenu uacMenu : list) {
MenuVo menuVo = new MenuVo();
BeanUtils.copyProperties(uacMenu, menuVo);
menuVo.setUrl(uacMenu.getUrl());
menuVo.setMenuName(uacMenu.getMenuName());
menuVoList.add(menuVo);
}
return menuVoList;
}
use of com.paascloud.provider.model.domain.UacMenu in project paascloud-master by paascloud.
the class UacMenuServiceImpl method enableMenuList.
@Override
public int enableMenuList(List<UacMenu> menuList, LoginAuthDto loginAuthDto) {
UacMenu uacMenuUpdate = new UacMenu();
int sum = 0;
for (UacMenu menu : menuList) {
uacMenuUpdate.setId(menu.getId());
uacMenuUpdate.setVersion(menu.getVersion() + 1);
uacMenuUpdate.setStatus(UacMenuStatusEnum.ENABLE.getType());
uacMenuUpdate.setLastOperator(loginAuthDto.getLoginName());
uacMenuUpdate.setLastOperatorId(loginAuthDto.getUserId());
uacMenuUpdate.setUpdateTime(new Date());
int result = mapper.updateByPrimaryKeySelective(uacMenuUpdate);
if (result > 0) {
sum += 1;
} else {
throw new UacBizException(ErrorCodeEnum.UAC10013004, menu.getId());
}
}
return sum;
}
Aggregations