Kaynağa Gözat

app,增加获取审批人接口

yangguanjin 5 gün önce
ebeveyn
işleme
06097c134c

+ 19 - 0
tz-module-system/tz-module-system-biz/src/main/java/cn/start/tz/module/system/controller/appapi/user/AppApiUserController.java

@@ -99,6 +99,25 @@ public class AppApiUserController {
 //        return success(convert);
 //    }
 
+    @GetMapping("/get-by-role")
+    @Operation(summary = "根据角色编码获取用户")
+    //
+    public CommonResult<PageResult<UserRespVO>> getUserByRoleCod(@Valid UserPageReqVO pageReqVO) {
+        if(pageReqVO.getPageSize() == null){
+            pageReqVO.setPageSize(100);
+        }
+        // 获得用户分页列表
+        PageResult<AdminUserDO> pageResult = userService.getUserPageByRole(pageReqVO);
+        if (CollUtil.isEmpty(pageResult.getList())) {
+            return success(new PageResult<>(pageResult.getTotal()));
+        }
+        // 拼接数据
+        Map<String, DeptDO> deptMap = deptService.getDeptMap(
+                convertList(pageResult.getList(), AdminUserDO::getDeptId));
+        return success(new PageResult<>(UserConvert.INSTANCE.convertList(pageResult.getList(), deptMap),
+                pageResult.getTotal()));
+    }
+
 
 
 }