|
@@ -121,6 +121,23 @@ public class SaasRoleController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 根据角色名称查询角色信息
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "根据角色名称查询角色信息")
|
|
|
+ @RequestMapping(value = "querySaasRoleByName")
|
|
|
+ public ResponseResult querySaasRoleByName(@RequestBody @Validated SaasRoleQueryByNameVO queryVO) {
|
|
|
+ SaasRole saasRole = new SaasRole();
|
|
|
+ BeanUtils.copyProperties(queryVO,saasRole);
|
|
|
+ LambdaQueryWrapper<SaasRole> queryWrapper = new SaasRole.Builder().createQueryWrapper()
|
|
|
+ .groupCodeEq(saasRole.getGroupCode()).roleNameEq(queryVO.getRoleName()).builderQueryWrapper();
|
|
|
+ List<SaasRole> list = this.saasRoleService.list(queryWrapper);
|
|
|
+ if (CollectionUtil.isEmpty(list)) {
|
|
|
+ return ResponseResultUtil.successResult(Lists.newArrayList(), 0L);
|
|
|
+ }
|
|
|
+ return ResponseResultUtil.successResult(list, (long)list.size());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 新增 角色名称唯一
|
|
|
*/
|
|
|
@ApiOperation(value = "保存")
|
|
@@ -203,24 +220,5 @@ public class SaasRoleController {
|
|
|
result = this.saasRoleMenuHandler.deleteSaasRole(deleteVO);
|
|
|
return result ? ResponseResultUtil.successResult("删除成功") : ResponseResultUtil.errorResult("删除失败");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据角色名称查询角色信息
|
|
|
- */
|
|
|
- @ApiOperation(value = "根据角色名称查询角色信息")
|
|
|
- @RequestMapping(value = "querySaasRoleByName")
|
|
|
- public ResponseResult querySaasRoleByName(@RequestBody @Validated SaasRoleQueryByNameVO queryVO) {
|
|
|
- SaasRole saasRole = new SaasRole();
|
|
|
- BeanUtils.copyProperties(queryVO,saasRole);
|
|
|
- LambdaQueryWrapper<SaasRole> queryWrapper = new SaasRole.Builder().createQueryWrapper()
|
|
|
- .groupCodeEq(saasRole.getGroupCode()).roleNameEq(queryVO.getRoleName()).builderQueryWrapper();
|
|
|
- queryWrapper.orderByDesc(SaasRole::getUpdateTime); // 默认更新时间降序
|
|
|
- List<SaasRole> list = this.saasRoleService.list(queryWrapper);
|
|
|
- if (CollectionUtil.isEmpty(list)) {
|
|
|
- return ResponseResultUtil.successResult(Lists.newArrayList(), 0L);
|
|
|
- }
|
|
|
- return ResponseResultUtil.successResult(list, (long)list.size());
|
|
|
- }
|
|
|
|
|
|
}
|