From f990d41ed26b2640ca87d13d53e0dd85675aafb5 Mon Sep 17 00:00:00 2001 From: LSH Date: 星期四, 10 八月 2023 08:20:00 +0800 Subject: [PATCH] # --- src/main/java/com/zy/crm/manager/controller/CstmrController.java | 27 ++++++++++++++++----------- 1 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/zy/crm/manager/controller/CstmrController.java b/src/main/java/com/zy/crm/manager/controller/CstmrController.java index a3d3769..3a0a600 100644 --- a/src/main/java/com/zy/crm/manager/controller/CstmrController.java +++ b/src/main/java/com/zy/crm/manager/controller/CstmrController.java @@ -67,11 +67,23 @@ @ManagerAuth public R page(@RequestParam(defaultValue = "1") Integer curr, @RequestParam(defaultValue = "10") Integer limit, + @RequestParam(required = false) String followerName, @RequestParam(required = false) String conditionName, @RequestParam(required = false) String condition, @RequestParam(required = false, value = "dept_id") Long deptId, - @RequestParam(required = false, value = "role_id") Long roleId, @RequestParam(required = false, value = "user_id") Long userId){ + List<Integer> ids = new ArrayList<>(); + if (!Cools.isEmpty(followerName)){ + User username = userService.selectOne(new EntityWrapper<User>().eq("username", followerName)); + if (!Cools.isEmpty(username)){ + List<CstmrFoll> cstmrIds = cstmrFollService.selectCstmrIdUserId(username.getId().intValue()); + for (CstmrFoll id : cstmrIds){ + ids.add(id.getCstmrId().intValue()); + } + }else { + return R.error("鏈煡璇㈠埌璺熻繘浜轰俊鎭紒"); + } + } if (!Cools.isEmpty(conditionName)){ switch (conditionName){ case "director": @@ -85,18 +97,11 @@ } } -// return R.ok(cstmrService.getPage1(new Page<>(curr, limit) -// , getHostId() -// , deptId == null ? null : String.valueOf(deptId) -// , userId == null ? getUserId() : userId -// , conditionName -// , condition) -// ); - return R.ok(cstmrService.getPage2(new Page<>(curr, limit) + return R.ok(cstmrService.getPage3(new Page<>(curr, limit) , getHostId() - , deptId == null ? userService.selectById(getUserId()).getDeptId() : deptId + , deptId == null ? null : String.valueOf(deptId) , userId == null ? getUserId() : userId - , roleId == null ? userService.selectById(getUserId()).getRoleId() : roleId + , Cools.isEmpty(followerName) ? null : ids , conditionName , condition) ); -- Gitblit v1.9.1