From 1e9fe530b299f9bf1004a983be6fea266b4e8ddc Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期五, 03 十一月 2023 15:02:46 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/crm/manager/controller/PlanController.java |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/controller/PlanController.java b/src/main/java/com/zy/crm/manager/controller/PlanController.java
index 9a10e54..a7062dd 100644
--- a/src/main/java/com/zy/crm/manager/controller/PlanController.java
+++ b/src/main/java/com/zy/crm/manager/controller/PlanController.java
@@ -89,10 +89,22 @@
                   @RequestParam(required = false) String condition,
                   @RequestParam(required = false, value = "dept_id") Long deptId,
                   @RequestParam(required = false, value = "user_id") Long userId) {
+        Long director = null;
+        if (deptId==null && userId == null){
+            if (getRole().getId()==3){
+                userId = getUserId();
+            }else if (getRole().getId()==2){
+                deptId = getDeptId();
+                userId = null;
+            }
+            director = getUserId();
+        }
+
         return R.ok(planService.getPage(new Page<>(curr, limit)
                 , getHostId()
-                , deptId == null ? (userId == null? getDeptId().toString(): null) : String.valueOf(deptId)
+                , deptId == null ? null : String.valueOf(deptId)
                 , userId
+                , director
                 , condition)
         );
     }
@@ -698,6 +710,9 @@
 
             List<Long> typeList = new ArrayList<>();
         List<PlanType> planTypes = planTypeService.selectList(new EntityWrapper<PlanType>().eq("type", type));
+        if (type==1){
+            planTypes = planTypeService.selectList(new EntityWrapper<PlanType>());
+        }
         for (PlanType planType : planTypes){
             typeList.add(planType.getId());
         }

--
Gitblit v1.9.1