use of com.paascloud.provider.model.domain.UacAction in project paascloud-master by paascloud.
the class UacActionServiceImpl method queryActionListWithPage.
@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public PageInfo queryActionListWithPage(ActionMainQueryDto actionMainQueryDto) {
List<Long> menuIdList = actionMainQueryDto.getMenuIdList();
Long menuId = null;
if (PublicUtil.isNotEmpty(menuIdList)) {
menuId = menuIdList.get(menuIdList.size() - 1);
}
UacAction uacAction = new UacAction();
uacAction.setMenuId(menuId);
BeanUtils.copyProperties(actionMainQueryDto, uacAction);
uacAction.setOrderBy("update_time desc");
PageHelper.startPage(actionMainQueryDto.getPageNum(), actionMainQueryDto.getPageSize());
List<ActionVo> actionList = uacActionMapper.queryActionListWithPage(uacAction);
return new PageInfo<>(actionList);
}
use of com.paascloud.provider.model.domain.UacAction in project paascloud-master by paascloud.
the class UacActionServiceImpl method deleteActionById.
@Override
public int deleteActionById(Long actionId) {
// 查询该角色下是否有用户绑定, 有的话提醒不能删除
if (null == actionId) {
throw new IllegalArgumentException("权限ID不能为空");
}
UacAction uacAction = uacActionMapper.selectByPrimaryKey(actionId);
if (uacAction == null) {
logger.error("找不到权限信息 actionId={}", actionId);
throw new UacBizException(ErrorCodeEnum.UAC10014001, actionId);
}
// 删除角色权限表数据 不查询了 直接删除了
uacRoleActionMapper.deleteByActionId(actionId);
return uacActionMapper.deleteByPrimaryKey(actionId);
}
use of com.paascloud.provider.model.domain.UacAction in project paascloud-master by paascloud.
the class UacLogServiceImpl method saveOperationLog.
@Override
public Integer saveOperationLog(OperationLogDto operationLogDto) {
// 根据uri 查询url对应的权限
UacAction uacAction = uacActionService.matchesByUrl(operationLogDto.getRequestUrl());
if (uacAction != null) {
operationLogDto.setActionCode(uacAction.getActionCode());
operationLogDto.setActionName(uacAction.getActionName());
operationLogDto.setActionId(uacAction.getId());
}
ModelMapper modelMapper = new ModelMapper();
UacLog uacLog = modelMapper.map(operationLogDto, UacLog.class);
uacLog.setId(generateId());
// 获取操作位置
String locationById = opcRpcService.getLocationById(operationLogDto.getIp());
uacLog.setLocation(locationById);
return uacLogMapper.insertSelective(uacLog);
}
use of com.paascloud.provider.model.domain.UacAction in project paascloud-master by paascloud.
the class UacLogServiceImpl method saveLog.
@Override
public int saveLog(UacLog uacLog, LoginAuthDto loginAuthDto) {
// 根据uri 查询url对应的权限
UacAction uacAction = uacActionService.matchesByUrl(uacLog.getRequestUrl());
if (uacAction != null) {
uacLog.setActionId(uacAction.getId());
uacLog.setActionCode(uacAction.getActionCode());
uacLog.setActionName(uacAction.getActionName());
}
uacLog.setUpdateInfo(loginAuthDto);
uacLog.setId(this.generateId());
return uacLogMapper.insertSelective(uacLog);
}
use of com.paascloud.provider.model.domain.UacAction in project paascloud-master by paascloud.
the class UacActionMainController method modifyActionStatus.
/**
* 根据权限Id修改角色状态.
*
* @param modifyStatusDto the modify status dto
*
* @return the wrapper
*/
@PostMapping(value = "/modifyStatus")
@ApiOperation(httpMethod = "POST", value = "根据权限Id修改角色状态")
@LogAnnotation
public Wrapper modifyActionStatus(@ApiParam(name = "modifyActionStatus", value = "修改权限状态") @RequestBody ModifyStatusDto modifyStatusDto) {
logger.info("根据角色Id修改权限状态 modifyStatusDto={}", modifyStatusDto);
Long actionId = modifyStatusDto.getId();
Preconditions.checkArgument(actionId != null, "权限ID不能为空");
UacAction uacRole = new UacAction();
uacRole.setId(actionId);
uacRole.setStatus(modifyStatusDto.getStatus());
uacRole.setUpdateInfo(getLoginAuthDto());
int result = uacActionService.update(uacRole);
return super.handleResult(result);
}
Aggregations