zhangqiankun 3 éve
szülő
commit
4a74d890cd

+ 16 - 21
saas-account/src/main/java/com/persagy/person/controller/SaasAccountController.java

@@ -120,6 +120,22 @@ public class SaasAccountController {
     }
     
     /**
+     * 根据账号名称获取账号信息
+     */
+    @ApiOperation(value = "根据账号名称获取账号信息")
+    @RequestMapping(value = "querySaasAccountByUsername")
+    public ResponseResult querySaasAccountByUsername(@RequestBody @Validated SaasAccountQueryByNameVO queryVO) {
+        SaasAccount saasAccount = new SaasAccount();
+        BeanUtils.copyProperties(queryVO, saasAccount);
+        LambdaQueryWrapper<SaasAccount> queryWrapper = this.saasAccountService.getQueryWrapperByUsername(saasAccount);
+        List<SaasAccount> list = this.saasAccountService.list(queryWrapper);
+        if (CollectionUtil.isEmpty(list)) {
+            return ResponseResultUtil.successResult(Lists.newArrayList(), 0L);
+        }
+        return ResponseResultUtil.successResult(list, (long)list.size());
+    }
+    
+    /**
      * 新增,登录用户名,全局唯一
      */
 	@ApiOperation(value = "保存")
@@ -277,25 +293,4 @@ public class SaasAccountController {
         return result ? ResponseResultUtil.successResult("密码重置成功") : ResponseResultUtil.errorResult("密码重置失败");
     }
 
-
-    /**
-     * 根据账号名称获取账号信息
-     */
-    @ApiOperation(value = "根据账号名称获取账号信息")
-    @RequestMapping(value = "querySaasAccountByUsername")
-    public ResponseResult querySaasAccountByUsername(@RequestBody @Validated SaasAccountQueryByNameVO queryVO) {
-        SaasAccount saasAccount = new SaasAccount();
-        BeanUtils.copyProperties(queryVO, saasAccount);
-        LambdaQueryWrapper<SaasAccount> queryWrapper = this.saasAccountService.getQueryWrapperByUsername(saasAccount);
-        queryWrapper.orderByDesc(SaasAccount::getUpdateTime);		//更新时间降序
-        List<SaasAccount> list = this.saasAccountService.list(queryWrapper);
-        if (CollectionUtil.isEmpty(list)) {
-            return ResponseResultUtil.successResult(Lists.newArrayList(), 0L);
-        }
-        return ResponseResultUtil.successResult(list, (long)list.size());
-    }
-
-
-
-    
 }

+ 17 - 19
saas-account/src/main/java/com/persagy/person/controller/SaasRoleController.java

@@ -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());
-    }
     
 }

+ 1 - 3
saas-account/src/main/java/com/persagy/person/pojo/vo/account/SaasAccountQueryByNameVO.java

@@ -20,7 +20,7 @@ import javax.validation.constraints.NotBlank;
 @Setter
 @ApiModel
 @ToString
-public class SaasAccountQueryByNameVO  {
+public class SaasAccountQueryByNameVO {
 
     @NotBlank(message = "账号所属,不可为空")
     @ApiModelProperty(value = "账号所属, 0-运维系统账号,1-业务账号", example = "0")
@@ -34,6 +34,4 @@ public class SaasAccountQueryByNameVO  {
 	@ApiModelProperty(value = "登录用户名", example = "zhangsan")
 	private String username; // 登录用户名
 
-
-
 }