use of com.paascloud.provider.model.domain.UacRole in project paascloud-master by paascloud.
the class UacRoleMainController method modifyUacRoleStatusById.
/**
* 修改角色状态.
*
* @param modifyStatusDto the modify status dto
*
* @return the wrapper
*/
@LogAnnotation
@PostMapping(value = "/modifyRoleStatusById")
@ApiOperation(httpMethod = "POST", value = "根据角色Id修改角色状态")
public Wrapper modifyUacRoleStatusById(@ApiParam(name = "modifyRoleStatusDto", value = "修改角色状态数据") @RequestBody ModifyStatusDto modifyStatusDto) {
logger.info("根据角色Id修改角色状态 modifyStatusDto={}", modifyStatusDto);
Long roleId = modifyStatusDto.getId();
if (roleId == null) {
throw new UacBizException(ErrorCodeEnum.UAC10012001);
}
LoginAuthDto loginAuthDto = getLoginAuthDto();
Long userId = loginAuthDto.getUserId();
UacRoleUser ru = uacRoleUserService.getByUserIdAndRoleId(userId, roleId);
if (ru != null && UacRoleStatusEnum.DISABLE.getType().equals(modifyStatusDto.getStatus())) {
throw new UacBizException(ErrorCodeEnum.UAC10012002);
}
UacRole uacRole = new UacRole();
uacRole.setId(roleId);
uacRole.setStatus(modifyStatusDto.getStatus());
uacRole.setUpdateInfo(loginAuthDto);
int result = uacRoleService.update(uacRole);
return super.handleResult(result);
}
use of com.paascloud.provider.model.domain.UacRole in project paascloud-master by paascloud.
the class UacUserCommonController method queryUserInfo.
/**
* 根据userId查询用户详细信息(连表查询).
*
* @return the wrapper
*/
@PostMapping(value = "/queryUserInfo/{loginName}")
@ApiOperation(httpMethod = "POST", value = "根据userId查询用户详细信息")
public Wrapper<UserVo> queryUserInfo(@PathVariable String loginName) {
logger.info("根据userId查询用户详细信息");
UserVo userVo = new UserVo();
UacUser uacUser = uacUserService.findByLoginName(loginName);
uacUser = uacUserService.findUserInfoByUserId(uacUser.getId());
List<UacRole> roleList = uacRoleService.findAllRoleInfoByUserId(uacUser.getId());
List<MenuVo> authTree = uacRoleService.getOwnAuthTree(uacUser.getId());
BeanUtils.copyProperties(uacUser, userVo);
if (PublicUtil.isNotEmpty(roleList)) {
userVo.setRoles(new HashSet<>(roleList));
}
userVo.setAuthTree(authTree);
return WrapMapper.ok(userVo);
}
use of com.paascloud.provider.model.domain.UacRole in project paascloud-master by paascloud.
the class UacRoleServiceTest method findByLoginNameTest.
/**
* Find by login name test.
*/
@Test
public void findByLoginNameTest() {
UacRole admin = uacRoleService.findByRoleCode(GlobalConstant.Sys.SUPER_MANAGER_LOGIN_NAME);
logger.info("findByLoginNameTest = {}", admin);
}
Aggregations