From 564bf7ab6a639c2c4557d35b8fd9b51dca60a738 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期二, 22 八月 2023 13:32:34 +0800
Subject: [PATCH] #规则完善

---
 src/main/java/com/zy/crm/manager/controller/CstmrController.java |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 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 f4ca4a2..5c9c60f 100644
--- a/src/main/java/com/zy/crm/manager/controller/CstmrController.java
+++ b/src/main/java/com/zy/crm/manager/controller/CstmrController.java
@@ -67,10 +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 = "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":
@@ -84,10 +97,11 @@
 
             }
         }
-        return R.ok(cstmrService.getPage1(new Page<>(curr, limit)
+        return R.ok(cstmrService.getPage3(new Page<>(curr, limit)
                 , getHostId()
                 , deptId == null ? null : String.valueOf(deptId)
                 , userId == null ? getUserId() : userId
+                , Cools.isEmpty(followerName) ? null : ids
                 , conditionName
                 , condition)
         );
@@ -135,6 +149,12 @@
         return R.ok();
     }
 
+    @RequestMapping(value = "/cstmr/delete/one/{id}")
+    @ManagerAuth
+    public R deleteOne(@PathVariable Long id) {
+        cstmrService.deleteById(id);
+        return R.ok();
+    }
 
 
     @RequestMapping(value = "/cstmrQuery/auth")

--
Gitblit v1.9.1